mstrio > datasources > datasource_instance

class mstrio.datasources.datasource_instance.DatasourceInstance(connection, name=None, id=None)

Bases: Entity, CopyMixin, DeleteMixin, ModelVldbMixin

Object representation of Strategy One DataSource Instance object.

Parameters:
  • connection (Connection) –

  • name (str | None) –

  • id (str | None) –

connection

A Strategy One 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

acl_add(rights, trustees, denied=False, inheritable=None, propagate_to_children=None, propagation_behavior=None)

Add Access Control Element (ACE) to the object ACL.

Note

To add rights for the Root Folder and the Freeform Objects, apply the required rights for these folders:

  • Root Folder: D43364C684E34A5F9B2F9AD7108F7828

  • Freeform Objects: 93D8CF3849C1F85DC1A48E8B9E4271F1

Argument propagate_to_children is used only for objects with type ObjectTypes.FOLDER.

Parameters:
  • rights (int | Rights | AggregatedRights) – The degree to which the user or group is granted or denied access to the object. The available permissions are defined in Rights and AggregatedRights Enums

  • trustees (list[UserOrGroup] | UserOrGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE for

  • denied (bool) – flag to indicate granted or denied access to the object

  • inheritable (bool | None) – Applies only to folders. If set, any objects placed in the folder inherit the folder’s entry in the ACL.

  • propagate_to_children (bool | None) – used for folder objects only, default value is None, if set to True/False adds propagateACLToChildren keyword to the request body and sets its value accordingly

  • propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.

  • self (Entity) –

Return type:

None

Examples

>>> obj.acl_add(rights=Rights.BROWSE | Rights.EXECUTE,
>>>             trustees=user_obj, denied=True)
acl_alter(rights, trustees, denied=False, inheritable=None, propagate_to_children=None, propagation_behavior=None)

Alter an existing Access Control Element (ACE) of the object ACL.

Note

To alter rights for the Root Folder and the Freeform Objects, change the required rights for these folders:

  • Root Folder: D43364C684E34A5F9B2F9AD7108F7828

  • Freeform Objects: 93D8CF3849C1F85DC1A48E8B9E4271F1

Argument propagate_to_children is used only for objects with type ObjectTypes.FOLDER.

Parameters:
  • rights (int | Rights | AggregatedRights) – The degree to which the user or group is granted or denied access to the object. The available permissions are defined in Rights and AggregatedRights Enums

  • trustees (list[UserOrGroup] | UserOrGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE for

  • denied (bool) – flag to indicate granted or denied access to the object

  • inheritable (bool | None) – Applies only to folders. If set, any objects placed in the folder inherit the folder’s entry in the ACL.

  • propagate_to_children (bool | None) – used for folder objects only, default value is None, if set to True/False adds propagateACLToChildren keyword to the request body and sets its value accordingly

  • propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.

  • self (Entity) –

Return type:

None

Examples

>>> obj.acl_alter(rights=Rights.BROWSE | Rights.EXECUTE,
>>>               trustees=user_obj, denied=True)
acl_remove(rights, trustees, denied=False, inheritable=None, propagate_to_children=None, propagation_behavior=None)

Remove Access Control Element (ACE) from the object ACL.

Note

To remove rights from the Root Folder and the Freeform Objects, remove them from these folders:

  • Root Folder: D43364C684E34A5F9B2F9AD7108F7828

  • Freeform Objects: 93D8CF3849C1F85DC1A48E8B9E4271F1

Argument propagate_to_children is used only for objects with type ObjectTypes.FOLDER.

Parameters:
  • rights (int | Rights | AggregatedRights) – The degree to which the user or group is granted or denied access to the object. The available permissions are defined in Rights and AggregatedRights Enums

  • trustees (list[UserOrGroup] | UserOrGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE for

  • denied (bool) – flag to indicate granted or denied access to the object

  • inheritable (bool | None) – Applies only to folders. If set, any objects placed in the folder inherit the folder’s entry in the ACL.

  • propagate_to_children (bool | None) – used for folder objects only, default value is None, if set to True/False adds propagateACLToChildren keyword to the request body and sets its value accordingly

  • propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.

  • self (Entity) –

Return type:

None

Examples

>>> obj.acl_remove(rights=Rights.BROWSE | Rights.EXECUTE,
>>>                trustees=user_obj, denied=True)
add_translation(translations)

Adds translations to the Object.

Parameters:
  • translations (list[OperationData]) – list of translations to be added to the Object

  • self (Entity) –

Returns:

A list of translations for the Object.

Return type:

list[’Translation’]

alter(name=None, description=None, datasource_type=None, table_prefix=None, odbc_version=None, intermediate_store_db_name=None, intermediate_store_table_space_name=None, dbms=None, datasource_connection=None, primary_datasource=None, data_mart_datasource=None, owner=None)

Alter DatasourceInstance properties.

Parameters:
  • name (str | None) – Datasource name

  • description (str | None) – Datasource description

  • datasource_type (str | DatasourceType | None) – DatasourceType Enum (reserved, normal, data_import, data_import_primary)

  • table_prefix (str | None) – Table prefix

  • odbc_version (str | None) – Odbc version ENUM (version3x, version2x)

  • intermediate_store_db_name (str | None) – Intermediate store DBName

  • intermediate_store_table_space_name (str | None) – intermediate store table space name

  • dbms (str | Dbms | None) – The database management system (DBMS) object or ID

  • datasource_connection (str | DatasourceConnection | None) – DatasourceConnection object or ID

  • primary_datasource (str | DatasourceInstance | None) – DatasourceInstance object or ID

  • data_mart_datasource (str | DatasourceInstance | None) – DatasourceInstance object or ID

  • owner (str | User | None) – User object or ID

Return type:

None

alter_translation(translations)

Alters translations of the Object.

Parameters:
  • translations (list[OperationData]) – list of translations to be added to the Object

  • self (Entity) –

Return type:

None

alter_vldb_settings(names_to_values)

Alter VLDB settings according to given name to value pairs.

Note

Only common value type conversion will be done by default, such as int->float, bool->int, int->bool and only if that is possible according to interval of allowed values, error will be thrown in other cases.

Parameters:

names_to_values (dict[str, str | int | float | bool]) – Dict with VlDB settings names as keys and newly requested to set values as dictionary values. As VLDB Setting name you can provide both: key or display name.

Raises:
  • ValueError – If there are no VldbSetting objects for some provided names or names and values are not provided or some of provided values will not be possible to set.

  • TypeError – If some of provided values to set have wrong type, different from type of default VLDB setting value.

Returns:

None

Return type:

None

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

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, name, dbms, description=None, datasource_type=None, table_prefix=None, odbc_version=None, intermediate_store_db_name=None, intermediate_store_table_space_name=None, datasource_connection=None, database_type=None, database_version=None, primary_datasource=None, data_mart_datasource=None)

Create a new DatasourceInstance object on I-Server.

Parameters:
  • connection (Connection) – Strategy One connection object returned by connection.Connection().

  • name (str) – Datasource name

  • dbms (Dbms | str) – The database management system (DBMS) object or id

  • description (str | None) – Datasource description

  • datasource_type (str | DatasourceType | None) – DatasourceType Enum (reserved, normal, data_import, data_import_primary)

  • table_prefix (str | None) – Table prefix

  • odbc_version (str | None) – Odbc version ENUM (version3x, version2x)

  • intermediate_store_db_name (str | None) – Intermediate store DBName

  • intermediate_store_table_space_name (str | None) – intermediate store table space name

  • datasource_connection (str | DatasourceConnection | None) – DatasourceConnection object or ID

  • database_type (str) – Database type

  • database_version (str) – Database version

  • primary_datasource (str | DatasourceInstance | None) – DatasourceInstance object or ID

  • data_mart_datasource (str | DatasourceInstance | None) – DatasourceInstance object or ID

Returns:

DatasourceInstance object.

Return type:

DatasourceInstance | None

create_copy(name=None, folder_id=None, project=None)

Create a copy of the object on the I-Server.

Parameters:
  • name (str | None) – New name of the object. If None, a default name is generated, such as ‘Old Name (1)’

  • folder_id (str | None) – ID of the destination folder. If None, the object is saved in the same folder as the source object.

  • project (Project | str | None) – By default, the project selected when creating Connection object. Override project to specify project where the current object exists.

  • self (Entity) –

Returns:

New python object holding the copied object.

Return type:

Any

create_shortcut(target_folder_id=None, target_folder_path=None, target_folder=None, project_id=None, project_name=None, project=None, to_dictionary=False)

Create a shortcut to the object.

Parameters:
  • target_folder_id (str, optional) – ID of the target folder. Target folder must be specified, but target_folder_id may be substituted with target_folder_path or target_folder.

  • target_folder_path (str, optional) – Path to the target folder, e.g. ‘/MicroStrategy Tutorial/Public Objects’. May be used instead of target_folder_id.

  • target_folder (Folder, optional) – Target folder object. May be used instead of target_folder_id.

  • project_id (str, optional) – ID of the target project of the new shortcut. The project may be specified by either project_id, project_name or project. If the project is not specified in either way, the project from the connection object is used.

  • project_name (str, optional) – Name of the target project. May be used instead of project_id.

  • project (Project, optional) – Project object specifying the target project. May be used instead of project_id.

  • to_dictionary (bool, optional) – If True, the method will return a dictionary with the shortcut’s properties instead of a Shortcut object. Defaults to False.

Return type:

Shortcut

delete(force=False)

Delete object.

Parameters:
  • force (bool) – If True, then no additional prompt will be shown before deleting object.

  • self (Entity) –

Returns:

True on success. False otherwise.

Return type:

bool

execute_query(project_id, query, max_retries=10, retry_delay=5)

Execute an SQL query on the given datasource.

Parameters:
  • project_id (str | Project) – project ID

  • query (str) – query to be executed

  • max_retries (int, optional) – maximum number of retries in case the query execution fails. Default is 10.

  • retry_delay (int, optional) – time to wait between retries in seconds. Default is 5.

Returns:

Dictionary containing execution results data for the query.

Return type:

dict

fetch(attr=None)

Fetch the latest object’s state from the I-Server.

Note

This method can overwrite local changes made to the object.

Parameters:
  • attr (Optional[str]) – Attribute name to be fetched. If not specified

  • dictionary. (it will use all getters specified in _API_GETTERS) –

  • None. (Defaults to) –

Raises:

ValueError – If attr cannot be fetched.

Return type:

None

classmethod from_dict(source, connection, to_snake_case=True, with_missing_value=False)
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 Strategy One Connection object.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case, default True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

get(name)

Get object’s attribute by its name.

list_acl(to_dataframe=False, to_dictionary=False, **filters)

Get Access Control List (ACL) for this object. Optionally filter ACLs by specifying filters.

Parameters:
  • to_dataframe (bool, optional) – if True, return datasets as pandas DataFrame

  • to_dictionary (bool, optional) – if True, return datasets as dicts

  • **filters – Available filter parameters: [deny, type, rights, trustee_id, trustee_name, trustee_type, trustee_subtype, inheritable]

Return type:

DataFrame | list[dict | mstrio.utils.acl.ACE]

Examples

>>> list_acl(deny=True, trustee_name="John")
list_dependencies(project=None, name=None, pattern=4, domain=2, object_types=None, used_by_recursive=False, root=None, root_path=None, limit=None, offset=None, results_format='LIST', to_dictionary=True, **filters)

List list_dependencies of an object.

Parameters:
  • project (string) – Project object or ID

  • name (string) – Value the search pattern is set to, which will be applied to the names of object types being searched. For example, search for all report objects (type) whose name begins with (pattern) B (name).

  • pattern (integer or enum class object) – Pattern to search for, such as Begin With or Exactly. Possible values are available in ENUM mstrio.object_management.SearchPattern. Default value is CONTAINS (4).

  • domain (integer or enum class object) – Domain where the search will be performed, such as Local or Project. Possible values are available in ENUM mstrio.object_management.SearchDomain. Default value is PROJECT (2).

  • root (string, optional) – Folder ID of the root folder where the search will be performed.

  • root_path (str, optional) –

    Path of the root folder in which the search will be performed. Can be provided as an alternative to root parameter. If both are provided, root is used.

    the path has to be provided in the following format:
    if it’s inside of a project, example:

    /MicroStrategy Tutorial/Public Objects/Metrics

    if it’s a root folder, example:

    /CASTOR_SERVER_CONFIGURATION/Users

  • class (object_types(enum class object or integer or list of enum) – objects or integers): Type(s) of object(s) to be searched, such as Folder, Attribute or User. Possible values available in ENUMs mstrio.types.ObjectTypes and mstrio.types.ObjectSubTypes

  • used_by_recursive (boolean, optional) – Control the Intelligence server to also find objects that are used by the given objects indirectly. Default value is false.

  • results_format (SearchResultsFormat) – either a list or a tree format

  • to_dictionary (bool) – If False returns objects, by default (True) returns dictionaries.

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

  • offset (int) – Starting point within the collection of returned results. Used to control paging behavior. Default is 0.

  • **filters – Available filter parameters: [‘id’, ‘name’, ‘description’ ,’date_created’, ‘date_modified’, ‘acg’]

  • self (Entity) –

  • object_types (TypeOrSubtype | None) –

Returns:

list of objects or list of dictionaries

list_dependents(project=None, name=None, pattern=4, domain=2, object_types=None, uses_recursive=False, root=None, root_path=None, limit=None, offset=None, results_format='LIST', to_dictionary=True, **filters)

List dependents of an object.

Parameters:
  • project (string) – Project object or ID

  • name (string) – Value the search pattern is set to, which will be applied to the names of object types being searched. For example, search for all report objects (type) whose name begins with (pattern) B (name).

  • pattern (integer or enum class object) – Pattern to search for, such as Begin With or Exactly. Possible values are available in ENUM mstrio.object_management.SearchPattern. Default value is CONTAINS (4).

  • domain (integer or enum class object) – Domain where the search will be performed, such as Local or Project. Possible values are available in ENUM mstrio.object_management.SearchDomain. Default value is PROJECT (2).

  • root (string, optional) – Folder ID of the root folder where the search will be performed.

  • root_path (str, optional) –

    Path of the root folder in which the search will be performed. Can be provided as an alternative to root parameter. If both are provided, root is used.

    the path has to be provided in the following format:
    if it’s inside of a project, example:

    /MicroStrategy Tutorial/Public Objects/Metrics

    if it’s a root folder, example:

    /CASTOR_SERVER_CONFIGURATION/Users

  • class (object_types(enum class object or integer or list of enum) – objects or integers): Type(s) of object(s) to be searched, such as Folder, Attribute or User. Possible values available in ENUMs mstrio.types.ObjectTypes and mstrio.types.ObjectSubTypes

  • uses_recursive (boolean) – Control the Intelligence server to also find objects that use the given objects indirectly. Default value is false.

  • results_format (SearchResultsFormat) – either a list or a tree format

  • to_dictionary (bool) – If False returns objects, by default (True) returns dictionaries.

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

  • offset (int) – Starting point within the collection of returned results. Used to control paging behavior. Default is 0.

  • **filters – Available filter parameters: [‘id’, ‘name’, ‘description’ ,’date_created’, ‘date_modified’, ‘acg’]

  • self (Entity) –

  • object_types (TypeOrSubtype | None) –

Returns:

list of objects or list of dictionaries

list_properties(excluded_properties=None)

Fetches all attributes from the server and converts all properties of the object to a dictionary.

Parameters:

excluded_properties (list[str], optional) – A list of object properties that should be excluded from the dict. Defaults to None.

Returns:

A dictionary which keys are object’s attribute names, and

which values are object’s attribute values.

Return type:

dict

list_translations(languages=None, to_dictionary=False)

Lists translations for the Object.

Parameters:
  • languages (list, optional) –

    list of languages to list the translations for, only translations from these languages will be listed. Languages in the list should be one of the following:

    • lcid attribute of the language

    • ID of the language

    • Language class object

  • to_dictionary (bool, optional) – If True returns dict, by default (False) returns Translation objects

  • self (Entity) –

Returns:

A list of dictionaries representing translations for the Object or a list of Translation Objects.

Return type:

list[’Translation’] | list[dict]

list_vldb_settings(set_names=None, names=None, groups=None, to_dictionary=False, to_dataframe=False)

List VLDB settings according to given parameters.

Parameters:
  • set_names (list[str], optional) – List of names of VLDB settings sets.

  • names (list[str], optional) – List of names of VLDB settings.

  • groups (list[int], list[str], optional) – List of group names or ids.

  • to_dictionary (bool, optional) – If True, return VldbSetting objects as list of dicts, default False.

  • to_dataframe (bool, optional) – If True, return VldbSetting objects as pandas DataFrame, default False.

Raises:
  • ValueError – If there are no VldbSetting objects with given parameters or some of the parameters are incorrectly specified.

  • TypeError – If groups list parameter consists of objects of different types.

Returns:

Dict with settings names as keys and VldbSetting objects as values.

Return type:

dict[str, mstrio.utils.vldb_mixin.VldbSetting] | DataFrame

print()

Pretty Print all properties of the object.

Return type:

None

remove_translation(translations)

Removes translations from the Object.

Parameters:
  • translations (list[OperationData]) – list of translations to be added to the Object

  • self (Entity) –

Return type:

None

reset_vldb_settings(set_names=None, names=None, groups=None, force=False)

Reset VLDB settings specified by parameters to its default values. If call was without parameters then additional prompt will be shown.

Parameters:
  • set_names (list[str], optional) – List of names of VLDB setting sets.

  • names (list[str], optional) – List of names of VLDB settings.

  • groups (list[int], list[str], optional) – List of groups names or ids.

  • force (bool) – (bool, optional): If True, no additional prompt will be shown before resetting in case when all other arguments are not provided, default False.

Raises:
  • ValueError – If there are no VldbSetting objects with given parameters or some of the parameters are incorrectly specified.

  • TypeError – If groups list parameter consists of objects of different types.

Returns:

None

Return type:

None

classmethod to_csv(objects, name, path=None, properties=None)

Exports MSTR objects to a csv file.

Optionally, saves only the object properties specified in the properties parameter.

Parameters:
  • objects (T | list[T]) – List of objects of the same type that

  • exported. (will be) –

  • name (str) – The name of the csv file ending with ‘.csv’

  • path (Optional[str], optional) – A path to the directory where the file will be saved. Defaults to None.

  • properties (Optional[list[str]], optional) – A list of object’s attribute names that should be included in the exported file. Defaults to None.

Raises:
  • TypeError – If objects is not of type T or list of type T

  • objects.

Return type:

None

to_dataframe()

Converts all properties of the object to a dataframe.

Returns:

A DataFrame object containing object properties.

Return type:

DataFrame

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

update_properties()

Save compatible local changes of the object attributes to the I-Server. Changes are retrieved from the self._altered_properties dictionary. After the process of update has finished, self._altered_properties is cleared. For this method to work properly, you must override the _alter_properties() method in a subclass.

Raises:

requests.HTTPError – If I-Server raises exception

Return type:

None

enum mstrio.datasources.datasource_instance.DatasourceType(value)

Bases: AutoName

Valid values are as follows:

RESERVED = DatasourceType.RESERVED
NORMAL = DatasourceType.NORMAL
DATA_IMPORT = DatasourceType.DATA_IMPORT
DATA_IMPORT_PRIMARY = DatasourceType.DATA_IMPORT_PRIMARY
mstrio.datasources.datasource_instance.list_connected_datasource_instances(connection, to_dictionary=False)

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) – Strategy One 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:

list[”DatasourceInstance”] | list[dict]

mstrio.datasources.datasource_instance.list_datasource_instances(connection, to_dictionary=False, limit=None, ids=None, database_types=None, project=None, **filters)

Get list of DatasourceInstance objects or dicts. Optionally filter the datasource instances by specifying filters.

Parameters:
  • connection (Connection) – Strategy One connection object returned by connection.Connection()

  • to_dictionary (bool) – If True returns dict, by default (False) returns User objects.

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

  • ids (list[str] | None) – list of datasources ids as strings. By default None.

  • database_types (list[str] | None) – 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 (Project | str | None) – 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’, ‘acg’, ‘datasource_type’, ‘table_prefix’, ‘odbc_version’, ‘intermediate_store_db_name’, ‘intermediate_store_table_space_name’, ‘dbms’, ‘owner’, ‘hidden’, ‘datasource_connection’, ‘database_type’, ‘database_version’, ‘primary_datasource’, ‘data_mart_datasource’]

Return type:

list[’DatasourceInstance’] | list[dict]

Examples

>>> list_datasource_instances(connection, name='ds_instance_name')