mstrio > datasources > database_connections

class mstrio.datasources.database_connections.DatabaseConnections(connection)

Bases: object

Browse and manage database connections on the environment.

Parameters:

connection (Connection) –

connection

A Strategy One connection object

disconnect_all_databases(force=False)

Disconnect all database connections.

Parameters:

force (bool) – if True, no additional prompt will be shown before disconnecting all connections

Returns:

  • list of statuses of disconnecting all connections with their ids

    and messages from the I-Server

  • in case of error it returns None

Return type:

list[dict] | None

disconnect_database(connection_id, force=False)

Disconnect database connections by passing in connection_id.

Parameters:
  • connection_id (str) – Database Connection Instance Id

  • force (bool) – if True, no additional prompt will be shown before. Default False.

  • Returns – True for success. False otherwise.

Return type:

bool

list_connections(nodes=None, limit=None, **filters)
Get all active database connections. Optionally filter the

connections by specifying the filters keyword arguments.

Parameters:
  • nodes (str | list[str]) – Node (server) names on which databases will be disconnected.

  • limit (int | None) – limit the number of elements returned. If None, all objects are returned.

  • **filters – Available filter parameters: [‘status’, ‘database_instance_name’, ‘database_instance_id’, ‘user_name’, ‘database_login_name’, ‘cluster_node’, ‘id’, ‘name’, ‘type’]

Return type:

list[dict[str, Any]]