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. The following attributes are directly accessible:

attr resource_id:
 The primary resource identifier that takes the form of a prefix followed by numbers and letters
attr organization_service_id:
 The ID of the parent organization service (cloud)
attr region_name:
 The region that the storage container resides in
attr name:The name of the storage container
attr creation_date:
 The date that the the storage container was created
attr last_modified:
 The date that the storage container was last modified
attr object_count:
 The total number of objects within storage container
attr total_size:
 The total size of the storage container (bytes)
attr policy:Denotes whether a container or user policy is associated with this storage container
attr encrypted:Denotes whether this storage container is encrypted
attr logging:Denotes whether access logging is enabled
attr versioning:
 Denotes whether object versioning is enabled
class DivvyResource.Resources.storagecontainer.StorageContainer(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

Storage Container Operations

Delete this resource. If wrapped in a with JobQueue() block, this will queue the deletion job to the wrapped queue, otherwise it
calls immediately.

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 requred 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()

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)


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


This is a temporary override similar to how we set up the resource object for resource groups and other select resources. For some reason even though the DivvyDbObject definition inherits LinkedResource_Mixin there are select corner cases where properties is not found. After spending three hours debugging it was decided that this is the less expensive route. It fixes the bug in the current version.

TODO: If someone really has the time, find out why this is required and then burn this override with fire.

top_level_resource = True