mstrio.datasources package¶
Submodules¶
mstrio.datasources.database_connections module¶
- class mstrio.datasources.database_connections.DatabaseConnections(connection: Connection)¶
Bases:
object
Browse and manage database connections on the environment.
- connection¶
A MicroStrategy connection object
- disconnect_all_databases(force: bool = False) Optional[List[dict]] ¶
Disconnect all database connections.
- Parameters:
force – 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
- disconnect_database(connection_id: str, force: bool = False) bool ¶
Disconnect database connections by passing in connection_id.
- Parameters:
connection_id – Database Connection Instance Id
force – if True, no additional prompt will be shown before. Default False.
Returns – True for success. False otherwise.
- list_connections(nodes: Union[str, List[str]] = None, limit: Optional[int] = None, **filters) List[Dict[str, Any]] ¶
- Get all active database connections. Optionally filter the
connections by specifying the filters keyword arguments.
- Parameters:
nodes – Node (server) names on which databases will be disconnected.
limit – 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’]
mstrio.datasources.datasource_connection module¶
- class mstrio.datasources.datasource_connection.CharEncoding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- NON_UTF8 = 'multibyte'¶
- UTF8 = 'utf8'¶
- class mstrio.datasources.datasource_connection.DatasourceConnection(connection: Connection, name: Optional[str] = None, id: Optional[str] = None)¶
Bases:
Entity
,CopyMixin
,DeleteMixin
Datasource connection configuration object that represents a connection to the datasource.
- connection¶
A MicroStrategy connection object.
- id¶
Unique datasource connection ID.
- name¶
Unique datasource connection name.
- description¶
Datasource connection description.
- execution_mode¶
ExecutionMode Enum specifying how SQL statements will be executed on a physical database connection made.
- max_cancel_attempt_time¶
Number of seconds before being timed out when attempting to make a connection.
- max_query_exe_time¶
Number of seconds during which a query must be executed before being timed out.
- max_connection_attempt_time¶
Number of seconds connection attempts to be made before timing out.
- connection_lifetime¶
Number of seconds of the connection lifetime.
- connection_idle_timeout¶
Number of seconds before being timed out when the connection is idle.
- char_encoding_windows¶
CharEncoding Enum specifying the encoding across connection for Windows drivers.
- char_encoding_unix¶
CharEncoding Enum specifying the encoding across connection for Unix drivers.
- table_prefix¶
String prefixed to the names of all temporary tables created by the Query Engine for this connection during report execution with this string.
- connection_string¶
Database connection string.
- parameterized_queries¶
Specifies whether parameterized queries are enabled.
- extended_fetch¶
Specifies whether or not to use the extended fetch ODBC call to retrieve data from the database connection.
- datasource_login¶
DatasourceLogin object or ID
- database_type¶
Database type
- database_version¶
Database version
- driver_type¶
DriverType Enum specifying Driver used for database connection.
- oauth_parameter¶
Used for authentication with oAuth.
- type¶
Object type
- subtype¶
Object subtype
- date_created¶
Creation time, DateTime object
- date_modified¶
Last modification time, DateTime object
- owner¶
User object that is the owner
- acg¶
Object access rights. It a bit vector where bits are defined at [EnumDSSXMLAccessRightFlags].
- acl¶
Object access control list
- iam¶
List of projects to which the fence is applied.
- resource¶
The url of configured Web API for OAuth authentication usage.
- scope¶
List of delegated permissions that the app is requesting.
- enable_sso¶
Specifies whether to use Single Sign-On.
- alter(name: Optional[str] = None, description: Optional[str] = None, execution_mode: Union[str, ExecutionMode] = None, max_cancel_attempt_time: Optional[int] = None, max_query_exe_time: Optional[int] = None, max_connection_attempt_time: Optional[int] = None, connection_lifetime: Optional[int] = None, connection_idle_timeout: Optional[int] = None, char_encoding_windows: Union[str, CharEncoding] = None, char_encoding_unix: Union[str, CharEncoding] = None, table_prefix: Optional[str] = None, connection_string: Optional[str] = None, parameterized_queries: Optional[bool] = None, extended_fetch: Optional[bool] = None, driver_type: Union[str, DriverType] = None, database_type: Optional[str] = None, database_version: Optional[str] = None, datasource_login: Optional[Union[str, DatasourceLogin]] = None, iam: Optional[dict] = None, resource: Optional[str] = None, scope: Optional[str] = None, enable_sso: Optional[bool] = None) None ¶
Alter the datasource connection properties.
- Parameters:
name – Unique datasource connection name.
description – Datasource connection description.
execution_mode – ExecutionMode Enum specifying how SQL statements will be executed on a physical database connection made.
max_cancel_attempt_time – Number of seconds before being timed out when attempting to make a connection.
max_query_exe_time – Number of seconds during which a query must be executed before being timed out.
max_connection_attempt_time – Number of seconds connection attempts to be made before timing out.
connection_lifetime – Number of seconds of the connection lifetime.
connection_idle_timeout – Number of seconds before being timed out when the connection is idle.
char_encoding_windows – CharEncoding Enum specifying the encoding across connection for Windows drivers.
char_encoding_unix – CharEncoding Enum specifying the encoding across connection for Unix drivers.
table_prefix – String prefixed to the names of all temporary tables created by the Query Engine for this connection during report execution with this string.
connection_string – Database connection string.
parameterized_queries – Specifies whether parameterized queries are enabled.
extended_fetch – Specifies whether or not to use the extended fetch ODBC call to retrieve data from the database connection.
driver_type – DriverType Enum specifying Driver used for database connection.
datasource_login – DatasourceLogin object or ID
driver_type – ENUM Drivers used for database connection.
database_type – Database type
database_version – Database version
iam – List of projects to which the fence is applied.
resource – The url of configured Web API for OAuth authentication usage.
scope – List of delegated permissions that the app is requesting.
enable_sso – Specifies whether to use Single Sign-On.
- convert_to_dsn_less()¶
Convert datasource connection from DSN to DSN-less format and update the object to metadata.
- classmethod create(connection: Connection, name: str, description: Optional[str] = None, acg: Optional[int] = None, execution_mode: Union[str, ExecutionMode] = None, max_cancel_attempt_time: Optional[int] = None, max_query_exe_time: Optional[int] = None, max_connection_attempt_time: Optional[int] = None, connection_lifetime: Optional[int] = None, connection_idle_timeout: Optional[int] = None, char_encoding_windows: Union[str, CharEncoding] = None, char_encoding_unix: Union[str, CharEncoding] = None, table_prefix: Optional[str] = None, connection_string: Optional[str] = None, parameterized_queries: bool = False, extended_fetch: bool = False, datasource_login: Optional[Union[DatasourceLogin, str]] = None, database_type: Optional[str] = None, database_version: Optional[str] = None, driver_type: Union[str, DriverType] = None, oauth_parameter: Optional[str] = None, iam: Optional[dict] = None, resource: Optional[str] = None, scope: Optional[str] = None, enable_sso: bool = False) DatasourceConnection ¶
Create a new datasource connection on the I-Server.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection().
name – Unique datasource connection name.
description – Datasource connection description.
acg – Object access rights. It’s a bit vector where bits are defined at [EnumDSSXMLAccessRightFlags].
execution_mode – ExecutionMode Enum specifying how SQL statements will be executed on a physical database connection made.
max_cancel_attempt_time – Number of seconds before being timed out when attempting to make a connection.
max_query_exe_time – Number of seconds during which a query must be executed before being timed out.
max_connection_attempt_time – Number of seconds connection attempts to be made before timing out.
connection_lifetime – Number of seconds of the connection lifetime.
connection_idle_timeout – Number of seconds before being timed out when the connection is idle.
char_encoding_windows – CharEncoding Enum specifying the encoding across connection for Windows drivers.
char_encoding_unix – CharEncoding Enum specifying the encoding across connection for Unix drivers.
table_prefix – String prefixed to the names of all temporary tables created by the Query Engine for this connection during report execution with this string.
connection_string – Database connection string.
parameterized_queries – Specifies whether parameterized queries are enabled.
extended_fetch – Specifies whether or not to use the extended fetch ODBC call to retrieve data from the database connection.
driver_type – DriverType Enum specifying Driver used for database connection.
oauth_parameter – Used for authentication with oAuth.
datasource_login – DatasourceLogin object or ID
database_type – Database type
database_version – Database version
iam – List of projects to which the fence is applied.
resource – The url of configured Web API for OAuth authentication usage.
scope – List of delegated permissions that the app is requesting.
enable_sso – Specifies whether to use Single Sign-On.
- Returns:
DatasourceConnection object.
- test_connection() bool ¶
Test datasource connection object.
- Returns:
True if connection can be established, else False.
- class mstrio.datasources.datasource_connection.DriverType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- NATIVE = 'native'¶
- ODBC = 'odbc'¶
- RESERVED = 'reserved'¶
- class mstrio.datasources.datasource_connection.ExecutionMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- ASYNC_CONNECTION = 'async_connection'¶
- ASYNC_STATEMENT = 'async_statement'¶
- RESERVED = 'reserved'¶
- SYNCHRONOUS = 'synchronous'¶
- mstrio.datasources.datasource_connection.list_datasource_connections(connection: Connection, to_dictionary: bool = False, limit: Optional[int] = None, **filters) Union[List[DatasourceConnection], List[dict]] ¶
Get list of DatasourceConnection objects or dicts. Optionally filter the connections by specifying filters.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
to_dictionary – If True returns dict, by default (False) returns User objects.
limit – limit the number of elements returned. If None (default), all objects are returned.
**filters – Available filter parameters: [‘id’, ‘name’, ‘description’, ‘acg’]
Examples
>>> list_datasource_connections(connection, name='db_conn_name')
mstrio.datasources.datasource_instance module¶
- class mstrio.datasources.datasource_instance.DatasourceInstance(connection: Connection, name: Optional[str] = None, id: Optional[str] = None)¶
Bases:
Entity
,CopyMixin
,DeleteMixin
Object representation of MicroStrategy DataSource Instance object.
- connection¶
A MicroStrategy connection object
- id¶
Datasource Instance ID
- name¶
Datasource Instance name
- description¶
Datasource Instance description
- dbms¶
The database management system (DBMS) object
- database¶
Database object
- datasource_type¶
DatasourceType Enum (reserved, normal, data_import, data_import_primary)
- table_prefix¶
Table prefix
- odbc_version¶
Odbc version ENUM
- intermediate_store_db_name¶
Intermediate store DBName
- intermediate_store_table_space_name¶
intermediate store table space name
- type¶
Object type
- subtype¶
Object subtype
- date_created¶
Creation time, DateTime object
- date_modified¶
Last modification time, DateTime object
- owner¶
User object that is the owner
- acg¶
Access rights (See EnumDSSXMLAccessRightFlags for possible values)
- acl¶
Object access control list
- alter(name: Optional[str] = None, description: Optional[str] = None, datasource_type: Optional[Union[str, DatasourceType]] = None, table_prefix: Optional[str] = None, odbc_version: Optional[str] = None, intermediate_store_db_name: Optional[str] = None, intermediate_store_table_space_name: Optional[str] = None, dbms: Optional[Union[str, Dbms]] = None, datasource_connection: Optional[Union[str, DatasourceConnection]] = None, primary_datasource: Optional[Union[DatasourceInstance, str]] = None, data_mart_datasource: Optional[Union[DatasourceInstance, str]] = None) None ¶
Alter DatasourceInstance properties.
- Parameters:
name – Datasource name
description – Datasource description
datasource_type – DatasourceType Enum (reserved, normal, data_import, data_import_primary)
table_prefix – Table prefix
odbc_version – Odbc version ENUM (version3x, version2x)
intermediate_store_db_name – Intermediate store DBName
intermediate_store_table_space_name – intermediate store table space name
dbms – The database management system (DBMS) object or ID
datasource_connection – DatasourceConnection object or ID
primary_datasource – DatasourceInstance object or ID
data_mart_datasource – DatasourceInstance object or ID
- convert_ds_connection_to_dsn_less()¶
Convert datasource embedded connection from DSN to DSN-less format connection string and update the object to metadata.
- classmethod create(connection: Connection, name: str, dbms: mstrio.datasources.dbms.Dbms | str, description: Optional[str] = None, datasource_type: Optional[Union[str, DatasourceType]] = None, table_prefix: Optional[str] = None, odbc_version: Optional[str] = None, intermediate_store_db_name: Optional[str] = None, intermediate_store_table_space_name: Optional[str] = None, datasource_connection: Optional[Union[str, DatasourceConnection]] = None, database_type: str = None, database_version: str = None, primary_datasource: Optional[str | DatasourceInstance] = None, data_mart_datasource: Optional[str | DatasourceInstance] = None) Optional[DatasourceInstance] ¶
Create a new DatasourceInstance object on I-Server.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection().
name – Datasource name
dbms – The database management system (DBMS) object or id
description – Datasource description
datasource_type – DatasourceType Enum (reserved, normal, data_import, data_import_primary)
table_prefix – Table prefix
odbc_version – Odbc version ENUM (version3x, version2x)
intermediate_store_db_name – Intermediate store DBName
intermediate_store_table_space_name – intermediate store table space name
datasource_connection – DatasourceConnection object or ID
database_type – Database type
database_version – Database version
primary_datasource – DatasourceInstance object or ID
data_mart_datasource – DatasourceInstance object or ID
- Returns:
DatasourceInstance object.
- class mstrio.datasources.datasource_instance.DatasourceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- DATA_IMPORT = 'data_import'¶
- DATA_IMPORT_PRIMARY = 'data_import_primary'¶
- NORMAL = 'normal'¶
- RESERVED = 'reserved'¶
- mstrio.datasources.datasource_instance.list_connected_datasource_instances(connection: Connection, to_dictionary: bool = False) list['DatasourceInstance'] | list[dict] ¶
List all datasource instances for which there is an associated Database Login and are connected to a project mapped to a Connection object.
- Parameters:
connection (Connection) – MicroStrategy connection object returned by connection.Connection()
to_dictionary (bool, optional) – If True returns a list of dictionaries representing datasource instances
- Returns:
- A list of connected
datasource instances.
- Return type:
Union[list[“DatasourceInstance”], list[dict]]
- mstrio.datasources.datasource_instance.list_datasource_instances(connection: Connection, to_dictionary: bool = False, limit: Optional[int] = None, ids: Optional[list[str]] = None, database_types: Optional[list[str]] = None, project: Optional[Union[Project, str]] = None, **filters) list['DatasourceInstance'] | list[dict] ¶
Get list of DatasourceInstance objects or dicts. Optionally filter the datasource instances by specifying filters.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
to_dictionary – If True returns dict, by default (False) returns User objects.
limit – limit the number of elements returned. If None (default), all objects are returned.
ids – list of datasources ids as strings. By default None.
database_types – list of strings representing database types. By default None. Available values: [‘reserved’, ‘access’, ‘altibase’, ‘amazon_athena’, ‘amazon_aurora’, ‘amazon_redshift’, ‘arcadia_platform’, ‘aster’, ‘big_data_engine’, ‘cassandra’, ‘cirro’, ‘cloud_element’, ‘cloud_gateway’, ‘cloud_gateway_aws_s3’, ‘cloud_gateway_azure_adls_2’, ‘cloud_gateway_google_cloud_storage’, ‘composite’, ‘concur’, ‘connection_cloud’, ‘data_direct_cloud’, ‘datallegro’, ‘db2’, ‘denodo’, ‘drill’, ‘dropbox’, ‘eloqua’, ‘enterprise_db’, ‘ess_base’, ‘exa_solution’, ‘excel’, ‘facebook’, ‘gbase_8a’, ‘generic’, ‘generic_data_connector’, ‘google_analytics’, ‘google_big_query’, ‘google_big_query_ff_sql’, ‘google_drive’, ‘hive’, ‘hive_thrift’, ‘hubspot’, ‘impala’, ‘informatica’, ‘informix’, ‘kognitiowx2’, ‘kyvos_mdx’, ‘mapd’, ‘marketo’, ‘mark_logic’, ‘mem_sql’, ‘metamatrix’, ‘microsoft_as’, ‘mongo_db’, ‘my_sql’, ‘neoview’, ‘netezza’, ‘open_access’, ‘oracle’, ‘par_accel’, ‘par_stream’, ‘paypal’, ‘phoenix’, ‘pig’, ‘pivotal_hawq’, ‘postgre_sql’, ‘presto’, ‘red_brick’, ‘salesforce’, ‘sand’, ‘sap’, ‘sap_hana’, ‘sap_hana_mdx’, ‘search_engine’, ‘servicenow’, ‘shopify’, ‘snow_flake’, ‘spark_config’, ‘spark_sql’, ‘splunk’, ‘sql_server’, ‘square’, ‘sybase’, ‘sybase_iq’, ‘sybase_sql_any’, ‘tandem’, ‘teradata’, ‘tm1’, ‘twitter’, ‘unknown’, ‘url_auth’, ‘vectorwise’, ‘vertica’, ‘xquery’]
project – id (str) of a project or instance of an Project class to search for the datasource instances in. When provided, both ids and database_types are ignored. By default None.
**filters – Available filter parameters: [‘id’, ‘name’, ‘description’, ‘date_created’, ‘date_modified’, ‘datasource_type’, table_prefix, ‘odbc_version’, ‘intermediate_store_db_name’, ‘intermediate_store_table_space_name’, ‘dbms’, ‘owner’, ‘acg’]
Examples
>>> list_datasource_instances(connection, name='ds_instance_name')
mstrio.datasources.datasource_login module¶
- class mstrio.datasources.datasource_login.DatasourceLogin(connection: Connection, name: str = None, id: str = None)¶
Bases:
Entity
,CopyMixin
,DeleteMixin
A user login configuration object to access a particular datasource. Also formerly known as database login.
- name¶
name of the database login
- id¶
database login ID
- description¶
Description of the database login
- username¶
database user to be used by the database login
- version¶
Object version ID
- ancestors¶
List of ancestor folders
- type¶
Object type. Enum
- subtype¶
Object subtype
- ext_type¶
Object extended type.
- date_created¶
Creation time, DateTime object
- date_modified¶
Last modification time, DateTime object
- owner¶
User object that is the owner
- acg¶
Access rights (See EnumDSSXMLAccessRightFlags for possible values)
- acl¶
Object access control list
- alter(name: str = None, username: str = None, description: str = None, password: str = None) None ¶
Alter the datasource login properties.
- Parameters:
name – login object name
username – username
description – login object description
password – database password to be used by the database login
- classmethod create(connection: Connection, name: str, username: str, password: str, description: str = None) DatasourceLogin ¶
Create a new datasource login.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
name – login object name
username – username
description – login object description
password – database password to be used by the database login
- Returns:
DatasourceConnection object.
- mstrio.datasources.datasource_login.list_datasource_logins(connection: Connection, to_dictionary: bool = False, limit: int = None, **filters) Union[List[DatasourceLogin], List[dict]] ¶
Get list of DatasourceLogin objects or dicts. Optionally filter the logins by specifying filters.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
to_dictionary – If True returns dict, by default (False) returns User objects.
limit – limit the number of elements returned. If None (default), all objects are returned.
**filters – Available filter parameters: [‘id’, ‘name’, ‘description’, ‘date_created’, ‘date_modified’, ‘acg’]
Examples
>>> list_db_logins(connection, name='db_login_name')
mstrio.datasources.datasource_map module¶
- class mstrio.datasources.datasource_map.DatasourceMap(connection: Connection, id: Optional[str] = None, project: Optional[Union[Project, str]] = None, default_connection_map: bool = False, ds_connection: Optional[DatasourceConnection] = None, datasource: Optional[DatasourceInstance] = None, user: Optional[Union[User, UserGroup]] = None, login: Optional[DatasourceLogin] = None, locale: Optional[Locale] = None)¶
Bases:
EntityBase
,DeleteMixin
Object representation of MicroStrategy Connection Mapping
The connection mapping provides mapping between a user or a user group and a datasource login for the given datasource and datasource connection.
- connection¶
A MicroStrategy connection object
- id¶
ID of connection mapping.
- project¶
The project the mapping is assigned to.
- default_connection_map¶
Whether the mapping is the default for the project.
- ds_connection¶
The mapped Datasource Connection
- datasource¶
The mapped Datasource Instance
- user¶
The mapped User or UserGroup
- login¶
The mapped Datasource Login
- locale¶
The mapping’s locale. When empty, it’s equivalent to ‘default’ in Workstation and means that default locale for the environment will be used.
- alter(user: Optional[Union[User, UserGroup, str]] = None, ds_connection: Optional[Union[str, DatasourceConnection]] = None, datasource: Optional[Union[DatasourceInstance, str]] = None, login: Optional[Union[DatasourceLogin, str]] = None, locale: Optional[Union[Locale, str]] = None)¶
Replace the connection mapping with a newly created one with field values copied unless new ones are specified.
- Parameters:
connection – A MicroStrategy connection object
user – The User or UserGroup to be mapped
ds_connection – The Datasource Connection to be mapped
datasource – The Datasource Instance to be mapped
login – The Datasource Login to be mapped
locale – The locale to be mapped
- Returns:
DatasourceMap object
- classmethod create(connection: Connection, project: mstrio.server.project.Project | str, user: mstrio.users_and_groups.user.User | mstrio.users_and_groups.user_group.UserGroup | str, ds_connection: mstrio.datasources.datasource_connection.DatasourceConnection | str, datasource: mstrio.datasources.datasource_instance.DatasourceInstance | str, login: mstrio.datasources.datasource_login.DatasourceLogin | str, locale: Optional[Union[Locale, str]] = None, locale_id: Optional[str] = None, locale_name: Optional[str] = None) DatasourceMap ¶
Create a new connection mapping on the server. If more than one locale related parameters are provided, locale has priority, then locale_id.
- Parameters:
connection – A MicroStrategy connection object
project – The project the mapping is to be assigned to
user – The User or UserGroup to be mapped
ds_connection – The Datasource Connection to be mapped
datasource – The Datasource Instance to be mapped
login – The Datasource Login to be mapped
locale – The locale to be mapped.
locale_id – The id of locale to be mapped.
locale_name – The name of locale to be mapped.
- Returns:
DatasourceMap object
- classmethod from_dict(source: dict[str, Any], connection: Connection, to_snake_case: bool = True) DatasourceMap ¶
- Overrides Dictable.from_dict() to instantiate an object from
a dictionary without calling any additional getters.
- Parameters:
cls (T) – Class (type) of an object that should be created.
source (Dict[str, Any]) – a dictionary from which an object will be constructed.
connection (Connection) – A MicroStrategy Connection object.
to_snake_case (bool, optional) – Set to True if attribute names
True. (should be converted from camel case to snake case. Defaults to) –
- Returns:
An object of type T.
- Return type:
T
- to_dict(camel_case=True)¶
Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.
- Parameters:
camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
- class mstrio.datasources.datasource_map.Locale(connection: Connection, id: Optional[str] = None, name: Optional[str] = None, abbreviation: Optional[str] = None)¶
Bases:
Entity
Object representation of Microstrategy Locale
- connection¶
A MicroStrategy connection object
- id¶
Object ID
- name¶
Object name
- description¶
Object description
- abbreviation¶
Object abbreviation
- type¶
Object type
- subtype¶
Object subtype
- ext_type¶
Object extended type
- date_created¶
Creation time, DateTime object
- date_modified¶
Last modification time, DateTime object
- version¶
Version ID
- owner¶
Owner ID and name
- icon_path¶
Object icon path
- view_media¶
View media settings
- ancestors¶
List of ancestor folders
- certified_info¶
Certification status, time of certification, and information about the certifier (currently only for document and report)
- acg¶
Access rights (See EnumDSSXMLAccessRightFlags for possible values)
- acl¶
Object access control list
- to_dict(camel_case: bool = True) dict ¶
Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.
- Parameters:
camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
- mstrio.datasources.datasource_map.list_datasource_mappings(connection: Connection, project: Optional[Union[Project, str]] = None, to_dictionary: bool = False, limit: Optional[int] = None, user: Optional[Union[User, UserGroup, str]] = None, ds_connection: Optional[Union[str, DatasourceConnection]] = None, datasource: Optional[Union[DatasourceInstance, str]] = None, login: Optional[Union[DatasourceLogin, str]] = None, locale: Optional[Union[Locale, str]] = None, default_connection_map: bool = False) list[mstrio.datasources.datasource_map.DatasourceMap] | list[dict] ¶
Get list of connection mappings: objects or dicts. Optionally filter by specifying filters.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
default_connection_map – True if requesting default connection mappings. Default False
project – The project (or its id) which mappings are to be fetched. Optional unless requesting the default mappings.
to_dictionary – If True returns dict, by default (False) returns DatasourceMap objects.
limit – limit the number of elements returned. If None (default), all objects are returned.
locale – filter list by locale
login – filter list by datasource login
datasource – filter list by datasource instance
ds_connection – filter list by datasource connection
user – filter list by user or user group
- Returns:
list[‘DatasourceMap’] by default list[dict] if to_dictionary is True
Examples
>>> list_datasource_mappings(connection)
- mstrio.datasources.datasource_map.list_locales(connection: Connection, to_dictionary: bool = False) list[mstrio.datasources.datasource_map.Locale] | list[dict] ¶
Get list of locales as objects or dicts.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
to_dictionary – If True returns dict, by default (False) returns Locale objects.
- Returns:
list[‘Locale’] by default list[dict] if to_dictionary is True
Examples
>>> list_locales(connection)
mstrio.datasources.dbms module¶
- class mstrio.datasources.dbms.Dbms(connection: Connection, name: str = None, id: str = None, type: str = None, version: str = None)¶
Bases:
EntityBase
Object representation of MicroStrategy Database management system (DBMS)
- name¶
Database management system (DBMS) name.
- id¶
Database management system (DBMS) ID.
- type¶
Database management system (DBMS) type.
- version¶
Database management system (DBMS) version.
- mstrio.datasources.dbms.list_available_dbms(connection: Connection, to_dictionary: bool = False, limit: int = None, **filters) Union[List[Dbms], List[dict]] ¶
List all available database management systems (DBMSs) objects or dicts. Optionally filter the DBMS by specifying filters.
- Parameters:
connection – MicroStrategy connection object returned by connection.Connection()
to_dictionary – If True returns dict, by default (False) returns User objects.
limit – limit the number of elements returned. If None (default), all objects are returned.
**filters – Available filter parameters: [‘id’, ‘name’, ‘type’, ‘version’]
Examples
>>> list_available_dbms(connection)