anatools.anaclient.workspaces module

Workspace Functions

create_workspace(self, name, description='', channelIds=[], volumeIds=[], code=None, tags=None, organizationId=None)

Create a new workspace with specific channels.

Parameters
  • name (str) – Workspace name.

  • description (str) – Workspace description.

  • channelIds (list[str]) – List of channel ids to add to workspace.

  • volumeIds (list[str]) – List of volume ids that the workspace will have access to.

  • code (str) – Content code that used for creating a workspace

  • tags (list[str]) – List of tags to add to workspace.

  • organizationId (str) – Organization ID. Defaults to current if not specified.

Returns

Workspace ID if creation was successful. Otherwise returns message.

Return type

str

delete_workspace(self, workspaceId=None)

Delete an existing workspace.

Parameters

workspaceId (str) – Workspace ID for workspace to get deleted. Deletes current workspace if not specified.

Returns

Success or failure message if workspace was sucessfully removed.

Return type

str

edit_workspace(self, name=None, description=None, channelIds=None, volumeIds=None, ganIds=None, mapIds=None, tags=None, workspaceId=None)

Edit workspace information.

Parameters
  • name (str) – New name to replace old one.

  • description (str) – New description to replace old one.

  • channelIds (list[str]) – Names of channels that the workspace will have access to.

  • volumeIds (list[str]) – List of volume ids that the workspace will have access to.

  • ganIds (list[str]) – List of GAN ids that the workspace will have access to.

  • mapIds (list[str]) – List of map ids that the workspace will have access to.

  • tags (list[str]) – List of tags to add or remove.

  • workspaceId (str) – Workspace ID for workspace to update.

Returns

Success or failure message if workspace was sucessfully updated.

Return type

bool

get_workspaces(self, organizationId=None, workspaceId=None, cursor=None, limit=None, filters=None, fields=None)

Shows list of workspaces with id, name, and owner data.

Parameters
  • organizationId (str) – Organization ID to filter on. Optional

  • workspaceId (str) – Workspace ID to filter on. Optional

  • cursor (str) – Cursor for pagination.

  • limit (int) – Maximum number of workspaces to return.

  • filters (dict) – Filters that limit output to entries that match the filter

  • fields (list) – List of fields to return, leave empty to get all fields.

Returns

Workspace data for all workspaces for a user.

Return type

list[dict]

mount_workspaces(self, workspaces)

Retrieves credentials for mounting workspaces.

Parameters

workspaces ([str]) – Workspaces to retrieve mount credentials for.

Returns

Credential information.

Return type

dict

set_workspace(self, workspaceId)

Set the workspace to the one you wish to work in.

Parameters

workspaceId (str) – Workspace ID for the workspace you wish to work in.