juju.relation
Summary
Methods: |
Reference
- class juju.relation.Endpoint(model, data)[source]
Bases:
object
- property application
Application returns the underlying application model from the state. If no application is found, then a JujuEntityNotFoundError is raised, in this scenario it is expected that you disconnect and reconnect to the model.
- property application_name
- property interface
- property name
- property role
- property scope
- class juju.relation.Relation(entity_id: str, model: Model, history_index: int = -1, connected: bool = True)[source]
Bases:
ModelEntity
- property applications
All applications involved in this relation.
- property endpoints
- property is_peer
- property is_subordinate
- matches(*specs)[source]
Check if this relation matches relationship specs.
Relation specs are strings that would be given to Juju to establish a relation, and should be in the form
<application>[:<endpoint_name>]
where the:<endpoint_name>
suffix is optional. If the suffix is omitted, this relation will match on any endpoint as long as the given application is involved.In other words, this relation will match a spec if that spec could have created this relation.
- Returns:
True if all specs match.
- property peers
The peers endpoint of this relation, or None.
- property provides
The endpoint on the provides side of this relation, or None.
- property requires
The endpoint on the requires side of this relation, or None.