juju.relation

Summary

Endpoint
 
Relation

Methods:

Reference

class juju.relation.Endpoint(model, data)[source]

Bases: object

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.

application_name
interface
name
role
scope
class juju.relation.Relation(entity_id, model, history_index=-1, connected=True)[source]

Bases: juju.model.ModelEntity

applications

All applications involved in this relation.

coroutine destroy()[source]
endpoints
is_peer
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.
peers

The peers endpoint of this relation, or None.

provides

The endpoint on the provides side of this relation, or None.

requires

The endpoint on the requires side of this relation, or None.