anatools.anaclient.editor module

Editor Functions

create_editor(self, organizationId=None, workspaceId=None, serviceId=None, instance=None)

Creates a new editor session for a workspace or service.

Parameters
  • organizationId (str) – The ID of the organization to create the editor session for.

  • workspaceId (str) – The ID of the workspace to create the editor session for.

  • serviceId (str) – The ID of the service to create the editor session for.

  • instance (str) – The instance of the editor session to create.

Returns

A dictionary representing the result of the editor session creation.

Return type

dict

create_remote_development(self, channelId, organizationId=None, channelVersion=None, instanceType=None)

Creates a remote development environment.

This method initiates a remote development session on the specified channel, optionally within a given organization. If no organizationId is provided, it defaults to the organization associated with the current user.

Parameters
  • channelId (str) – The ID of the channel to use for creating the remote development session.

  • channelVersion (str, optional) – The version of the channel to use. If not provided, defaults to the latest version.

  • organizationId (str, optional) – The ID of the organization where the session will be created. If not provided, defaults to the user’s organization.

  • instanceType (str, optional) – The type of instance to use for the remote development session. If not provided, defaults to the instance type specified in the channel.

Returns

A message indicating that the session is being created, along with a link to access the session.

Return type

str

Notes

  • This function checks if the user is logged out before proceeding.

  • Calls ana_api.createRemoteDevelopment to initiate the session.

  • Displays a warning message indicating that the feature is experimental.

Example Output

⚠️ Warning: This feature is very experimental. Use with caution! ⚠️ 🚀 Your environment will be available here shortly: 🔗 <editorUrl> 🌐

delete_editor(self, editorId)

Deletes an editor session.

Parameters

editorId (str) – The ID of the editor session to delete.

Returns

If true, the editor session was successfully deleted.

Return type

bool

delete_remote_development(self, editorSessionId=None)

Deletes a remote development session.

This method removes a specific editor session, optionally within a given organization. If no editorSessionId is provided, it will show a list of active sessions and prompt for selection.

Parameters

editorSessionId (str, optional) – The ID of the editor session to be deleted. If not provided, will prompt for selection.

Returns

A dictionary representing the result of the session deletion.

Return type

dict

Notes

  • This function checks if the user is logged out before proceeding.

  • Calls ana_api.deleteRemoteDevelopment to perform the deletion.

  • Use arrow keys (↑/↓) to select a session, Enter to confirm, q to quit

deregister_ssh_key(self, name=None)

Removes a public SSH key for use with remote development sessions.

Parameters

name (str) – The name of the SSH key to deregister.

Returns

A boolean status of whether the operation was successful.

Return type

bool

get_editors(self, organizationId=None, workspaceId=None, serviceId=None, editorId=None, cursor=None, limit=None, filters=None, fields=None)

Returns a list of editors for a workspace or service.

Parameters
  • organizationId (str) – The ID of the organization to get editors for.

  • workspaceid (str) – The ID of the workspace to get editors for.

  • serviceid (str) – The ID of the service to get editors for.

  • editorId (str) – The ID of the editor to get.

Returns

A list of editors for the specified workspace or service.

Return type

list

get_ssh_keys(self)

Returns a list of SSH keys a user has registered with the platform.

Returns

A list of registered SSH keys.

Return type

list

invite_editor(self, editorId, email)

Invites a user to join an editor session.

Parameters
  • editorId (str) – The ID of the editor session to invite the user to.

  • email (str) – The email address of the user to invite.

Returns

If true, the user was successfully invited to the editor session.

Return type

bool

invite_remote_development(self, editorSessionId, email)

Invites a user to join a remote development session.

Parameters
  • editorSessionId (str) – The ID of the editor session to invite the user to.

  • email (str) – The email address of the user to invite.

Returns

A boolean status of whether the operation was successful.

Return type

bool

list_remote_development(self, organizationId=None)

Shows all the active development sessions in the organization.

Parameters

organizationId (str) – The ID of the organization to list the active development sessions.

Returns

If organizationId is not provided, returns all active sessions in organizations that user has access to. If organizationId is provided, returns active sessions in that specific organization.

Return type

list[dict]

prepare_ssh_remote_development(self, editorSessionId=None, forceUpdate=False)

Prepares a remote development session for SSH access.

This method prepares a specific editor session for SSH access, optionally within a given organization. If no editorSessionId is provided, it will show a list of active sessions and prompt for selection.

Parameters
  • editorSessionId (str, optional) – The ID of the editor session to prepare SSH for. If not provided, will prompt user to select.

  • forceUpdate (bool, optional) – If True, will remove existing SSH configuration before adding new one.

Returns

A dictionary representing the result of the session preparation.

Return type

dict

Notes

  • This function checks if the user is logged out before proceeding.

  • Use arrow keys (↑/↓) to select a session, Enter to confirm, q to quit

  • Only shows sessions that are currently running or resuming

register_ssh_key(self, filename=None)

Registers a public SSH key for use with remote development sessions.

Parameters

filename (str) – The filename of the .pub SSH key to register.

Returns

A boolean status of whether the operation was successful.

Return type

bool

remove_ssh_remote_development(self, editorSessionId=None)

Removes a remote development session from SSH access.

This method removes a specific editor session from SSH access, optionally within a given organization. If no editorSessionId is provided, it will show a list of active sessions and prompt for selection.

Parameters

editorSessionId (str, optional) – The ID of the editor session to be removed. If not provided, will prompt user to select.

Returns

A dictionary representing the result of the session removal.

Return type

dict

Notes

  • This function checks if the user is logged out before proceeding.

  • Use arrow keys (↑/↓) to select a session, Enter to confirm, q to quit

  • Only shows sessions that are currently running or resuming

start_editor(self, editorId)

Starts an editor session.

Parameters

editorId (str) – The ID of the editor session to start.

Returns

If true, the editor session was successfully started.

Return type

bool

start_remote_development(self, editorSessionId=None)

Starts a remote development session.

This method starts a specific editor session, optionally within a given organization. If no editorSessionId is provided, it will show a list of stopped sessions and prompt for selection.

Parameters

editorSessionId (str, optional) – The ID of the editor session to be started. If not provided, will prompt for selection.

Returns

A dictionary representing the result of the session start operation.

Return type

dict

Notes

  • This function checks if the user is logged out before proceeding.

  • Calls ana_api.startRemoteDevelopment to start the session.

  • Use arrow keys (↑/↓) to select a session, Enter to confirm, q to quit

  • Only shows sessions that are currently stopped

stop_editor(self, editorId)

Stops an editor session.

Parameters

editorId (str) – The ID of the editor session to stop.

Returns

If true, the editor session was successfully stopped.

Return type

bool

stop_remote_development(self, editorSessionId=None)

Stops a remote development session.

This method stops a specific editor session, optionally within a given organization. If no editorSessionId is provided, it will show a list of active sessions and prompt for selection.

Parameters

editorSessionId (str, optional) – The ID of the editor session to be stopped. If not provided, will prompt for selection.

Returns

A dictionary representing the result of the session stop operation.

Return type

dict

Notes

  • This function checks if the user is logged out before proceeding.

  • Calls ana_api.stopRemoteDevelopment to stop the session.

  • Use arrow keys (↑/↓) to select a session, Enter to confirm, q to quit

  • Only shows sessions that are currently running or resuming