mstrio > server > documentation¶
- enum mstrio.server.documentation.DocApplicationType(value)¶
Bases:
AutoPascalNameApplication object types included in a documentation definition.
Specifies which application-layer Strategy object types (reports, dashboards, metrics, etc.) are captured by the documentation definition.
Valid values are as follows:
- ALL = <DocApplicationType.ALL: 'All'>¶
- AUTO_STYLE = <DocApplicationType.AUTO_STYLE: 'AutoStyle'>¶
- BASE_FORMULA = <DocApplicationType.BASE_FORMULA: 'BaseFormula'>¶
- CONSOLIDATION = <DocApplicationType.CONSOLIDATION: 'Consolidation'>¶
- CUSTOM_GROUP = <DocApplicationType.CUSTOM_GROUP: 'CustomGroup'>¶
- DATA_MART_REPORT = <DocApplicationType.DATA_MART_REPORT: 'DataMartReport'>¶
- DASHBOARD = <DocApplicationType.DASHBOARD: 'Dashboard'>¶
- DERIVED_ELEMENT = <DocApplicationType.DERIVED_ELEMENT: 'DerivedElement'>¶
- DOCUMENT = <DocApplicationType.DOCUMENT: 'Document'>¶
- DRILL_MAP = <DocApplicationType.DRILL_MAP: 'DrillMap'>¶
- FILTER = <DocApplicationType.FILTER: 'Filter'>¶
- HYPERCARD = <DocApplicationType.HYPERCARD: 'Hypercard'>¶
- HTML_DOCUMENT = <DocApplicationType.HTML_DOCUMENT: 'HTMLDocument'>¶
- INTELLIGENT_CUBE = <DocApplicationType.INTELLIGENT_CUBE: 'IntelligentCube'>¶
- METRIC = <DocApplicationType.METRIC: 'Metric'>¶
- DATA_IMPORT_CUBE = <DocApplicationType.DATA_IMPORT_CUBE: 'MTDICube'>¶
- PREDICTIVE_METRIC = <DocApplicationType.PREDICTIVE_METRIC: 'PredictiveMetric'>¶
- PROMPT = <DocApplicationType.PROMPT: 'Prompt'>¶
- REPORT = <DocApplicationType.REPORT: 'Report'>¶
- SEARCH = <DocApplicationType.SEARCH: 'Search'>¶
- SHORTCUT = <DocApplicationType.SHORTCUT: 'Shortcut'>¶
- SUBTOTAL = <DocApplicationType.SUBTOTAL: 'Subtotal'>¶
- TEMPLATE = <DocApplicationType.TEMPLATE: 'Template'>¶
- enum mstrio.server.documentation.DocBasicProperty(value)¶
Bases:
AutoPascalNameBasic object properties captured in a documentation definition.
Specifies which metadata properties (such as location, owner, and timestamps) are included in the documentation output.
Valid values are as follows:
- ALL = <DocBasicProperty.ALL: 'All'>¶
- LOCATION = <DocBasicProperty.LOCATION: 'Location'>¶
- DESCRIPTION = <DocBasicProperty.DESCRIPTION: 'Description'>¶
- LONG_DESCRIPTION = <DocBasicProperty.LONG_DESCRIPTION: 'LongDescription'>¶
- CREATION_TIME = <DocBasicProperty.CREATION_TIME: 'CreationTime'>¶
- MODIFICATION_TIME = <DocBasicProperty.MODIFICATION_TIME: 'ModificationTime'>¶
- OWNER = <DocBasicProperty.OWNER: 'Owner'>¶
- HIDDEN = <DocBasicProperty.HIDDEN: 'Hidden'>¶
- ID = <DocBasicProperty.ID: 'ID'>¶
- VERSION_ID = <DocBasicProperty.VERSION_ID: 'VersionID'>¶
- ACCESS_CONTROL = <DocBasicProperty.ACCESS_CONTROL: 'AccessControl'>¶
- INTERNATIONAL_PROPERTIES = <DocBasicProperty.INTERNATIONAL_PROPERTIES: 'I18nProperties'>¶
- enum mstrio.server.documentation.DocDefinitionSortBy(value)¶
Bases:
EnumSorting options for listing documentation definitions.
Valid values are as follows:
- ID_ASC = <DocDefinitionSortBy.ID_ASC: '+id'>¶
- ID_DESC = <DocDefinitionSortBy.ID_DESC: '-id'>¶
- NAME_ASC = <DocDefinitionSortBy.NAME_ASC: '+name'>¶
- NAME_DESC = <DocDefinitionSortBy.NAME_DESC: '-name'>¶
- TYPE_ASC = <DocDefinitionSortBy.TYPE_ASC: '+type'>¶
- TYPE_DESC = <DocDefinitionSortBy.TYPE_DESC: '-type'>¶
- PROJECT_NAME_ASC = <DocDefinitionSortBy.PROJECT_NAME_ASC: '+projectName'>¶
- PROJECT_NAME_DESC = <DocDefinitionSortBy.PROJECT_NAME_DESC: '-projectName'>¶
- OWNER_NAME_ASC = <DocDefinitionSortBy.OWNER_NAME_ASC: '+ownerName'>¶
- OWNER_NAME_DESC = <DocDefinitionSortBy.OWNER_NAME_DESC: '-ownerName'>¶
- DATE_CREATED_ASC = <DocDefinitionSortBy.DATE_CREATED_ASC: '+dateCreated'>¶
- DATE_CREATED_DESC = <DocDefinitionSortBy.DATE_CREATED_DESC: '-dateCreated'>¶
- LAST_RUN_ASC = <DocDefinitionSortBy.LAST_RUN_ASC: '+lastRun'>¶
- LAST_RUN_DESC = <DocDefinitionSortBy.LAST_RUN_DESC: '-lastRun'>¶
- SIZE_ASC = <DocDefinitionSortBy.SIZE_ASC: '+size'>¶
- SIZE_DESC = <DocDefinitionSortBy.SIZE_DESC: '-size'>¶
- enum mstrio.server.documentation.DocExportFormat(value)¶
Bases:
AutoNameExport file formats for a documentation job.
Used with Documentation.export_to_file to specify the output format when downloading documentation content.
Valid values are as follows:
- CSV = DocExportFormat.CSV¶
- JSON = DocExportFormat.JSON¶
- EXCEL = DocExportFormat.EXCEL¶
The
Enumand its members also have the following methods:- classmethod has_value(value)¶
- enum mstrio.server.documentation.DocFolderType(value)¶
Bases:
AutoPascalNameFolder content scope options for a documentation definition.
Specifies whether the documentation definition should capture all object types or only folder objects.
Valid values are as follows:
- ALL = <DocFolderType.ALL: 'All'>¶
- FOLDER = <DocFolderType.FOLDER: 'Folder'>¶
- enum mstrio.server.documentation.DocMdxCubeType(value)¶
Bases:
AutoPascalNameMDX cube object types included in a documentation definition.
Specifies which MDX cube-related object types are captured by the documentation definition.
Valid values are as follows:
- ALL = <DocMdxCubeType.ALL: 'All'>¶
- MDX_ATTRIBUTE = <DocMdxCubeType.MDX_ATTRIBUTE: 'MDXAttribute'>¶
- MDX_SYSTEM_HIERARCHY = <DocMdxCubeType.MDX_SYSTEM_HIERARCHY: 'MDXSystemHierarchy'>¶
- MDX_METRIC = <DocMdxCubeType.MDX_METRIC: 'MDXMetric'>¶
- MDX_LOGICAL_TABLE = <DocMdxCubeType.MDX_LOGICAL_TABLE: 'MDXLogicalTable'>¶
- MDX_PROMPT = <DocMdxCubeType.MDX_PROMPT: 'MDXPrompt'>¶
- enum mstrio.server.documentation.DocObjectType(value)¶
Bases:
AutoPascalNameObject type filter for documentation content listing.
Used with Documentation.list_objects to narrow results by object type. Values correspond to the REST API’s objectType parameter for the documentation objects endpoint.
Valid values are as follows:
- DASHBOARD = <DocObjectType.DASHBOARD: 'Dashboard'>¶
- DOCUMENT = <DocObjectType.DOCUMENT: 'Document'>¶
- HTML_DOCUMENT = <DocObjectType.HTML_DOCUMENT: 'HTMLDocument'>¶
- HYPERCARD = <DocObjectType.HYPERCARD: 'Hypercard'>¶
- DATA_IMPORT_CUBE = <DocObjectType.DATA_IMPORT_CUBE: 'MTDICube'>¶
- DATA_MART_REPORT = <DocObjectType.DATA_MART_REPORT: 'DataMartReport'>¶
- INTELLIGENT_CUBE = <DocObjectType.INTELLIGENT_CUBE: 'IntelligentCube'>¶
- REPORT = <DocObjectType.REPORT: 'Report'>¶
- CUSTOM_GROUP = <DocObjectType.CUSTOM_GROUP: 'CustomGroup'>¶
- FILTER = <DocObjectType.FILTER: 'Filter'>¶
- AUTO_STYLE = <DocObjectType.AUTO_STYLE: 'AutoStyle'>¶
- BASE_FORMULA = <DocObjectType.BASE_FORMULA: 'BaseFormula'>¶
- CONSOLIDATION = <DocObjectType.CONSOLIDATION: 'Consolidation'>¶
- DERIVED_ELEMENT = <DocObjectType.DERIVED_ELEMENT: 'DerivedElement'>¶
- DRILL_MAP = <DocObjectType.DRILL_MAP: 'DrillMap'>¶
- METRIC = <DocObjectType.METRIC: 'Metric'>¶
- SUBTOTAL = <DocObjectType.SUBTOTAL: 'Subtotal'>¶
- PREDICTIVE_METRIC = <DocObjectType.PREDICTIVE_METRIC: 'PredictiveMetric'>¶
- PROMPT = <DocObjectType.PROMPT: 'Prompt'>¶
- SEARCH = <DocObjectType.SEARCH: 'Search'>¶
- SHORTCUT = <DocObjectType.SHORTCUT: 'Shortcut'>¶
- TEMPLATE = <DocObjectType.TEMPLATE: 'Template'>¶
- ATTRIBUTE = <DocObjectType.ATTRIBUTE: 'Attribute'>¶
- FACT = <DocObjectType.FACT: 'Fact'>¶
- FUNCTION = <DocObjectType.FUNCTION: 'Function'>¶
- HIERARCHY = <DocObjectType.HIERARCHY: 'Hierarchy'>¶
- LOGICAL_TABLE = <DocObjectType.LOGICAL_TABLE: 'LogicalTable'>¶
- METADATA_PARTITION_MAPPING = <DocObjectType.METADATA_PARTITION_MAPPING: 'MetadataPartitionMapping'>¶
- WAREHOUSE_PARTITION_MAPPING = <DocObjectType.WAREHOUSE_PARTITION_MAPPING: 'WarehousePartitionMapping'>¶
- SECURITY_FILTER = <DocObjectType.SECURITY_FILTER: 'SecurityFilter'>¶
- TRANSFORMATION = <DocObjectType.TRANSFORMATION: 'Transformation'>¶
- FOLDER = <DocObjectType.FOLDER: 'Folder'>¶
- MDX_ATTRIBUTE = <DocObjectType.MDX_ATTRIBUTE: 'MDXAttribute'>¶
- MDX_SYSTEM_HIERARCHY = <DocObjectType.MDX_SYSTEM_HIERARCHY: 'MDXSystemHierarchy'>¶
- MDX_METRIC = <DocObjectType.MDX_METRIC: 'MDXMetric'>¶
- MDX_LOGICAL_TABLE = <DocObjectType.MDX_LOGICAL_TABLE: 'MDXLogicalTable'>¶
- MDX_PROMPT = <DocObjectType.MDX_PROMPT: 'MDXPrompt'>¶
- enum mstrio.server.documentation.DocSchemaType(value)¶
Bases:
AutoPascalNameSchema object types included in a documentation definition.
Specifies which schema-layer Strategy object types (attributes, facts, hierarchies, etc.) are captured by the documentation definition.
Valid values are as follows:
- ALL = <DocSchemaType.ALL: 'All'>¶
- ATTRIBUTE = <DocSchemaType.ATTRIBUTE: 'Attribute'>¶
- FACT = <DocSchemaType.FACT: 'Fact'>¶
- FUNCTION = <DocSchemaType.FUNCTION: 'Function'>¶
- HIERARCHY = <DocSchemaType.HIERARCHY: 'Hierarchy'>¶
- LOGICAL_TABLE = <DocSchemaType.LOGICAL_TABLE: 'LogicalTable'>¶
- SECURITY_FILTER = <DocSchemaType.SECURITY_FILTER: 'SecurityFilter'>¶
- TRANSFORMATION = <DocSchemaType.TRANSFORMATION: 'Transformation'>¶
- WAREHOUSE_PARTITION_MAPPING = <DocSchemaType.WAREHOUSE_PARTITION_MAPPING: 'WarehousePartitionMapping'>¶
- METADATA_PARTITION_MAPPING = <DocSchemaType.METADATA_PARTITION_MAPPING: 'MetadataPartitionMapping'>¶
- class mstrio.server.documentation.Documentation(connection, id=None, name=None)¶
Bases:
Entity,DeleteMixinRepresents a Strategy documentation job.
A documentation job is created by executing a DocumentationDefinition and captures a snapshot of Strategy metadata at a point in time.
- Parameters:
connection (Connection)
id (str | None)
name (str | None)
- id¶
Unique documentation job ID.
- Type:
str
- name¶
Name of the documentation job.
- Type:
str
- documentation_definition_id¶
ID of the definition used to create this job.
- Type:
str
- type¶
Object type identifier.
- Type:
int
- status¶
Current job status value.
- Type:
- message¶
Status message or error detail from the server.
- Type:
str
- size¶
Size of the documentation output in bytes.
- Type:
int
- project_id¶
ID of the project the job belongs to.
- Type:
str
- date_created¶
Timestamp when the job was created.
- Type:
datetime
- 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
- 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 – 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 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 instance of the cls class.
- 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
- __init__(connection, id=None, name=None)¶
Initialize Documentation object by passing id or name.
- Parameters:
connection (Connection) – Strategy connection object.
id (str, optional) – Documentation job ID.
name (str, optional) – Documentation job name. Used to resolve ID when id is not provided.
- Return type:
None
- 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 Enumstrustees (
list[str|User|UserGroup] |str|User|UserGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE fordenied (
bool) – flag to indicate granted or denied access to the objectinheritable (
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 accordinglypropagation_behavior (
PropagationBehavior|str|None) – Behavior of ACL propagation to children.
- 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 Enumstrustees (
list[str|User|UserGroup] |str|User|UserGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE fordenied (
bool) – flag to indicate granted or denied access to the objectinheritable (
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 accordinglypropagation_behavior (
PropagationBehavior|str|None) – Behavior of ACL propagation to children.
- 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 Enumstrustees (
list[str|User|UserGroup] |str|User|UserGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE fordenied (
bool) – flag to indicate granted or denied access to the objectinheritable (
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 accordinglypropagation_behavior (
PropagationBehavior|str|None) – Behavior of ACL propagation to children.
- 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
- Returns:
list[Translation] – A list of translations for the Object.- Return type:
list[Translation]
- alter(name=None, journal_comment=None)¶
Alter the documentation job’s name.
- Parameters:
name (str, optional) – New name for the documentation job.
journal_comment (str, optional) – Journal comment for the change.
- Return type:
None
- alter_translation(translations)¶
Alters translations of the Object.
- Parameters:
translations (list[OperationData]) – list of translations to be added to the Object
- Return type:
None
- create_shortcut(target_folder=None, target_folder_id=None, target_folder_name=None, target_folder_path=None, project=None, project_id=None, project_name=None, to_dictionary=False)¶
Create a shortcut to the object.
- Parameters:
target_folder (Folder | tuple | list | str, optional) – Folder object or ID or name or path specifying the folder. May be used instead of target_folder_id, target_folder_name or target_folder_path.
target_folder_id (str, optional) – ID of a folder.
target_folder_name (str, optional) – Name of a folder.
target_folder_path (str, optional) –
Path of the folder. The path has to be provided in the following format:
/MicroStrategy Tutorial/Public Objects/Metrics
project (Project | str, optional) – Project object or ID or name specifying the project. May be used instead of project_id or project_name.
project_id (str, optional) – Project ID
project_name (str, optional) – Project name
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:
- delete(force=False, journal_comment=None, **kwargs)¶
Delete object.
- Parameters:
force (
bool) – If True, then no additional prompt will be shown before deleting object.journal_comment (
str|None) – Comment to be added to the change journal for this deletion. If None, no comment is added.**kwargs – Any additional arguments within overridden versions of this method in inheritance chain.
- Returns:
bool– True on success. False otherwise.- Return type:
bool
- export_to_file(file_path, export_format=DocExportFormat.JSON, overwrite=False)¶
Export documentation to a local file.
If file_path points to a directory, this method uses the exported filename returned by the backend and saves it in that directory.
- Parameters:
file_path (str | Path) – Target file or directory path.
export_format (DocExportFormat | str, optional) – Export format. Supported values are csv, json, and excel. Defaults to ‘json’.
overwrite (bool, optional) – Whether to overwrite an existing target file. Defaults to False.
- Return type:
None
- 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
- fetch_all_change_journal_entries()¶
Fetch change journal entries from the API.
- Return type:
None
- get(name)¶
Get object’s attribute by its name.
- get_resource(resource, to_dictionary=True)¶
Get a resource from this documentation.
- Parameters:
resource (str | Entity) – Resource represented as resource ID or an Entity object (e.g., Project, Folder).
to_dictionary (bool, optional) – If True, returns dictionary data. If False, returns a ResourceFolder object.
- Returns:
dict|ResourceFolder– Resource dictionary or ResourceFolder object, based on to_dictionary.- Return type:
dict | ResourceFolder
- get_status(to_dictionary=False)¶
Get current execution status of this documentation.
- Parameters:
to_dictionary (bool, optional) – If True, returns a dictionary. If False, returns a DocumentationStatus object.
- Returns:
DocumentationStatus|dict– DocumentationStatus object or dictionary, based on to_dictionary.- Raises:
ValueError – If status is not yet available on the server.
- Return type:
DocumentationStatus | dict
- has_dependents()¶
Check if the object has any dependents.
- Returns:
bool– True if the object has dependents, False otherwise.- Return type:
bool
- 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|ACE]
Examples
>>> list_acl(deny=True, trustee_name="John")
- list_dependencies(project=None, name=None, pattern=4, domain=2, scope=None, 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).
scope (SearchScope, str, optional) – Scope of the search with regard to System Managed Objects. Possible values are available in ENUM mstrio.object_management.SearchScope.
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’]
object_types (int | ObjectTypes | ObjectSubTypes | list[int | ObjectTypes | ObjectSubTypes] | None)
- Returns:
list of objects or list of dictionaries
- list_dependents(project=None, name=None, pattern=4, domain=2, scope=None, 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).
scope (SearchScope, str, optional) – Scope of the search with regard to System Managed Objects. Possible values are available in ENUM mstrio.object_management.SearchScope.
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’]
object_types (int | ObjectTypes | ObjectSubTypes | list[int | ObjectTypes | ObjectSubTypes] | None)
- Returns:
list[dict] |list[Entity] – list of objects or list of dictionaries- Return type:
list[dict] | list[Entity]
- list_objects(doc_object_type=None, limit=None, to_dictionary=True)¶
List objects included in this documentation.
- Parameters:
doc_object_type (DocObjectType | str, optional) – Optional filter for documentation object type. Must be a value of DocObjectType, which is distinct from the standard ObjectTypes enum.
limit (int, optional) – Maximum number of objects to return. If None, all available objects are returned.
to_dictionary (bool, optional) – If True, returns a list of dictionaries with snake_case keys. If False, returns DocumentationObject objects.
- Returns:
list[dict] |list[DocumentationObject] – List of dictionaries or list of DocumentationObject objects, based on to_dictionary.- Return type:
list[dict] | list[DocumentationObject]
- 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
- Returns:
list[Translation] |list[dict] – A list of dictionaries representing translations for the Object or a list of Translation Objects.- Return type:
list[Translation] | list[dict]
- 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
- 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, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- 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
- wait_for_execution_finish(interval=None)¶
Wait until documentation execution is completed.
- Parameters:
interval (int, optional) – Time interval in seconds between polling requests for status. If not provided, the value is taken from mstrio-py’s config.
- Returns:
Final status of the documentation execution.
- Return type:
- property acl: list[ACE]¶
- property ancestors: list[dict]¶
- property certified_info¶
- property change_journal: list[ChangeJournalEntry]¶
Get change journal entries of the object.
- property comments: list[str]¶
- property connection: Connection¶
An object representation of Strategy connection specific to the object.
- property date_created: DatetimeFormats¶
- property date_modified: DatetimeFormats¶
- property documentation_definition_id: str | None¶
- property ext_type: ExtendedType¶
- property folder_id: str | None¶
- property icon_path: str¶
- property id: str¶
The object’s id.
- property location: str¶
- property message: str | None¶
- property owner¶
- property project_id: str | None¶
- property size: int | None¶
- property status: EnumDocumentationStatus | None¶
- property subtype: ObjectSubTypes¶
- property target_info: dict¶
- property tenant_id: str | None¶
Tenant ID resolved from documentation definition.
- property tenant_name: str | None¶
Tenant name resolved from tenant ID.
- property type: ObjectTypes¶
The object’s type.
- property version: str¶
- property view_media: int¶
- class mstrio.server.documentation.DocumentationDefinition(connection, id=None, name=None)¶
Bases:
Entity,DeleteMixin,TenantMixinRepresents a Strategy documentation definition.
A documentation definition specifies the scope and content of a documentation job, including which object types, properties, and projects are captured.
- Parameters:
connection (Connection)
id (str | None)
name (str | None)
- id¶
Unique documentation definition ID.
- Type:
str
- name¶
Name of the documentation definition.
- Type:
str
- description¶
Description of the documentation definition.
- Type:
str
- tenant_id¶
ID of the tenant this definition belongs to.
- Type:
str
Whether hidden objects are included.
- Type:
bool
- defaults¶
Whether default values are included.
- Type:
bool
- definition¶
Whether definition data is included.
- Type:
bool
- advanced_definition¶
Whether advanced definition data is included.
- Type:
bool
- dependents¶
Whether dependents are included.
- Type:
bool
- components¶
Whether components are included.
- Type:
bool
- folder¶
Folder scope filter values.
- Type:
list[DocFolderType]
- application¶
Application object type filter values.
- Type:
list[DocApplicationType]
- schema¶
Schema object type filter values.
- Type:
list[DocSchemaType]
- mdx_cubes¶
MDX cube object type filter values.
- Type:
list[DocMdxCubeType]
- basic_properties¶
Basic property filter values.
- Type:
list[DocBasicProperty]
- project_id¶
ID of the project this definition belongs to.
- Type:
str
- 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
- classmethod create(connection, name, hidden_objects=True, defaults=True, definition=True, advanced_definition=True, dependents=True, components=True, folder='All', application='All', schema='All', mdx_cubes='All', basic_properties='All', project=None, project_id=None, project_name=None)¶
Create a documentation definition.
- Parameters:
connection (Connection) – Strategy connection object.
name (str) – Name of the documentation definition.
hidden_objects (bool, optional) – Whether to include hidden objects. Defaults to True.
defaults (bool, optional) – Whether to include default values. Defaults to True.
definition (bool, optional) – Whether to include definition data. Defaults to True.
advanced_definition (bool, optional) – Whether to include advanced definition data. Defaults to True.
dependents (bool, optional) – Whether to include dependents. Defaults to True.
components (bool, optional) – Whether to include components. Defaults to True.
str (folder (list[DocFolderType | str] | DocFolderType |) – optional): Folder scope filter. Defaults to ‘All’.
folder (list[DocFolderType | str] | DocFolderType | str | None)
application (list[DocApplicationType | str] | DocApplicationType | str | None)
schema (list[DocSchemaType | str] | DocSchemaType | str | None)
mdx_cubes (list[DocMdxCubeType | str] | DocMdxCubeType | str | None)
basic_properties (list[DocBasicProperty | str] | DocBasicProperty | str | None)
project (Project | str | None)
project_id (str | None)
project_name (str | None)
- Return type:
:param : optional): Folder scope filter. Defaults to ‘All’. :param application (list[DocApplicationType | str] |: DocApplicationType | str, optional): Application object
type filter. Defaults to ‘All’.
- Parameters:
str (schema (list[DocSchemaType | str] | DocSchemaType |) – optional): Schema object type filter. Defaults to ‘All’.
connection (Connection)
name (str)
hidden_objects (bool)
defaults (bool)
definition (bool)
advanced_definition (bool)
dependents (bool)
components (bool)
folder (list[DocFolderType | str] | DocFolderType | str | None)
application (list[DocApplicationType | str] | DocApplicationType | str | None)
schema (list[DocSchemaType | str] | DocSchemaType | str | None)
mdx_cubes (list[DocMdxCubeType | str] | DocMdxCubeType | str | None)
basic_properties (list[DocBasicProperty | str] | DocBasicProperty | str | None)
project (Project | str | None)
project_id (str | None)
project_name (str | None)
- Return type:
:param : optional): Schema object type filter. Defaults to ‘All’. :param mdx_cubes (list[DocMdxCubeType | str] | DocMdxCubeType | str: optional): MDX cube object type filter. Defaults to
‘All’.
- :paramoptional): MDX cube object type filter. Defaults to
‘All’.
- Parameters:
| (basic_properties (list[DocBasicProperty | str]) – DocBasicProperty | str, optional): Basic property filter. Defaults to ‘All’. ‘ID’ field will always be included.
project (Project | str, optional) – Project object, ID, or name.
project_id (str, optional) – Project ID.
project_name (str, optional) – Project name.
connection (Connection)
name (str)
hidden_objects (bool)
defaults (bool)
definition (bool)
advanced_definition (bool)
dependents (bool)
components (bool)
folder (list[DocFolderType | str] | DocFolderType | str | None)
application (list[DocApplicationType | str] | DocApplicationType | str | None)
schema (list[DocSchemaType | str] | DocSchemaType | str | None)
mdx_cubes (list[DocMdxCubeType | str] | DocMdxCubeType | str | None)
basic_properties (list[DocBasicProperty | str] | DocBasicProperty | str | None)
- Return type:
Note
Passing None to any of folder, application, schema, mdx_cubes, or basic_properties means no objects of that category will be included in the documentation output.
- Returns:
- Newly created documentation
definition object.
- Return type:
- Raises:
ValueError – If none of project, project_id, or project_name is provided.
- Parameters:
connection (Connection)
name (str)
hidden_objects (bool)
defaults (bool)
definition (bool)
advanced_definition (bool)
dependents (bool)
components (bool)
folder (list[DocFolderType | str] | DocFolderType | str | None)
application (list[DocApplicationType | str] | DocApplicationType | str | None)
schema (list[DocSchemaType | str] | DocSchemaType | str | None)
mdx_cubes (list[DocMdxCubeType | str] | DocMdxCubeType | str | None)
basic_properties (list[DocBasicProperty | str] | DocBasicProperty | str | None)
project (Project | str | None)
project_id (str | None)
project_name (str | 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 – 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 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 instance of the cls class.
- 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
- __init__(connection, id=None, name=None)¶
Initialize DocumentationDefinition object by passing id or name.
- Parameters:
connection (Connection) – Strategy connection object.
id (str, optional) – Documentation definition ID.
name (str, optional) – Documentation definition name. Used to resolve ID when id is not provided.
- Return type:
None
- 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 Enumstrustees (
list[str|User|UserGroup] |str|User|UserGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE fordenied (
bool) – flag to indicate granted or denied access to the objectinheritable (
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 accordinglypropagation_behavior (
PropagationBehavior|str|None) – Behavior of ACL propagation to children.
- 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 Enumstrustees (
list[str|User|UserGroup] |str|User|UserGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE fordenied (
bool) – flag to indicate granted or denied access to the objectinheritable (
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 accordinglypropagation_behavior (
PropagationBehavior|str|None) – Behavior of ACL propagation to children.
- 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 Enumstrustees (
list[str|User|UserGroup] |str|User|UserGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE fordenied (
bool) – flag to indicate granted or denied access to the objectinheritable (
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 accordinglypropagation_behavior (
PropagationBehavior|str|None) – Behavior of ACL propagation to children.
- 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
- Returns:
list[Translation] – A list of translations for the Object.- Return type:
list[Translation]
- alter(name=None, description=None, journal_comment=None)¶
Alter documentation definition properties.
- Return type:
None- Parameters:
name (str | None)
description (str | None)
journal_comment (str | None)
- alter_translation(translations)¶
Alters translations of the Object.
- Parameters:
translations (list[OperationData]) – list of translations to be added to the Object
- Return type:
None
- change_tenant(tenant=None, tenant_id=None, tenant_name=None)¶
Change the tenant of the object by moving it to a new tenant.
- Parameters:
tenant (Tenant | str | None, optional) – Tenant object or ID or name specifying the tenant. May be used instead of tenant_id or tenant_name.
tenant_id (str | None, optional) – Tenant ID
tenant_name (str | None, optional) – Tenant name
- Raises:
ValueError – If tenant cannot be determined from the provided parameters.
NotSupportedError – If object has read-only tenant assignment.
- Return type:
None
- create_shortcut(target_folder=None, target_folder_id=None, target_folder_name=None, target_folder_path=None, project=None, project_id=None, project_name=None, to_dictionary=False)¶
Create a shortcut to the object.
- Parameters:
target_folder (Folder | tuple | list | str, optional) – Folder object or ID or name or path specifying the folder. May be used instead of target_folder_id, target_folder_name or target_folder_path.
target_folder_id (str, optional) – ID of a folder.
target_folder_name (str, optional) – Name of a folder.
target_folder_path (str, optional) –
Path of the folder. The path has to be provided in the following format:
/MicroStrategy Tutorial/Public Objects/Metrics
project (Project | str, optional) – Project object or ID or name specifying the project. May be used instead of project_id or project_name.
project_id (str, optional) – Project ID
project_name (str, optional) – Project name
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:
- delete(force=False, journal_comment=None, **kwargs)¶
Delete object.
- Parameters:
force (
bool) – If True, then no additional prompt will be shown before deleting object.journal_comment (
str|None) – Comment to be added to the change journal for this deletion. If None, no comment is added.**kwargs – Any additional arguments within overridden versions of this method in inheritance chain.
- Returns:
bool– True on success. False otherwise.- Return type:
bool
- execute()¶
Execute this documentation definition and return a job.
This method only triggers the documentation job execution on the server. The returned Documentation object is initially created but not yet ready for use. To check if the documentation is ready, monitor the status until it changes to ‘Ready’.
Warning
Documentation execution can be a time-consuming operation and may lead to timeout issues, especially for large definitions or server-side constraints. If your connection times out before execution completes, you can recover the job using the definition ID or name with list_documentations().
Note
For long-running executions, use wait_for_execution_finish() on the returned Documentation object to monitor progress and wait until the status becomes ‘Ready’.
- Returns:
- Newly created documentation job (status may be
’Running’ initially).
- Return type:
- 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
- fetch_all_change_journal_entries()¶
Fetch change journal entries from the API.
- Return type:
None
- get(name)¶
Get object’s attribute by its name.
- has_dependents()¶
Check if the object has any dependents.
- Returns:
bool– True if the object has dependents, False otherwise.- Return type:
bool
- 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|ACE]
Examples
>>> list_acl(deny=True, trustee_name="John")
- list_dependencies(project=None, name=None, pattern=4, domain=2, scope=None, 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).
scope (SearchScope, str, optional) – Scope of the search with regard to System Managed Objects. Possible values are available in ENUM mstrio.object_management.SearchScope.
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’]
object_types (int | ObjectTypes | ObjectSubTypes | list[int | ObjectTypes | ObjectSubTypes] | None)
- Returns:
list of objects or list of dictionaries
- list_dependents(project=None, name=None, pattern=4, domain=2, scope=None, 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).
scope (SearchScope, str, optional) – Scope of the search with regard to System Managed Objects. Possible values are available in ENUM mstrio.object_management.SearchScope.
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’]
object_types (int | ObjectTypes | ObjectSubTypes | list[int | ObjectTypes | ObjectSubTypes] | None)
- Returns:
list[dict] |list[Entity] – list of objects or list of dictionaries- Return type:
list[dict] | list[Entity]
- 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
- Returns:
list[Translation] |list[dict] – A list of dictionaries representing translations for the Object or a list of Translation Objects.- Return type:
list[Translation] | list[dict]
- print()¶
Pretty Print all properties of the object.
- Return type:
None
- remove_from_tenant()¶
Remove the object from its current tenant.
If the object is not assigned to any tenant, this method does nothing.
Note
If the object’s tenant_id attribute is not populated (e.g., due to construction from a partial dict or config.fetch_on_init being disabled), this method will fetch the object’s basic information from the server to determine tenant assignment.
- Raises:
NotSupportedError – If object has read-only tenant assignment.
- Return type:
None
- remove_translation(translations)¶
Removes translations from the Object.
- Parameters:
translations (list[OperationData]) – list of translations to be added to the Object
- 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, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- 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
- property acl: list[ACE]¶
- property advanced_definition: bool | None¶
- property ancestors: list[dict]¶
- property application: list[DocApplicationType] | None¶
- property basic_properties: list[DocBasicProperty] | None¶
- property certified_info¶
- property change_journal: list[ChangeJournalEntry]¶
Get change journal entries of the object.
- property comments: list[str]¶
- property components: bool | None¶
- property connection: Connection¶
An object representation of Strategy connection specific to the object.
- property date_created: DatetimeFormats¶
- property date_modified: DatetimeFormats¶
- property defaults: bool | None¶
- property definition: bool | None¶
- property dependents: bool | None¶
- property ext_type: ExtendedType¶
- property folder: list[DocFolderType] | None¶
- property folder_id: str | None¶
- property hidden_objects: bool | None¶
- property icon_path: str¶
- property id: str¶
The object’s id.
- property instance: list[str] | None¶
- property location: str¶
- property mdx_cubes: list[DocMdxCubeType] | None¶
- property project_id: str | None¶
- property schema: list[DocSchemaType] | None¶
- property subtype: ObjectSubTypes¶
- property target_info: dict¶
- property tenant: Tenant | None¶
Get the Tenant object instance for the tenant this object belongs to.
- Returns:
- Tenant instance if object is assigned to a tenant,
None otherwise.
- Return type:
Tenant | None
- property tenant_id: str | None¶
Get the ID of the tenant to which this object belongs.
- property tenant_name: str | None¶
Get the name of the tenant to which this object belongs.
- property type: ObjectTypes¶
The object’s type.
- property version: str¶
- property view_media: int¶
- class mstrio.server.documentation.DocumentationObject(id=None, name=None, owner_id=None, owner_name=None, location=None, ancestor_folders=None, creation_time=None, modification_time=None, description=None, type=None)¶
Bases:
DictableDraft representation of a documentation object item.
- Parameters:
id (str | None)
name (str | None)
owner_id (str | None)
owner_name (str | None)
location (str | None)
ancestor_folders (list[ResourceFolderReference] | None)
creation_time (datetime | None)
modification_time (datetime | None)
description (str | None)
type (DocObjectType | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
ancestor_folders:
list[ResourceFolderReference] |None= None¶
-
creation_time:
datetime|None= None¶
-
description:
str|None= None¶
-
id:
str|None= None¶
-
location:
str|None= None¶
-
modification_time:
datetime|None= None¶
-
name:
str|None= None¶
-
owner_id:
str|None= None¶
-
owner_name:
str|None= None¶
-
type:
DocObjectType|None= None¶
- class mstrio.server.documentation.DocumentationStatus(id=None, progress=None, status=None, message=None, i_server_error_code=None)¶
Bases:
DictableDraft representation of documentation execution status.
- Parameters:
id (str | None)
progress (int | None)
status (EnumDocumentationStatus | None)
message (str | None)
i_server_error_code (int | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
i_server_error_code:
int|None= None¶
-
id:
str|None= None¶
-
message:
str|None= None¶
-
progress:
int|None= None¶
-
status:
EnumDocumentationStatus|None= None¶
- enum mstrio.server.documentation.EnumDocumentationStatus(value)¶
Bases:
AutoPascalNameExecution status values for a documentation job.
Used with Documentation and list_documentations to filter or inspect the current state of a documentation job.
Valid values are as follows:
- RUNNING = <EnumDocumentationStatus.RUNNING: 'Running'>¶
- READY = <EnumDocumentationStatus.READY: 'Ready'>¶
- ERROR = <EnumDocumentationStatus.ERROR: 'Error'>¶
- CANCELED = <EnumDocumentationStatus.CANCELED: 'Canceled'>¶
- class mstrio.server.documentation.ResourceFolder(paths=None, objects=None)¶
Bases:
DictableRepresentation of a documentation resource.
Data tree structure:
- Root: ResourceFolder
- paths: ResourceFolderPath
- ancestor_folders: list[ResourceFolderReference]
- Each ancestor folder:
id: str
name: str
- children: ResourceFolderChildren
- child_folders: list[ResourceFolderReference]
- Each child folder reference:
id: str
name: str
- non_folder_child_objects: list[ResourceFolderChildObject]
- Each non-folder child object:
id: str
name: str
type: DocObjectType | None
file_index: str | None
id: str
name: str
- objects: list[ResourceObject]
- Each resource object:
id: str
name: str
type: DocObjectType | None
- Parameters:
paths (ResourceFolderPath | None)
objects (list[ResourceObject] | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
objects:
list[ResourceObject] |None= None¶
-
paths:
ResourceFolderPath|None= None¶
- class mstrio.server.documentation.ResourceFolderChildObject(id=None, name=None, type=None, file_index=None)¶
Bases:
DictableDraft representation of a non-folder child object in a resource.
- Parameters:
id (str | None)
name (str | None)
type (DocObjectType | None)
file_index (str | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
file_index:
str|None= None¶
-
id:
str|None= None¶
-
name:
str|None= None¶
-
type:
DocObjectType|None= None¶
- class mstrio.server.documentation.ResourceFolderChildren(child_folders=<factory>, non_folder_child_objects=<factory>)¶
Bases:
DictableDraft representation of children in a resource folder.
- Parameters:
child_folders (list[ResourceFolderReference])
non_folder_child_objects (list[ResourceFolderChildObject])
- 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
child_folders:
list[ResourceFolderReference]¶
-
non_folder_child_objects:
list[ResourceFolderChildObject]¶
- class mstrio.server.documentation.ResourceFolderPath(ancestor_folders=None, children=None, id=None, name=None)¶
Bases:
DictableDraft representation of folder path metadata in a resource.
- Parameters:
ancestor_folders (list[ResourceFolderReference] | None)
children (ResourceFolderChildren | None)
id (str | None)
name (str | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
ancestor_folders:
list[ResourceFolderReference] |None= None¶
-
children:
ResourceFolderChildren|None= None¶
-
id:
str|None= None¶
-
name:
str|None= None¶
- class mstrio.server.documentation.ResourceFolderReference(id=None, name=None)¶
Bases:
DictableDraft representation of a resource folder reference.
- Parameters:
id (str | None)
name (str | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
id:
str|None= None¶
-
name:
str|None= None¶
- class mstrio.server.documentation.ResourceObject(id=None, name=None, type=None)¶
Bases:
DictableRepresents an object entry within a documentation resource folder.
- Parameters:
id (str | None)
name (str | None)
type (DocObjectType | 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
- classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)¶
Creates an object from a dictionary. The dictionary’s 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 _FROM_DICT_MAP.
- 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, 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:
An object of type T.
- Return type:
T
- to_dict(camel_case=True, whitelist_keys=None, skip_private_keys=False)¶
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.
whitelist_keys (list[str], optional) – List of keys to include in the resulting dictionary. If None, all keys (except hidden ones) are included. Defaults to None.
skip_private_keys (bool, optional) – If True, skips private keys in final dict representation.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
-
id:
str|None= None¶
-
name:
str|None= None¶
-
type:
DocObjectType|None= None¶
- mstrio.server.documentation.get_documentations_statuses(connection, documentations, to_dictionary=False)¶
List statuses for one or more documentation jobs.
- Parameters:
connection (Connection) – Strategy connection object.
documentations (Documentation | str | list[Documentation | str]) – A documentation object, documentation ID, or a list containing documentation objects and/or IDs.
to_dictionary (bool, optional) – If True, returns dictionaries. If False, returns DocumentationStatus objects.
- Returns:
dict[str,DocumentationStatus] |dict[str,dict] – A dictionary keyed by documentation ID with values of DocumentationStatus objects or dictionaries, depending on to_dictionary.- Return type:
dict[str, DocumentationStatus] | dict[str, dict]
- mstrio.server.documentation.list_documentation_definitions(connection, id=None, name=None, sort_by=None, include_embedded=None, tenant=None, tenant_id=None, tenant_name=None, project=None, project_id=None, project_name=None, owner=None, owner_id=None, owner_name=None, date_created=None, last_run=None, offset=None, limit=None, to_dictionary=False)¶
List documentation definitions.
- Parameters:
connection (Connection) – Strategy connection object.
id (str, optional) – Comma-separated list of definition IDs.
name (str, optional) – Expected definition name filter.
sort_by (DocDefinitionSortBy | str, optional) – Sort by field with direction. String values must include a sign prefix where + means ascending and - means descending (for example: +id, -name). Supported fields are id, name, type, projectName, ownerName, dateCreated, lastRun, and size.
include_embedded (bool, optional) – Whether to include embedded definition details in response.
tenant (Tenant | str, optional) – Tenant object, ID, or name used to filter definitions.
tenant_id (str, optional) – Tenant ID used to filter definitions.
tenant_name (str, optional) – Tenant name used to filter definitions.
project (Project | str, optional) – Expected project object, ID, or name filter.
project_id (str, optional) – Expected project ID filter.
project_name (str, optional) – Expected project name filter.
owner (User | str, optional) – Owner object or ID used to filter definitions.
owner_id (str, optional) – Owner ID used to filter definitions.
owner_name (str, optional) – Owner username used to filter definitions.
date_created (str, optional) – Date created filter expression.
last_run (str, optional) – Last run filter expression.
offset (int, optional) – Pagination offset.
limit (int, optional) – Expected maximum number of returned definitions. If None, all available definitions are returned.
to_dictionary (bool, optional) – If True, expected to return dictionaries.
- Returns:
list[DocumentationDefinition] |list[dict] – A list of DocumentationDefinition objects or dictionaries.- Return type:
list[DocumentationDefinition] | list[dict]
- mstrio.server.documentation.list_documentations(connection, definition=None, name=None, status=None, project=None, project_id=None, project_name=None, limit=None, to_dictionary=False)¶
List documentation jobs.
- Parameters:
connection (Connection) – Strategy connection object.
definition (DocumentationDefinition | str, optional) – Documentation definition object or ID used to filter jobs by definition.
name (str, optional) – Documentation name filter.
status (EnumDocumentationStatus | str, optional) – Documentation status filter. Accepts EnumDocumentationStatus or one of: Running, Ready, Error, Canceled.
project (Project | str, optional) – Project object, ID, or name used to scope results.
project_id (str, optional) – Project ID used to scope results.
project_name (str, optional) – Project name used to scope results.
limit (int, optional) – Maximum number of jobs to return. If None, all available jobs are returned.
to_dictionary (bool, optional) – If True, returns raw dictionaries from the API. If False, returns Documentation objects.
- Returns:
list[Documentation] |list[dict] – List of Documentation objects or list of dictionaries, based on to_dictionary.- Return type:
list[Documentation] | list[dict]