This is the provides side of the interface layer, for use only by the AWS 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 AWS integration features. The AWS integration charm should then iterate over each request, perform whatever actions are necessary to satisfy those requests, and then mark them as complete.
class AWSIntegrationProvides(Endpoint)
Example usage:
from charms.reactive import when, endpoint_from_flag
from charms import layer
@when('endpoint.aws.requested')
def handle_requests():
aws = endpoint_from_flag('endpoint.aws.requested')
for request in aws.requests:
if request.instance_tags:
tag_instance(
request.instance_id,
request.region,
request.instance_tags)
if request.requested_load_balancer_management:
layer.aws.enable_load_balancer_management(
request.application_name,
request.instance_id,
request.region,
)
# ...
request.mark_completed()
@property
def requests()
A list of the new or updated IntegrationRequest
objects that
have been made.
@property
def all_requests()
A list of all the IntegrationRequest
objects that have been made,
even if unchanged.
@property
def application_names()
Set of names of all applications that are still joined.
@property
def unit_instances()
Mapping of unit names to instance IDs and regions for all joined units.
class IntegrationRequest()
A request for integration from a single remote unit.
@property
def hash()
SHA hash of the data for this request.
@property
def changed()
Whether this request has changed since the last time it was marked completed.
def mark_completed()
Mark this request as having been completed.
def clear()
Clear this request's cached data.
@property
def unit_name()
The name of the unit making the request.
@property
def application_name()
The name of the application making the request.
@property
def instance_id()
The instance ID reported for this request.
@property
def region()
The region reported for this request.
@property
def instance_tags()
Mapping of tag names to values (or None
) to apply to this instance.
@property
def instance_security_group_tags()
Mapping of tag names to values (or None
) to apply to this instance's
machine-specific security group (firewall).
@property
def instance_subnet_tags()
Mapping of tag names to values (or None
) to apply to this instance's
subnet.
@property
def requested_instance_inspection()
Flag indicating whether the ability to inspect instances was requested.
@property
def requested_acm_readonly()
Flag indicating whether acm readonly was requested.
@property
def requested_acm_fullaccess()
Flag indicating whether acm fullaccess was requested.
@property
def requested_network_management()
Flag indicating whether the ability to manage networking (firewalls, subnets, etc) was requested.
@property
def requested_load_balancer_management()
Flag indicating whether load balancer management was requested.
@property
def requested_block_storage_management()
Flag indicating whether block storage management was requested.
@property
def requested_dns_management()
Flag indicating whether DNS management was requested.
@property
def requested_object_storage_access()
Flag indicating whether object storage access was requested.
@property
def object_storage_access_patterns()
List of patterns to which to restrict object storage access.
@property
def requested_object_storage_management()
Flag indicating whether object storage management was requested.
@property
def object_storage_management_patterns()
List of patterns to which to restrict object storage management.