### Connect to Strategy I-Server Outside Workstation (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start Connects to the Strategy I-Server using provided URL, username, password, and project name. Requires the mstrio library. Outputs connection status. ```python # Import the necessary class from the mstrio library from mstrio.connection import Connection # Define your server connection details BASE_URL = "https://your-microstrategy-server-url/MicroStrategyLibrary/api" USERNAME = "your-username" PASSWORD = "your-password" PROJECT_NAME = "your-project-name" # Create a connection to the Strategy environment conn = Connection( base_url=BASE_URL, username=USERNAME, password=PASSWORD, project_name=PROJECT_NAME ) # Check connection status print("Connection established:", conn.status()) # Disconnect when done (optional) conn.close() ``` -------------------------------- ### List All SuperCubes (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start Lists all available SuperCubes in the connected MicroStrategy project. Requires the mstrio library and an active connection object. Outputs a list of SuperCube names. ```python # Import necessary classes from mstrio.project_objects.datasets.super_cube import list_super_cubes # List all SuperCubes super_cubes = list_super_cubes(connection=conn) print("Available SuperCubes:") for super_cube in super_cubes: print("- ", super_cube.name) # Disconnect when done (optional) conn.close() ``` -------------------------------- ### Inspect Class Capabilities with what_can_i_do_with (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start Inspects a class in the mstrio-py library to discover its available functionalities, properties, and methods. Requires the mstrio library. No explicit output, but provides information during execution. ```python from mstrio import what_can_i_do_with from mstrio.project_objects.datasets.super_cube import SuperCube # Inspect the SuperCube class what_can_i_do_with(SuperCube) ``` -------------------------------- ### Inspect Instance Capabilities with what_can_i_do_with (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start Inspects an instance of a class to view its usable methods and properties. Requires the mstrio library and an active connection object. No explicit output, but provides information during execution. ```python # Initialize an instance of SuperCube my_super_cube = SuperCube(connection=conn, name="My SuperCube") # The actual call to what_can_i_do_with on the instance is missing in the provided text. # Example: what_can_i_do_with(my_super_cube) ``` -------------------------------- ### Connect to Strategy I-Server Inside Workstation (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start Establishes a connection to the Strategy I-Server from within the Workstation environment using the workstation data object. Requires the mstrio library. Outputs connection status. ```python # Import the necessary class from the mstrio library from mstrio.connection import get_connection # Workstation data obtained from the Strategy Workstation environment is always available # as `workstationData` inside Workstation Scripts Editor. # Get the connection using `get_connection` conn = get_connection(workstation_data=workstationData, project_name="your-project-name") # Check connection status print("Connection from Workstation delegated:", conn.status()) ``` -------------------------------- ### Create Email Subscription (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start Creates an email subscription for distributing reports or data. Requires the mstrio library, an active connection, and specifies recipients, subject, and message. Outputs the subscription ID. ```python # Import necessary classes from mstrio.distribution_services.subscription.email_subscription import EmailSubscription # Create an email subscription email_sub = EmailSubscription.create( connection=conn, name="My Email Subscription", project_name="your-project-name", # Replace with your project name recipients=["some-user-id"], email_subject="Sample Email Subject", email_message="This is a sample email message sent via subscription.", send_now=True, ) print("Email Subscription Created:", email_sub.id) # Disconnect when done (optional) conn.close() ``` -------------------------------- ### Explore mstrio-py Class/Method Capabilities Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc3_quick_start The `what_can_i_do_with` function provides a detailed exploration of a given object, such as a SuperCube. It logs information about the object's name, parameters, docstring, and categorizes its attributes into properties, methods, class methods, and static methods. This utility aids in understanding and effectively using the mstrio-py library. ```python from mstrio.utils.utility import what_can_i_do_with # Example usage with a SuperCube object my_super_cube = "your_super_cube_object" what_can_i_do_with(my_super_cube) ``` -------------------------------- ### Install mstrio-py from Local Wheel File Offline Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc2_installation Installs mstrio-py from a manually downloaded .whl file for offline systems or environments with blacklisted PyPI access. The command uses py -m to invoke Python's pip module and --user flag to install only for the current user. Replace the path placeholder with actual file path. ```shell cd path/where/mstrio/will/be/installed py -m pip install --user path/to/downloaded/wheel/file/mstrio-py.whl ``` -------------------------------- ### Install Latest mstrio-py Package via pip Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc2_installation Installs the latest version of mstrio-py using pip command. This is the standard installation method for users with direct access to PyPI. Run this command in Terminal or Command Prompt. ```shell pip install mstrio-py ``` -------------------------------- ### Install Specific mstrio-py Version via pip Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc2_installation Installs a specific archived version of mstrio-py from PyPI package archive. Useful when you need a particular version for compatibility purposes. Replace the version number as needed. ```shell pip install mstrio-py==10.11.1 ``` -------------------------------- ### Create Fact with Destination Folder Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc5_usage_remarks Demonstrates creating a 'Fact' object using the `Fact.create` method. It shows how to specify the destination folder either as a list of strings or a string path. Ensure a valid connection object and expressions are provided. ```python from mstrio.project_objects.fact import Fact # Example usage with destination_folder as a list fact = Fact.create( connection=conn, name="My Fact", expressions=[...], destination_folder=["MicroStrategy Tutorial", "My Facts"], ) # Example usage with destination_folder_path as a list fact = Fact.create( connection=conn, name="My Fact", expressions=[...], destination_folder_path=["MicroStrategy Tutorial", "My Facts"], ) # Example usage with destination_folder as a string fact = Fact.create( connection=conn, name="My Fact", expressions=[...], destination_folder="MicroStrategy Tutorial/My Facts", ) # Example usage with destination_folder_path as a string fact = Fact.create( connection=conn, name="My Fact", expressions=[...], destination_folder_path="MicroStrategy Tutorial/My Facts", ) ``` -------------------------------- ### List VLDB Settings Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects Lists the current VLDB settings for a project. ```APIDOC ## GET /api/vldb_settings ### Description Lists the current VLDB settings for a project. ### Method GET ### Endpoint /api/vldb_settings ### Parameters #### Query Parameters - **project** (str | None) - Optional - The name or ID of the project for which to list VLDB settings. ### Response #### Success Response (200) - **vldb_settings** (list) - A list of VLDB settings. #### Response Example ```json { "vldb_settings": [ { "name": "Setting1", "value": "Value1" }, { "name": "Setting2", "value": "Value2" } ] } ``` ``` -------------------------------- ### GET /objects/{id}/attribute Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.transformation Get object's attribute by its name. ```APIDOC ## GET /objects/{id}/attribute ### Description Get object's attribute by its name. ### Method GET ### Parameters #### Query Parameters - **name** (str) - Required - The name of the attribute to retrieve ### Return Type Any ``` -------------------------------- ### GET /objects/{id}/acl Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.transformation Get Access Control List (ACL) for the object. Optionally filter ACLs and return as pandas DataFrame or dictionary. ```APIDOC ## GET /objects/{id}/acl ### Description Get Access Control List (ACL) for this object. Optionally filter ACLs by specifying filters. ### Method GET ### Parameters #### Query Parameters - **to_dataframe** (bool, optional) - Optional - If True, return datasets as pandas DataFrame. Defaults to False - **to_dictionary** (bool, optional) - Optional - If True, return datasets as dictionary. Defaults to False - **filters** (dict, optional) - Optional - Additional filters to apply to ACL results ### Response #### Success Response (200) - **acl** (list | DataFrame | dict) - Access Control List in requested format ### Return Type list | DataFrame | dict ``` -------------------------------- ### PackageInfo Initialization in Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Initializes a PackageInfo object with various parameters related to package migration. It accepts parameters like name, creator, dates, type, environment, ID, and status, along with optional fields for replication, storage, project, messages, warnings, progress, deletion status, existence, TOC views, purpose, tree view, and certification. Some parameters are optional and can be None. ```python class PackageInfo( name, creator, creation_date, last_updated_date, type, environment=None, id=None, replicated=None, storage=None, project=None, status=None, message=None, warnings=None, progress=None, deleted=None, existing=None, toc_view=None, purpose=None, tree_view=None, certification=None ): # ... (implementation details) ``` -------------------------------- ### Database Driver Types in mstrio-py Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.datasources Enumerates the different types of database drivers supported by mstrio-py for establishing connections. Includes options like SAP HANA, Snowflake, SQL Server, and more, along with a generic UNKNOWN type. ```python from mstrio.datasources.helpers import DriverType SAP_S4_HANA = DriverType.SAP_S4_HANA_ SEARCH_ENGINE = DriverType.SEARCH_ENGINE_ SERVICEMAX = DriverType.SERVICEMAX_ SERVICENOW = DriverType.SERVICENOW_ SHOPIFY = DriverType.SHOPIFY_ SNOW_FLAKE = DriverType.SNOW_FLAKE_ SPARK_CONFIG = DriverType.SPARK_CONFIG_ SPARK_SQL = DriverType.SPARK_SQL_ SPLUNK = DriverType.SPLUNK_ SQL_SERVER = DriverType.SQL_SERVER_ SQUARE = DriverType.SQUARE_ STARBURST = DriverType.STARBURST_ STRATEGY = DriverType.STRATEGY_ SUGAR_CRM = DriverType.SUGAR_CRM_ SYBASE = DriverType.SYBASE_ SYBASE_IQ = DriverType.SYBASE_IQ_ SYBASE_SQL_ANY = DriverType.SYBASE_SQL_ANY_ TANDEM = DriverType.TANDEM_ TEAMCITY = DriverType.TEAMCITY_ TERADATA = DriverType.TERADATA_ TM1 = DriverType.TM1_ TRINO = DriverType.TRINO_ TWITTER = DriverType.TWITTER_ UNKNOWN = DriverType.UNKNOWN_ URL_AUTH = DriverType.URL_AUTH_ VECTORWISE = DriverType.VECTORWISE_ VERTICA = DriverType.VERTICA_ XQUERY = DriverType.XQUERY_ YELLOWBRICK = DriverType.YELLOWBRICK_ ``` -------------------------------- ### Get Object Attribute by Name (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects.incremental_refresh_report The `get` method retrieves an object's attribute using its name. This is a fundamental operation for accessing object properties within the mstrio-py library. No specific parameters are required beyond the attribute name. ```python object_instance.get('attribute_name') ``` -------------------------------- ### FileSystem - File System Options Class Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.device Represents file system configuration options for device distribution services. This class allows configuration of folder creation, timestamp appending, filename override behavior, and file append options. ```APIDOC ## FileSystem Class ### Description File System Options configuration class for device distribution services. ### Constructor Parameters - **create_folder** (bool) - Optional - Whether to create required folder in the path, default: True - **filename_append_time_stamp** (bool) - Optional - Whether to append timestamp to the file name, default: True - **override_filename** (bool) - Optional - Whether to override filename with same name, default: False - **append_to_file** (bool) - Optional - Whether to append to the file, default: False ### Attributes - **create_folder** (bool) - Whether to create required folder in the path, default: True - **filename_append_time_stamp** (bool) - Whether to append timestamp to the file name, default: True - **override_filename** (bool) - Whether to override filename with same name, default: False - **append_to_file** (bool) - Whether to append to the file, default: False ### Request Example ``` file_system = FileSystem( create_folder=True, filename_append_time_stamp=True, override_filename=False, append_to_file=False ) ``` ### Parent Class Bases: Dictable ``` -------------------------------- ### Get Object Attribute Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.server Retrieves an object's attribute by its name. ```APIDOC ## GET /object/{objectId}/attribute/{attributeName} ### Description Gets an object's attribute by its name. ### Method GET ### Endpoint `/object/{objectId}/attribute/{attributeName}` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. - **attributeName** (string) - Required - The name of the attribute to retrieve. ### Response #### Success Response (200) - **attributeValue** (any) - The value of the requested attribute. #### Response Example ```json { "attributeValue": "Report Name" } ``` ``` -------------------------------- ### POST /api/users Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Creates a new user on the I-Server. This method returns the created User object. ```APIDOC ## POST /api/users ### Description Creates a new user on the I-Server. Returns User object. ### Method POST ### Endpoint /api/users ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **connection** (Connection) - Strategy One connection object returned by connection.Connection() - **username** (str) - username of user - **full_name** (str) - user full name - **password** (str | None) - user password - **description** (str | None) - user description - **enabled** (bool) - specifies if user is allowed to log in - **password_modifiable** (bool) - Specifies if user password can be modified - **password_auto_expire** (bool | None) - specifies if password will expire automatically - **password_expiration_date** (str | datetime | None) - Expiration date of user password either as a datetime or string: “yyyy-MM-dd HH:mm:ss” in UTC - **password_expiration_frequency** (int | None) - frequency of password expiration specified in days - **require_new_password** (bool) - Specifies if user is required to provide a new password. - **standard_auth** (bool) - Specifies whether standard authentication is allowed for user. - **ldapdn** (str | None) - User’s LDAP distinguished name - **trust_id** (str | None) - Unique user ID provided by trusted authentication provider - **database_auth_login** (str | None) - Database Authentication Login - **memberships** (list | None) - specify User Group IDs which User will be member off. - **owner** (User | str | None) - owner of user - **default_timezone** (str | dict | None) - default timezone for user - **language** (str | Language | None) - language for user - **default_email_address** (str | None) - default email address for user - **email_device** (str | Device | None) - ID or Device object of the email device to which the default email address will be assigned. If not provided, the Generic Email will be used ### Request Example ```json { "connection": "", "username": "newuser", "full_name": "New User", "password": "securepassword" } ``` ### Response #### Success Response (200) - **User** (User) - The newly created User object. #### Response Example ```json { "id": "user123", "username": "newuser", "full_name": "New User" } ``` ``` -------------------------------- ### GET /objects/{id}/change_journal Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.transformation Fetch all change journal entries from the API for the object. ```APIDOC ## GET /objects/{id}/change_journal ### Description Fetch change journal entries from the API. ### Method GET ### Response #### Success Response (200) - **entries** (list) - List of change journal entries ### Return Type None ``` -------------------------------- ### Get User Group Settings Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.users_and_groups Retrieves the settings for a User Group from the MicroStrategy I-Server. This function returns the settings as a dictionary. ```python from mstrio.objects import UserGroup # Example usage: # Assuming 'user_group' is an instance of UserGroup # settings = user_group.get_settings() ``` -------------------------------- ### Connection Parameters (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.device The ConnectionParameters class defines settings for establishing connections, including the number of retries, the time between retries in seconds, and the delivery timeout in seconds. It inherits from Dictable, allowing for dictionary-based configuration. ```Python class ConnectionParameters(Dictable): def __init__(self, retries_count=5, seconds_between_retries=3, delivery_timeout_seconds=10): self.retries_count = retries_count self.seconds_between_retries = seconds_between_retries self.delivery_timeout_seconds = delivery_timeout_seconds # ... other methods ... retries_count: int = 5 seconds_between_retries: int = 3 delivery_timeout_seconds: int = 10 ``` -------------------------------- ### Get Object Attribute by Name Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.users_and_groups Retrieves an object's attribute using its name. This is a generic getter for object properties. ```python from mstrio.objects import Entity # Example usage: # Assuming 'my_object' is an instance of Entity or a subclass # attribute_value = my_object.get('name') ``` -------------------------------- ### Create Shortcut Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management Creates a shortcut to an object in a specified target folder and project. ```APIDOC ## POST /api/objects/{objectId}/shortcut ### Description Creates a shortcut to the object in a specified target folder and project. ### Method POST ### Endpoint /api/objects/{objectId}/shortcut ### Parameters #### Path Parameters - **objectId** (str) - Required - The ID of the object for which to create a shortcut. #### Request Body - **target_folder** (Folder | tuple | list | str) - Optional - Folder object or ID or name or path specifying the target folder. Can be used instead of target_folder_id, target_folder_name or target_folder_path. - **target_folder_id** (str) - Optional - ID of the target folder. - **target_folder_name** (str) - Optional - Name of the target folder. - **target_folder_path** (str) - Optional - Path of the target folder (e.g., "/MicroStrategy Tutorial/Public Objects/Metrics"). - **project** (Project | str) - Optional - Project object or ID or name specifying the project. Can be used instead of project_id or project_name. - **project_id** (str) - Optional - ID of the project. - **project_name** (str) - Optional - Name of the project. - **to_dictionary** (bool) - Optional - If True, the response will be a dictionary. Defaults to False. ### Response #### Success Response (200) - **shortcut** (object | dict) - The created shortcut object or a dictionary representation if `to_dictionary` is True. #### Response Example ```json { "shortcut": { "id": "shortcutId", "name": "Shortcut to Object X" } } ``` ``` -------------------------------- ### Get Object Attribute by Name (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.access_and_security Retrieves an object's attribute using its name. ```python def get(self, name): """Get object’s attribute by its name. """ pass ``` -------------------------------- ### POST /objects/create_shortcut Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.transformation Create a shortcut to the object in a specified target folder. Supports multiple ways to specify target folder and project with optional dictionary output format. ```APIDOC ## POST /objects/create_shortcut ### Description Create a shortcut to the object. Supports multiple ways to specify the target folder and project. ### Method POST ### Parameters #### Request Body - **target_folder** (Folder | tuple | list | str, optional) - 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) - Optional - ID of a folder - **target_folder_name** (str, optional) - Optional - Name of a folder - **target_folder_path** (str, optional) - Optional - Path of the folder in format: /MicroStrategy Tutorial/Public Objects/Metrics - **project** (Project | str, optional) - Optional - Project object or ID or name specifying the project - **project_id** (str, optional) - Optional - Project ID - **project_name** (str, optional) - Optional - Project name - **to_dictionary** (bool, optional) - Optional - If True, return a dictionary with the shortcut's properties instead of a Shortcut object. Defaults to False ### Response #### Success Response (200) - **shortcut** (Shortcut | dict) - Shortcut object or dictionary representation ### Return Type Shortcut ``` -------------------------------- ### SchemaManagement Object Initialization (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema Represents the schema management object, requiring a connection and optionally a project, project ID, or project name. It provides access to connection details and project information related to schema management. ```python class SchemaManagement(_connection_, _project=None, _project_id=None, _project_name=None): """ Representation of schema management object. Parameters: connection (Connection): project (Project | str | None): project_id (str | None): project_name (str | None): """ pass ``` -------------------------------- ### Get Cube Caches Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects.datasets Retrieves a list of all caches associated with a specific cube. The return type is a list of 'CubeCache' objects. ```python def get_caches(self) -> list['CubeCache']: """Get list of caches of the cube. Returns: list of caches of the cube """ pass ``` -------------------------------- ### IOSDeviceProperties Initialization in Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.device Initializes an IOSDeviceProperties object used for iPad and iPhone device types. Allows setting application ID, server, port, and certificate details. ```python mstrio.distribution_services.device.device_properties.IOSDeviceProperties(app_id='', server=None, port=None, provider_certificate=None, feedback_service_server=None, feedback_service_port=None) ``` -------------------------------- ### GET /api/objects/list_dependents Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.user_hierarchy Lists the dependents of a given object. This can be used to find objects that directly or indirectly use a specific object. ```APIDOC ## GET /api/objects/list_dependents ### Description Lists the dependents of a given object. This can be used to find objects that directly or indirectly use a specific object. ### Method GET ### Endpoint /api/objects/list_dependents ### Parameters #### Query 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. - **pattern** (integer or enum class object) - Pattern to search for, such as Begin With or Exactly. Default value is CONTAINS (4). - **domain** (integer or enum class object) - Domain where the search will be performed, such as Local or Project. Default value is PROJECT (2). - **scope** (SearchScope, str, optional) - Scope of the search with regard to System Managed Objects. - **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: `/MicroStrategy Tutorial/Public Objects/Metrics` or `/CASTOR_SERVER_CONFIGURATION/Users`. - **class** (object_types, enum class object or integer or list of enum or integers) - Type(s) of object(s) to be searched, such as Folder, Attribute or User. - **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** (list) - Available filter parameters: ['id', 'name', 'description', 'date_created', 'date_modified', 'acg']. ### Request Example ```json { "project": "MicroStrategy Tutorial", "name": "Sales Metric", "class": "METRIC" } ``` ### Response #### Success Response (200) - **dependents** (list) - A list of objects or dictionaries that are dependents of the specified object. #### Response Example ```json { "dependents": [ { "id": "HIJKLMN67890", "name": "Quarterly Sales Report", "type": "REPORT" } ] } ``` ``` -------------------------------- ### Get Object Attribute by Name - Python mstrio Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.server Retrieves an object's attribute value using its name as a string key. ```python get(_name_) # Parameters: # name (str): Attribute name to retrieve ``` -------------------------------- ### Create Fact with Destination Folder as Instance - Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc5_usage_remarks Demonstrates creating a fact and specifying its destination folder using a Folder object instance. Utilizes the 'destination_folder' parameter in the Fact.create method. Requires importing Folder and Fact. Assumes 'conn' is an active connection object. ```python from mstrio.project_objects import Folder from mstrio.modeling.schema.fact.fact import Fact folder = Folder(connection=conn, id="1234QWER6789POIU") fact = Fact.create( connection=conn, name="My Fact", expressions=[...], destination_folder=folder, ) ``` -------------------------------- ### GET /objects/{id}/dependents Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.transformation Check if the object has any dependents. Returns boolean indicating the presence of dependent objects. ```APIDOC ## GET /objects/{id}/dependents ### Description Check if the object has any dependents. ### Method GET ### Response #### Success Response (200) - **has_dependents** (bool) - True if the object has dependents, False otherwise ### Return Type bool ``` -------------------------------- ### UnixWindowsSharity Class Definition (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.device Defines settings for Unix to Windows Sharity. This class inherits from Dictable and accepts parameters for enabling sharity, server username, password, and mount root. ```python class UnixWindowsSharity(Dictable): def __init__(self, sharity_enabled=False, server_username=None, server_password=None, server_mount_root=None): self.sharity_enabled = sharity_enabled self.server_username = server_username self.server_password = server_password self.server_mount_root = server_mount_root # Other methods like to_dict, from_dict would be inherited or defined here ``` -------------------------------- ### Get API Token - Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Retrieves the API token associated with the current user. This token is typically used for authenticating subsequent API requests. ```python get_api_token() Get the API token for the user. Returns: API token for the user. Return type: _str_ ``` -------------------------------- ### List Object Dependencies - Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Lists the dependencies of a MicroStrategy object. Allows searching within a specific project and filtering by object name, pattern, and domain. ```python 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). ``` -------------------------------- ### Get Object Attribute by Name Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects.datasets Retrieves a specific attribute of an object using its name. This method provides direct access to object properties. ```python def get(self, name: str): """Get object’s attribute by its name.""" pass ``` -------------------------------- ### create_shortcut() - Create Object Shortcut Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects Create a shortcut to the object in a specified target folder. Supports multiple ways to specify target folder and project. Can return either a Shortcut object or dictionary representation. ```APIDOC ## create_shortcut() ### Description Create a shortcut to the object. ### Method POST ### Parameters #### Request 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. ### Returns - **Type**: Shortcut - **Description**: Shortcut object or dictionary representation depending on to_dictionary parameter. ### Request Example ``` create_shortcut(target_folder_path='/MicroStrategy Tutorial/Public Objects/Metrics', project_name='MicroStrategy Tutorial') ``` ``` -------------------------------- ### Get Object Attribute by Name Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.security_filter Retrieves an object's attribute using its name. This is a fundamental method for accessing specific properties of a MicroStrategy object. ```python get(_name_) ``` -------------------------------- ### Shortcut Creation API Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects.datasets Enables the creation of shortcuts to existing objects in specified target folders. ```APIDOC ## POST /api/shortcuts ### Description Create a shortcut to an object. This allows for easy access to an object from different locations within the project structure. ### Method POST ### Endpoint /api/shortcuts ### Parameters #### Request Body - **target_folder** (Folder or tuple or list or str, optional) - Folder object or ID or name or path specifying the target folder. May be used instead of `target_folder_id`, `target_folder_name`, or `target_folder_path`. - **target_folder_id** (str, optional) - ID of the target folder. - **target_folder_name** (str, optional) - Name of the target folder. - **target_folder_path** (str, optional) - Path of the target folder. The path has to be provided in the following format: `/MicroStrategy Tutorial/Public Objects/Metrics`. - **project** (Project, optional) - The project where the shortcut will be created. - **project_id** (str, optional) - ID of the project where the shortcut will be created. - **project_name** (str, optional) - Name of the project where the shortcut will be created. - **to_dictionary** (bool, optional) - If True, the shortcut will be returned as a dictionary. Defaults to False. ### Response #### Success Response (200) - **shortcut_id** (str) - The ID of the created shortcut. - **shortcut_details** (dict) - Details of the created shortcut if `to_dictionary` is True. ### Response Example ```json { "shortcut_id": "shortcut123" } ``` ``` -------------------------------- ### Get Object Attribute by Name - Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Retrieves an object's attribute based on its provided name. This is a fundamental method for accessing specific properties of a MicroStrategy object. ```python get(_name_) Get object’s attribute by its name. ``` -------------------------------- ### Create MicroStrategy Shortcut Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.metric Generates a shortcut to a MicroStrategy object in a specified target folder and project. This method allows for flexible specification of the target location using folder objects, IDs, names, or paths, and similarly for the project. ```python existing_object.create_shortcut( target_folder=_target_folder_, target_folder_id=_target_folder_id_, target_folder_name=_target_folder_name_, target_folder_path=_target_folder_path_, project=_project_, project_id=_project_id_, project_name=_project_name_, to_dictionary=_to_dictionary_ ) ``` -------------------------------- ### GET list_properties - Retrieve Object Properties Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.transmitter Fetches all attributes from the server and converts all properties of the object to a dictionary. This method allows selective exclusion of specific properties. ```APIDOC ## GET list_properties ### Description Fetches all attributes from the server and converts all properties of the object to a dictionary with optional property exclusion. ### Method GET ### Parameters #### Query Parameters - **excluded_properties** (list[str]) - Optional - List of object properties to exclude from the returned dictionary. Default: None ### Response #### Success Response (200) - **return** (dict) - Dictionary with object attribute names as keys and attribute values as values ### Response Example ``` { "id": "object_id", "name": "Object Name", "description": "Object Description", "type": "ObjectType", "date_created": "2024-01-01", "date_modified": "2024-01-15", "owner": "Owner Name" } ``` ``` -------------------------------- ### mstrio-py: List Reports with Project Instance Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc5_usage_remarks Demonstrates how to list reports by passing a 'Project' class instance as the project parameter to the 'list_reports' method. Requires an active 'conn' object and the 'mstrio.project' and 'mstrio.project_objects.report' modules. ```python from mstrio.project import Project from mstrio.project_objects.report import list_reports project = Project(connection=conn, name="MicroStrategy Tutorial") reports = list_reports(conn, project=project) ``` -------------------------------- ### List Metrics with Folder as Instance - Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/sections/toc5_usage_remarks Demonstrates how to filter metrics by providing a Folder object instance to the 'folder' parameter in the list_metrics method. Requires importing Folder and list_metrics. Assumes 'conn' is an active connection object. ```python from mstrio.project_objects import Folder from mstrio.modeling.metric.metric import list_metrics folder = Folder(connection=conn, id="1234QWER6789POIU") metrics = list_metrics(connection=conn, folder=folder) ``` -------------------------------- ### Get Object Attribute by Name (Python) Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.table Retrieves an object's attribute using its name. This is a fundamental method for accessing specific properties of a MicroStrategy object. ```python def get(name: str) -> Any: """Get object’s attribute by its name.""" pass ``` -------------------------------- ### Create Shortcut for MicroStrategy Object Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.user_hierarchy Creates a shortcut to a MicroStrategy object in a specified folder or project. Allows for targeting by folder ID, name, or path, and can optionally return a dictionary representation of the shortcut. Dependencies include the mstrio library and potentially pandas if to_dataframe is used. ```python def 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. Returns: Shortcut: Shortcut object or dictionary representation. """ pass ``` -------------------------------- ### Get Object Attribute by Name Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.transmitter Retrieves a specific attribute of an object using its name. This method takes the attribute name as a string argument and returns the value of that attribute. ```python obj.get('name') ``` -------------------------------- ### Get List of Namespaces Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.modeling.schema.table Retrieves a list of namespaces. Optionally, namespaces can be filtered by providing filter parameters such as 'id' or 'name'. Requires a connection object and a datasource ID. ```python mstrio.modeling.schema.table.physical_table.list_namespaces(_connection_ , _id_ , _refresh =None_, _limit =None_, _** filters_) ``` -------------------------------- ### POST /api/users/{userId}/profile-folder Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Creates a profile folder for a specified user. This can be useful for organizing user-specific content. ```APIDOC ## POST /api/users/{userId}/profile-folder ### Description Creates a profile folder for the user. ### Method POST ### Endpoint /api/users/{userId}/profile-folder ### Parameters #### Path Parameters - **userId** (str) - The ID of the user for whom to create the profile folder. #### Query Parameters None #### Request Body - **destination_folder** (Folder | tuple | list | str, optional) - Folder object or ID or name or path specifying the folder where to create object. - **destination_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 ### Request Example ```json { "destination_folder_path": "/MicroStrategy Tutorial/Users/newuser/Profiles" } ``` ### Response #### Success Response (200) - **Folder** (Folder) - The created profile folder. #### Response Example ```json { "id": "folder456", "name": "Profiles", "path": "/MicroStrategy Tutorial/Users/newuser/Profiles" } ``` ``` -------------------------------- ### GET list_translations - List Object Translations Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.distribution_services.transmitter Lists translations for an object across specified languages. Supports filtering by language and flexible return format (Translation objects or dictionaries). ```APIDOC ## GET list_translations ### Description Lists translations for the Object in specified languages with optional format conversion. ### Method GET ### Parameters #### Query Parameters - **languages** (list) - Optional - List of languages to retrieve translations for. Languages can be specified by: - lcid attribute of the language - ID of the language - Language class object - **to_dictionary** (bool) - Optional - If True returns dictionaries, if False returns Translation objects. Default: False ### Response #### Success Response (200) - **return** (list[Translation] | list[dict]) - List of Translation objects or dictionaries representing translations ### Response Example ``` [ { "language": "English", "lcid": 1033, "translation": "Translated Object Name" }, { "language": "Spanish", "lcid": 3082, "translation": "Nombre de Objeto Traducido" } ] ``` ``` -------------------------------- ### List Dependencies - Python Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects Lists the dependencies of a MicroStrategy object. Supports filtering by object name, search pattern, domain, scope, and root folder path. The 'results_format' parameter controls the output format, defaulting to a list of dictionaries. ```python >>> 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_) ``` -------------------------------- ### Get Security Filters by Project Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.object_management.migration Retrieves security filters assigned to a user, optionally filtered by project IDs. Returns a dictionary with project names as keys and lists of security filters as values. ```python # Get security filters for specific projects security_filters = user.list_security_filters(projects=['proj_id_1', 'proj_id_2'], to_dictionary=True) # Parameters: # projects (str or list of str, optional): Project IDs for filtering # to_dictionary (bool): If True returns dicts, else returns objects # Returns: dict with project names as keys and security filters as values ``` -------------------------------- ### Object Creation API Source: https://www2.microstrategy.com/producthelp/Current/mstrio-py/mstrio.project_objects.datasets Provides methods for creating objects, including bulk creation from dictionaries and creating new super cubes. ```APIDOC ## POST /api/objects/bulk ### Description Creates multiple objects from a list of dictionaries. For each dictionary provided, the keys in camel case are changed to the object's attribute names (by default in snake case), and dictionary values are composed into their proper data types such as Enums, lists of Enums, etc., as specified in the object's `FROM_DICT_MAP`. ### Method POST ### Endpoint /api/objects/bulk ### Parameters #### Request Body - **source_list** (List[Dict[str, Any]]) - Required - 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, optional) - If True, class attributes possible to fetch and missing in source will be set as `MissingValue` objects. ### Response #### Success Response (200) - **created_objects** (List[T]) - A list of objects of type T that were created. ### Response Example ```json { "created_objects": [ { ... object 1 ... }, { ... object 2 ... } ] } ``` ## POST /api/cubes/super ### Description Creates a new super cube and initializes the cube object after successful creation. This function does not return a new super cube but updates the object in place. ### Method POST ### Endpoint /api/cubes/super ### Parameters #### Request Body - **folder_id** (str, optional) - ID of the shared folder in which the super cube will be created. If None, defaults to the user's My Reports folder. - **auto_upload** (bool, optional) - If True, automatically uploads the data to the I-Server. If False, simply creates the super cube definition but does not upload data to it. Defaults to True. - **auto_publish** (bool, optional) - If True, automatically publishes the data used to create the super cube definition. If False, simply creates the super cube but does not publish it. To publish the super cube, data has to be uploaded first. Defaults to True. - **chunksize** (int, optional) - Number of rows to transmit to the I-Server with each request when uploading. Defaults to 100000. - **force** (bool, optional) - If True, skip checking if a super cube already exists in the folder with the given name. Defaults to False. - **attribute_forms** (List[SuperCubeAttribute], optional) - A list of instances of `SuperCubeAttribute` which contains mapping of columns to different forms of the same attribute. If not provided, a separate attribute is created for every distinct column name. ### Response #### Success Response (200) - **message** (str) - Confirmation message indicating the super cube was created successfully. ### Response Example ```json { "message": "Super cube created successfully" } ``` ```