anatools.anaclient.editor module

Editor Functions

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_remote_development(self, editorSessionId=None, organizationId=None)

Deletes a remote development session.

This method removes a specific editor session, optionally within a given organization. If no organizationId is provided, it defaults to the organization associated with the current user. 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.

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

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

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, organizationId=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 organizationId is provided, it defaults to the organization associated with the current user. 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.

  • organizationId (str, optional) – The organization ID to list sessions from. If not provided, uses default.

  • 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

remove_ssh_remote_development(self, editorSessionId=None, organizationId=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 organizationId is provided, it defaults to the organization associated with the current user. 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.

  • organizationId (str, optional) – The organization ID to list sessions from. If not provided, uses default.

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_remote_development(self, editorSessionId=None, organizationId=None)

Starts a remote development session.

This method starts a specific editor session, optionally within a given organization. If no organizationId is provided, it defaults to the organization associated with the current user. 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.

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

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_remote_development(self, editorSessionId=None, organizationId=None)

Stops a remote development session.

This method stops a specific editor session, optionally within a given organization. If no organizationId is provided, it defaults to the organization associated with the current user. 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.

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

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