This is the provides side of the interface layer, for use only by the GCP integration charm itself.
The flags that are set by the provides side of this interface are:
endpoint.{endpoint_name}.requested
This flag is set when there is a new or updated request by a remote unit for GCP integration features. The GCP integration charm should then iterate over each request, perform whatever actions are necessary to satisfy those requests, and then mark them as complete.
GCPIntegrationProvides(self, endpoint_name, relation_ids=None)
Example usage:
from charms.reactive import when, endpoint_from_flag
from charms import layer
@when('endpoint.gcp.requests-pending')
def handle_requests():
gcp = endpoint_from_flag('endpoint.gcp.requests-pending')
for request in gcp.requests:
if request.instance_labels:
layer.gcp.label_instance(
request.instance,
request.zone,
request.instance_labels)
if request.requested_load_balancer_management:
layer.gcp.enable_load_balancer_management(
request.charm,
request.instance,
request.zone,
)
# ...
gcp.mark_completed()
A list of the IDs of all established relations.
A list of the new or updated IntegrationRequests
that
have been made.
GCPIntegrationProvides.get_departed_charms(self)
Get a list of all charms that have had all units depart since the last time this was called.
GCPIntegrationProvides.mark_completed(self)
Mark all requests as completed and remove the requests-pending
flag.
IntegrationRequest(self, unit)
A request for integration from a single remote unit.
The name of the application making the request.
The charm name reported for this request.
Whether or not credentials have been set via set_credentials
.
The instance name reported for this request.
Mapping of label names to values to apply to this instance.
Whether this request has changed since the last time it was marked completed (if ever).
The UUID of the model containing the application making this request.
The ID of the relation for the unit making the request.
Flag indicating whether block storage management was requested.
Flag indicating whether DNS management was requested.
Flag indicating whether the ability to inspect instances was requested.
Flag indicating whether the ability to manage networking was requested.
Flag indicating whether object storage access was requested.
Flag indicating whether object storage management was requested.
Flag indicating whether security management was requested.
The name of the unit making the request.
The zone reported for this request.
IntegrationRequest.mark_completed(self)
Mark this request as having been completed.
IntegrationRequest.set_credentials(self, credentials)
Set the credentials for this request.