anatools.anaclient.channels module

Channels Functions

add_channel_access(self, channelId, organizationId)

Add access to a channel for an organization.

Parameters
  • channelId (str) – Id of channel to add access for.

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

Returns

Access status.

Return type

str

build_managed_channel(self, channelfile)

Build the Docker image of a channel.

Parameters

channelfile (str) – The channel file for the channel to build.

Returns

A boolean that indicates if the channel Docker image was successfully built.

Return type

bool

create_managed_channel(self, name, organizationId=None, volumes=[], instance='p2.xlarge', timeout=120, interfaceVersion=1)

Create a managed channel for your organization.

Parameters
  • name (str) – Channel name.

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

  • volumes (list[str]) – List of the data volume names to associate with this channel.

  • instance (str) – AWS Instance type.

  • timeout (int) – Maximum runtime of a channel run.

  • interface (int) – The ana interface version number.

Returns

channel data

Return type

list[dict]

deploy_managed_channel(self, channelId=None, channelfile=None, image=None)

Deploy the Docker image of a channel.

Parameters
  • channelId (str) – Channel ID that you are pushing the image to. If the channelId isn’t specified, it will use the image name to lookup the channelId.

  • image (str) – The Docker image name. This should match the channel name when running ana. If image is not specified, it will use the channel name for the channelId.

Returns

deploymentId for current round of deployment or an error message if something went wrong

Return type

str

edit_managed_channel(self, channelId, name=None, volumes=None, instance=None, timeout=None, status=None, interfaceVersion=None)

Edit a managed channel for your organization.

Parameters
  • channelId (str) – ChannelId ID of the channel to edit.

  • name (name) – The new name to give the channel.

  • volumes (list[str]) – Data volumes for the channel.

  • instance (str) – Instance type to run the channel on.

  • timeout (int) – Maximum runtime for the channel run.

  • status (str) – The status of the channel.

  • interface (int) – The ana interface version number.

Returns

If true, the channel was successfully edited.

Return type

bool

get_channel_documentation(self, channelId, localDir=None)

Downloads a markdown file for channel documentation.

Parameters
  • channelID (str) – The channelId of the channel

  • localDir (str) – The location to download the file to.

Returns

The list of filenames downloaded.

Return type

list[str]

get_channels(self, organizationId=None, workspaceId=None, channelId=None)

Shows all channels available to the user. Can filter by organizationId, workspaceId, or channelId.

Parameters
  • organizationId (str) – Filter channel list on what’s available to the organization.

  • workspaceId (str) – Filter channel list on what’s available to the workspace.

  • channelId (str) – Filter channel list on the specific channelId.

Returns

List of channels associated with user, workspace, organization or channelId.

Return type

list[dict]

get_deployment_status(self, deploymentId, stream=False)

Retrieves status for a channel’s deployment.

Parameters
  • deploymentId (str) – The deploymentId to retrieve status for

  • stream (bool) – Flag to print information to the terminal so the user can avoid constant polling to retrieve status.

Returns

Deployment status.

Return type

list[dict]

get_managed_channels(self, channelId=None, organizationId=None)

Get information for all managed channels that you own within your organization.

Parameters
  • channelId (str) – Channel Id to filter.

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

Returns

channel data

Return type

list[dict]

remove_channel_access(self, channelId, organizationId)

Remove access to a channel for an organization.

Parameters
  • channelId (str) – Id of channel to remove access to.

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

Returns

Access status.

Return type

str

upload_channel_documentation(self, channelId, mdfile)

Uploads a markdown file for channel documentation.

Parameters
  • channelID (str) – The channelId of the channel

  • mdfile (str) – The filepath of the markdown file used for channel documentation.

Returns

Success/Failure of channel documenation upload.

Return type

bool