Workspaces

Workspaces are virtual desktops, such as AWS Workspaces. 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 workspace resides in
attr workspace_id:
 The ID of the workspace
attr name:The name of the workspace
attr directory_resource_id:
 The provider ID of the workspace
attr user_name:The username for the workspace user
attr ip_address:
 IP address of workspace
attr state:State of workspace (available, stopped, etc)
attr bundle_resource_id:
 The provider ID of the workspace bundle
attr subnets:Subnets associated to the workspace
attr error_message:
 The error message for the workspace
attr error_code:
 The error code for the workspace
attr computer_name:
 The computer name given to the workspace
attr volume_encryption_key:
 The encryption key for the volume of the workspace
attr user_volume_encryption_enabled:
 Denotes if user volume encryption is enabled
attr root_volume_encryption_enabled:
 Denotes if root volume encryption is enabled
attr running_mode:
 Running mode for workspace (always_on, auto_stop, etc)
attr auto_stop_timeout:
 Auto stop timeout for workspace in munutes
attr root_volume_size:
 Root volume size of workspace in GiB
attr user_volume_size:
 User volume size of workspace in Gib
attr compute_type:
 The compute type of the workspace (standard, graphics, etc)
class DivvyResource.Resources.workspace.Workspace(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

Workspace operations

delete(user_resource_id=None)
get_compute_type()
static get_db_class()
static get_provider_id_field()
static get_resource_type()
get_supported_actions()

Retrieve all the actions which are supported by this resource.

Restricts actions by resource state

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 projects/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 projects/groups, alerts, etc).

handle_resource_modified(*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

organization_service_id
reboot()
rebuild()
region_name
start()
stop()
top_level_resource = True
workspace
workspace_id