Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Latest commit

 

History

History
175 lines (96 loc) · 4.76 KB

provides.md

File metadata and controls

175 lines (96 loc) · 4.76 KB

provides

This is the provides side of the interface layer, for use only by the Azure integrator 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 Azure integration features. The Azure integration charm should then iterate over each request, perform whatever actions are necessary to satisfy those requests, and then mark them as complete.

AzureIntegrationProvides

AzureIntegrationProvides(self, endpoint_name, relation_ids=None)

Example usage:

from charms.reactive import when, endpoint_from_flag
from charms import layer

@when('endpoint.azure.requests-pending')
def handle_requests():
    azure = endpoint_from_flag('endpoint.azure.requests-pending')
    for request in azure.requests:
        if request.instance_tags:
            layer.azure.tag_instance(
                request.vm_name,
                request.resource_group,
                request.instance_tags)
        if request.requested_load_balancer_management:
            layer.azure.enable_load_balancer_management(
                request.charm,
                request.vm_name,
                request.resource_group,
            )
        # ...
    azure.mark_completed()

relation_ids

A list of the IDs of all established relations.

requests

A list of the new or updated IntegrationRequests that have been made.

get_departed_charms

AzureIntegrationProvides.get_departed_charms(self)

Get a list of all charms that have had all units depart since the last time this was called.

mark_completed

AzureIntegrationProvides.mark_completed(self)

Mark all requests as completed and remove the requests-pending flag.

IntegrationRequest

IntegrationRequest(self, unit)

A request for integration from a single remote unit.

application_name

The name of the application making the request.

charm

The charm name reported for this request.

instance_tags

Mapping of tag names to values to apply to this instance.

is_changed

Whether this request has changed since the last time it was marked completed (if ever).

model_uuid

The UUID of the model containing the application making this request.

relation_id

The ID of the relation for the unit making the request.

requested_block_storage_management

Flag indicating whether block storage management was requested.

requested_dns_management

Flag indicating whether DNS management was requested.

requested_instance_inspection

Flag indicating whether the ability to inspect instances was requested.

requested_network_management

Flag indicating whether the ability to manage networking was requested.

requested_object_storage_access

Flag indicating whether object storage access was requested.

requested_object_storage_management

Flag indicating whether object storage management was requested.

requested_security_management

Flag indicating whether security management was requested.

resource_group

The resource group reported for this request.

unit_name

The name of the unit making the request.

vm_id

The instance ID reported for this request.

vm_name

The instance name reported for this request.

mark_completed

IntegrationRequest.mark_completed(self)

Mark this request as having been completed.