Storage Container

Storage Containers are scalable data storage. An example of this would be Amazon S3 buckets. This class inherits from TopLevelResource and has direct access to the resource’s database object.

Attribute

Description

resource_id

The primary resource identifier that takes the form of a prefix followed by numbers and letters

organization_service_id

The ID of the parent organization service (cloud)

region_name

The region that the storage container resides in

name

The name of the storage container

creation_date

The date that the the storage container was created

last_modified

The date that the storage container was last modified

object_count

The total number of objects within storage container

total_size

The total size of the storage container (bytes)

policy

Denotes whether a container or user policy is associated with this storage container

encrypted

Denotes whether this storage container is encrypted

logging

Denotes whether access logging is enabled

versioning

Denotes whether object versioning is enabled

Storage Container Operations

delete(user_resource_id=None)
Delete this resource. If wrapped in a with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it calls immediately.
get_date_created()
Retrieve the time from the provider that this resource was created (if available).

static get_db_class()

classmethod get_encrypted_status(policy)

get_merged_permissions(new_permissions, delete=False)
Build a list of current and existing permissions. This is required as the cloud providers want a full list of permissions. If you do not do this then existing permissions will be lost.

static get_provider_id_field()

static get_resource_type()

get_supported_actions()
Retrieve all the actions which are supported by this resource.
handle_resource_created(user_resource_id=None, project_resource_id=None)
This should be called when a resource is created/discovered after the basic data is added to the database. This gives an opportunity for post-addition hooks (assignment to groups, alerts, etc).
handle_resource_destroyed(user_resource_id=None)
This should be called when a resource is destroyed before the basic data is removed from the database. This gives an opportunity for pre-destruction hooks (removal from groups, alerts, etc).
handle_resource_modified(resource, *args, **kwargs)
This should be called when a resource is modified after the new data has been updated in the DB session. This gives an opportunity for post-modification hooks.
properties
This is a temporary override similar to how we set up the resource object for resource groups and other select resources. After spending three hours debugging it was decided that this is the less expensive route. It fixes the bug in the current version.

storage_container

top_level_resource = True