Skip to main content

Application reference

The Application class is designed to optimize the management of Edge applications and their associated entities. This class embodies the API for executing CRUD operations on applications, versions, servers, and resources within Edge.

# List available applications
[1]: edge.applications.list_application_ids()
['My Analysis App', 'My Data App']

# Retrieve an application definition
[2]: edge.applications.get_application('My Analysis App')
<edge.Application>

Constructor

Constructing these yourself is not recommended. You should make an EdgeSession and access the .applications property, which will return an Application object.


Methods

list_application_ids

list_application_ids(include_builtin=None) -> list(str)

List the app_ids of applications in this organization.

Parameters

  • include_builtin (bool)
    Optional; If set to True, include the app_ids for builtin apps. Default is None.

Returns

list(str) Application IDs.


get_application

get_application(app_id) -> Application

Retrieve a stored application object, given its ID.

Parameters

  • app_id (str)
    ID of the application to retrieve.

Returns

Application The object corresponding to the retrieved application.

Raises

  • NotFound: No object of the given app_id exists.

add_application

add_application(application) -> Application

Creates an application.

Parameters

  • application (edge.apps.application.Application)
    Application object to store.

Returns

edge.apps.application.Application The object corresponding to the added application.

Raises

  • AlreadyExists: Raised if an application with the given ID already exists.
  • BadEntry: Raised if the application definition is invalid.

update_application

update_application(application) -> Application

Changes an application.

Parameters

  • application (edge.apps.application.Application)
    Application object to update.

Returns

edge.apps.application.Application The object corresponding to the updated application.

Raises

  • NotFound: Raised if the application doesn't alredy exist.
  • BadEntry: Raised if the application definition is invalid.

remove_application

remove_application(app_id)

Delete a given application.

Parameters

  • app_id (str)
    ID of the application to remove.

get_approval_status

get_approval_status(app_id) -> ApprovalStatus

Gets the approval status for an application.

Parameters

  • app_id (str)
    The app ID to get approval status.

Returns

ApprovalStatus An ApprovalStatus value or None if it has not been set.

Raises

  • AttributeError: Raised if the approval status is not recognized.

set_approval_status

set_approval_status(app_id, status)

Sets the approval status for an application. This requires organization administrator status.

Parameters

  • app_id (str)
    The app ID to set approval status.
  • status (ApprovalStatus)
    An approval status.

list_server_domains

list_server_domains(app_id) -> list(str)

List server domains for an application.

Parameters

  • app_id (str)
    The application ID we are listing servers for.

Returns

list(str) Application server domains.


get_server_info

get_server_info(app_id, server_domain) -> ServerInfo

Retrieve a stored server information object.

Parameters

  • app_id (str)
    ID of the application.
  • server_domain (str)
    Domain we are retrieving.

Returns

edge.apps.app_server.ServerInfo The object corresponding to the retrieved application server.

Raises

  • NotFound: Raised if the application or server is not found.

add_server_info

add_server_info(server_info) -> ServerInfo

Adds an application server.

Parameters

  • server_info (edge.apps.app_server.ServerInfo)
    Application server object to create.

Returns

edge.apps.app_server.ServerInfo The object corresponding to the added application server.

Raises

  • AlreadyExists: Raised if a server with the given domain already exists in the app.
  • BadEntry: Raised if the server definition is invalid.

update_server_info

update_server_info(server_info) -> ServerInfo

Changes an application server.

Parameters

  • server_info (edge.apps.app_server.ServerInfo)
    Application server object to update.

Returns

edge.apps.app_server.ServerInfo The object corresponding to the updated application server.

Raises

  • NotFound: Raised if the application or server is not found.
  • BadEntry: Raised if the server definition is invalid.

remove_server_info

remove_server_info(app_id, server_domain)

Delete a given application server.

Parameters

  • app_id (str)
    ID of the application.
  • server_domain (str)
    Server we are removing.

get_timeout

get_timeout(app_id=None) -> list(ApplicationTimeout)

Gets the idle timeout for an application (of specified) or all apps.

Parameters

  • app_id (str)
    Optional; If specified, app ID to get timeout for.

Returns

list(edge.apps.app_timeout.ApplicationTimeout) A list of application timeouts.

Raises

  • NotFound: Raised if the organization or application is not found.

set_timeout

set_timeout(app_id, idle_minutes)

Sets the idle timeout for an application. This requires organization administrator status.

Parameters

  • app_id (str)
    The app ID to set approval status.
  • idle_minutes (int)
    The idle time in minutes before an application is terminated. Must be >0.

reset_timeout

reset_timeout(app_id, idle_minutes)

Removes the custom timeout for an application, reverting to the default timeout. This requires organization administrator status.

Parameters

  • app_id (str)
    The app ID to set approval status.

list_app_versions

list_app_versions(app_id) -> list(str)

List the versions for an application.

Parameters

  • app_id (str)
    The application ID we are listing versions for.

Returns

list(str) Application version IDs.


get_app_version

get_app_version(app_id, version_id) -> AppVersion

Retrieve a stored application version object, given its id.

Parameters

  • app_id (str)
    ID of the application.
  • version_id (str)
    Version we are retrieving.

Returns

edge.apps.app_version.AppVersion The object corresponding to the retrieved application version.

Raises

  • NotFound: Raised if the application or version is not found.

add_app_version

add_app_version(version) -> AppVersion

Adds an application version.

Parameters

  • version (edge.apps.app_version.AppVersion)
    Application version object to create.

Returns

edge.apps.app_version.AppVersion The object corresponding to the added application version.

Raises

  • AlreadyExists: Raised if a version with the given ID already exists.
  • BadEntry: Raised if the version definition is invalid.
  • Forbidden: Raised if the version kind is "analysis" or "data".

update_app_version

update_app_version(version) -> AppVersion

Changes an application version.

Parameters

  • version (edge.apps.app_version.AppVersion)
    Application version object to update.

Returns

edge.apps.app_version.AppVersion The object corresponding to the updated application version.

Raises

  • NotFound: Raised if the application or version is not found.
  • BadEntry: Raised if the version definition is invalid.
  • Forbidden: Raised if trying to modify the kind of an "analysis" or "data". app version

remove_app_version

remove_app_version(app_id, version_id)

Delete a given application version.

Parameters

  • app_id (str)
    ID of the application.
  • version_id (str)
    Version we are removing.