mstrio.server package¶
Submodules¶
mstrio.server.calendar module¶
- class mstrio.server.calendar.Calendar(connection: Connection, id: str | None = None, name: str | None = None)¶
Bases:
Entity
,CopyMixin
,DeleteMixin
- alter(name: str | None = None, week_start_day: mstrio.utils.enums.DaysOfWeek | None = None, description: str | None = None, comments: str | None = None, owner: str | mstrio.users_and_groups.user.User | None = None, base_calendar: str | mstrio.server.calendar.Calendar | None = None, table_prefix: str | None = None, calendar_begin_static: int | None = None, calendar_begin_offset: int | None = None, calendar_end_static: int | None = None, calendar_end_offset: int | None = None) None ¶
Alter the calendar’s properties. :param name: Name of the calendar object :type name: str, optional :param week_start_day: First day of the week :type week_start_day: DaysOfWeek, optional :param description: Description of the calendar object :type description: str, optional :param comments: long description of the calendar object :type comments: str, optional :param owner: (str or User, optional): owner of the calendar object :param base_calendar: Reference (ID or Calendar
object) to the base calendar
- Parameters:
table_prefix (str, optional) – Prefix used to create tables in the warehouse
calendar_begin_static (int, optional) – Beginning year for the calendar. Must be provided if and only if calendar_begin_offset is not
calendar_begin_offset (int, optional) – Beginning year for the calendar as an offset from the current year. Must be provided if and only if calendar_begin_static is not
calendar_end_static (int, optional) – Ending year for the calendar. Must be provided if and only if calendar_end_offset is not
calendar_end_offset (int, optional) – Ending year for the calendar as an offset from the current year. Must be provided if and only if calendar_end_static is not
- classmethod create(connection: Connection, name: str, base_calendar: str | mstrio.server.calendar.Calendar, week_start_day: DaysOfWeek, table_prefix: str, description: str | None = None, calendar_begin_static: int | None = None, calendar_begin_offset: int | None = None, calendar_end_static: int | None = None, calendar_end_offset: int | None = None) Calendar ¶
Create a new calendar with the specified properties.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
name (str) – Name of the calendar object
base_calendar (str or Calendar, optional) – Reference (ID or Calendar object) to the base calendar
week_start_day (DaysOfWeek) – First day of the week
table_prefix (str) – Prefix used to create tables in the warehouse. Defaults to an empty string
description (str, optional) – Description of the calendar object
calendar_begin_static (int, optional) – Beginning year for the calendar. Must be provided if and only if calendar_begin_offset is not
calendar_begin_offset (int, optional) – Beginning year for the calendar as an offset from the current year. Must be provided if and only if calendar_begin_static is not
calendar_end_static (int, optional) – Ending year for the calendar. Must be provided if and only if calendar_end_offset is not
calendar_end_offset (int, optional) – Ending year for the calendar as an offset from the current year. Must be provided if and only if calendar_end_static is not
- get_calendar_begin(base_year: int | None) int ¶
- get_calendar_end(base_year: int | None) int ¶
- mstrio.server.calendar.list_calendars(connection: Connection, to_dictionary: bool = False, limit: int | None = None, offset: int | None = None, only_system_calendars: bool | None = None, only_custom_calendars: bool | None = None)¶
List all available calendar objects.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
to_dictionary – If True, returns a list of dicts, otherwise returns a list of Calendar objects
limit (int, optional) – Limit the number of calendars returned
offset (int, optional) – Starting point within the collection of returned results. Used to control paging behavior.
only_system_calendars (bool, optional) – If True, returns only system calendars. Cannot be used with only_custom_calendars
only_custom_calendars (bool, optional) – If True, returns only custom calendars. Cannot be used with only_system_calendars
Returns: A list of calendars as Calendar objects or dicts.
mstrio.server.cluster module¶
- class mstrio.server.cluster.Cluster(connection: Connection)¶
Bases:
object
Manage, list nodes (servers) on a cluster.
Manage Services on nodes. Manage node settings. Load and Unload projects. A “service” is a product developed by Strategy One or a third-party product distributed by Strategy One i.e. “Strategy One Intelligence Server” or “Apache ZooKeeper”.
- add_node(node: str | mstrio.server.node.Node, add_to_cluster_startup: bool = False) None ¶
Add server (node) to the cluster.
- Parameters:
node – name or object of node to be added
add_to_cluster_startup (bool) – if True, the node will be added to the cluster startup membership configuration
- check_dependency(service: str) list[str] ¶
Check all dependencies for the given service.
- Raises:
ValueError – If incorrect service name is provided.
- list_cluster_startup_membership() list[str] ¶
Get a list of I-Server hostnames which are part of cluster startup membership configuration.
- list_node_settings(node: str | mstrio.server.node.Node) dict ¶
List server (nodes) settings.
- Parameters:
node (str | Node) – name or object of node which settings will be listed
- Returns:
dictionary with the settings of node returned from I-Server.
- list_nodes(project: str | Project | None = None, project_name: str | None = None, node: str | mstrio.server.node.Node | None = None, to_dictionary: bool = False) list[mstrio.server.node.Node | dict] ¶
Return a list of nodes and their properties within the cluster.
- Parameters:
project (str, Project, optional) – Project ID or object
project_name (str, optional) – Project name
node (str, optional) – Node name or object
to_dictionary (bool, optional) – If True returns dict, by default (False) returns Node objects
- Returns:
A list of dictionaries representing nodes or a list of Node Objects.
- list_projects(to_dictionary: bool = False, limit: int | None = None, **filters) list['Project'] ¶
Return list of project objects or if to_dictionary=True project dicts. Optionally filter the Projects by specifying the filters keyword arguments.
- Parameters:
to_dictionary – If True returns list of project dicts
limit – limit the number of elements returned. If None, all objects are returned.
**filters – Available filter parameters: [‘name’, ‘id’, ‘description’, ‘date_created’, ‘date_modified’, ‘owner’]
- list_services(group_by: mstrio.server.cluster.GroupBy | str = GroupBy.NODES) list ¶
List services in the cluster grouped by nodes or services.
When group_by is set to nodes then in the list for each node there is given a list of services which are available within. When group_by is set to services then in the list for each service there is given a list of nodes on which current service is available.
- Parameters:
group_by – determine by what the list will be grouped. Either nodes or services.
- Returns:
list of nodes with services in case of group_by set to nodes or list of services with nodes in case of group_by set to services.
- Raises:
ValueError if group_by is neither equal to nodes nor services. –
- load_project(project: str | Project, on_nodes: str | list[str] | None = None) None ¶
Request to load the project onto the chosen cluster nodes. If nodes are not specified, the project will be loaded on all nodes.
- Parameters:
project – name or object of project which will be loaded
on_nodes – name of node or nodes, if not passed, project will be loaded on all of the nodes
- nodes_topology(styled: bool = False) pd.DataFrame | Styler ¶
Return cluster node topology as Pandas DataFrame or Styler object.
- DataFrame columns:
- displayName -> it shows the name with which service is displayed
in Workstation
id -> name of the service within nodes
- for each node in the cluster there is given a column which name is
name of a node and its content is information with the status of the given service in this node. Available values of status are: ‘Running’ (green color), ‘Stopped’ (red color), ‘Not Available’ (service unavailable on the node)
- Returns:
Pandas DataFrame or Styler object if styled is True.
- remove_node(node: str | mstrio.server.node.Node, remove_from_cluster_startup: bool = False) None ¶
Remove server (node) from the cluster.
- Parameters:
node (str | Node) – name or object of node to be removed
remove_from_cluster_startup (bool) – if True, the node will be removed from the cluster startup membership configuration
- reset_node_settings(node: str | mstrio.server.node.Node) None ¶
Remove I-Server configuration settings for given node within a cluster. Default values will be applied after execution of this method.
- Parameters:
node – name of the node for which default settings will be applied.
- services_topology(styled: bool = False) pd.DataFrame | Styler ¶
Return cluster service topology as Pandas DataFrame or Styler object.
- DataFrame columns:
service -> name of the service
- node -> name on which service appears (each service can appear in
more than one service and then name of the service is provided only once for the group of nodes in which it appears)
- status -> status which a given service has on a given node.
Available values of statuses are: ‘Running’ (green color), ‘Stopped’ (red color), ‘Not Available (service unavailable on the node)
- Returns:
Pandas DataFrame or Styler object if styled is True.
- set_primary_node(node: str | mstrio.server.node.Node) None ¶
Set default/primary server (node) for the cluster.
- Parameters:
node (str | Node) – name or object of the node which will be set as default for this cluster
- start(service: str, nodes: list[str], login: str | None = None, passwd: str | None = None)¶
Start up a service on selected nodes.
- Parameters:
service – name of the service which will be started
nodes – list of names of nodes on which service will be started
login – login for SSH operation. If not provided, the user will be prompted.
passwd – password for SSH operation. If not provided, the user will be prompted.
- Raises:
ValueError – If incorrect node/service name is provided
- stop(service: str, nodes: list[str], login: str | None = None, passwd: str | None = None, force: bool = False)¶
Stop a service on selected nodes. Provided service and node names are checked for correctness.
- Parameters:
service – name of the service which will be started
nodes – list of names of nodes on which service will be started
login – login for SSH operation. If not provided, the user will be prompted.
passwd – password for SSH operation. If not provided, the user will be prompted.
force – if True, no additional prompt will be shown before
- Raises:
ValueError – If incorrect node/service name is provided
- unload_project(project: str | Project, on_nodes: str | list[str] | None = None) None ¶
Request to unload the project from the chosen cluster nodes. If nodes are not specified, the project will be unloaded on all nodes. The unload action cannot be performed until all jobs and connections for project are completed. Once these processes have finished, pending project will be automatically unloaded.
- Parameters:
project – name or object of project which will be unloaded
on_nodes – name of node or nodes, if not passed, project will be unloaded on all of the nodes
- update_cluster_startup_membership(nodes: list[str | mstrio.server.node.Node]) None ¶
Update cluster startup membership configuration.
- Parameters:
nodes (list[str | None]) – list of node names which will be set as cluster startup membership.
- update_node_settings(node: str | mstrio.server.node.Node, load_balance_factor: int, initial_pool_size: int, max_pool_size: int) None ¶
Update I-Server configuration settings for a given server node within a cluster.
- Parameters:
node (str | Node) – Name or object of the node to update.
load_balance_factor (int) – This setting becomes relevant in an environment that has a Strategy One Intelligence Server cluster. By default, the load balance factor is 1. The value can be increased on more powerful servers in a cluster to provide an appropriate balance. A larger load balance factor means the current server consumes a greater load in the server cluster in which it resides.
initial_pool_size (int) – Initial number of connections available.
max_pool_size (int) – Maximum number of connections available.
mstrio.server.environment module¶
- class mstrio.server.environment.Environment(connection)¶
Bases:
object
Browse and manage Projects on the environment. List loaded projects, nodes (servers) and compare project settings on the environment. Browse and modify I-Server settings.
- connection¶
A Strategy One connection object.
- server_settings¶
Intelligence Server settings object.
- nodes¶
List of I-Server nodes and their properties.
- node_names¶
List of I-Server node names.
- compare_settings(projects: list[str] | list[mstrio.server.project.Project] = None, show_diff_only: bool = False) DataFrame ¶
Compare project’ settings to the first project in the provided list.
- Parameters:
projects (list of names or project objects, optional) – List of project objects or names to be compared. First element of list is the one to which the rest is compared. If None, all projects on the environment will be compared.
show_diff_only (bool, optional) – Whether to display all settings or only different from first project in list.
- Returns:
Dataframe with values of selected project’ settings.
- create_project(name: str, description: str | None = None, force: bool = False) mstrio.server.project.Project | None ¶
Create a new project on the environment.
- Parameters:
name – Name of Project.
description – Description of Application.
force – If True, overrides the prompt.
- delete_server_element_cache() None ¶
Delete element cache for all projects on the environment.
- delete_server_object_cache() None ¶
Delete object cache for all projects on the environment.
- fetch_settings() None ¶
Fetch the current server settings from the environment.
- fetch_storage_service() None ¶
Fetch the current configuration for Storage Service from the environment.
- is_cluster()¶
- is_loaded(project_id: str | None = None, project_name: str | None = None) bool ¶
Check if project is loaded, by passing project ID or name, returns True or False.
- Parameters:
project_id – Project ID
project_name – Project name
- list_fences(to_dictionary: bool = False, limit: int | None = None, **filters) list[mstrio.server.fence.Fence] | list[dict] ¶
Get list of fences.
- Parameters:
to_dictionary (bool, optional) – If True returns dicts, by default (False) returns objects.
limit (int, optional) – limit the number of elements returned. If None (default), all objects are returned.
**filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘rank’]
- Returns:
A list of content group objects or dictionaries representing them.
- list_loaded_projects(to_dictionary: bool = False, **filters) list[mstrio.server.project.Project] | list[dict] ¶
Return list of all loaded project objects or project dicts if to_dictionary=True that the user has access to. Optionally filter the Projects by specifying the filters keyword arguments.
- Parameters:
to_dictionary – If True, returns list of project dicts
**filters – Available filter parameters: [‘acg’, ‘id’, ‘name’, ‘status’, ‘alias’, ‘description’, ‘date_created’, ‘date_modified’, ‘owner’]
- list_nodes(project: mstrio.server.project.Project | str | None = None, node_name: str | None = None) list[dict] ¶
Return a list of I-Server nodes and their properties. Optionally filter by project or node_name.
- Parameters:
project – ID of project or Project object
node_name – Name of node
- list_projects(to_dictionary: bool = False, limit: int | None = None, **filters) list[mstrio.server.project.Project] | list[dict] ¶
Return list of project objects or project dicts if to_dictionary=True. Optionally filter the Projects by specifying the filters keyword arguments.
- Parameters:
to_dictionary – If True returns list of project dicts.
limit – limit the number of elements returned. If None, all objects are returned.
**filters – Available filter parameters: [‘name’, ‘id’, ‘description’, ‘date_created’, ‘date_modified’, ‘owner’].
- update_settings()¶
Update the current server settings saved in the ServerSettings object.
- update_storage_service(storage_type: mstrio.server.storage.StorageType | None = None, alias: str | None = None, location: str | None = None, s3_region: str | None = None, aws_access_id: str | None = None, aws_secret_key: str | None = None, azure_storage_account_name: str | None = None, azure_secret_key: str | None = None, gcs_service_account_key: str | None = None, skip_validation: bool = False, validate_only: bool = False) None ¶
Update the storage service configuration on the environment. If new values aren’t provided for any parameter, the config stored in the object will be used.
- Parameters:
storage_type (StorageType, optional) – Type of storage service.
alias (str, optional) – Alias of the storage configuration,
location (str, optional) – Storage location, e.g. bucket name for S3, absolute path of folder for File System
s3_region (str, optional) – S3 bucket region
aws_access_id (str, optional) – Access ID for AWS S3
aws_secret_key (str, optional) – Access key for AWS S3
azure_storage_account_name (str, optional) – Account name for Azure
azure_secret_key (str, optional) – Access key for Azure
skip_validation – Whether to skip validation of the storage service configuration prior to updating.
validate_only – If True, validate the configuration without updating.
mstrio.server.fence module¶
- class mstrio.server.fence.Fence(connection: Connection, id: str | None = None, name: str | None = None)¶
Bases:
EntityBase
,DeleteMixin
Python representation of a Strategy One Fence object.
- id¶
ID of the fence.
- Type:
str
- name¶
Name of the fence.
- Type:
str
- rank¶
Rank or precedence of the fence.
- Type:
int
- nodes¶
List of nodes across which the fence is applied.
- Type:
list[str]
- alter(rank: int | None = None, nodes: str | list[str] | None = None, users: User | list[User] | None = None, user_groups: mstrio.users_and_groups.user_group.UserGroup | list[mstrio.users_and_groups.user_group.UserGroup] | None = None, projects: mstrio.server.project.Project | list[mstrio.server.project.Project] | None = None) None ¶
Alter the Fence object.
- Parameters:
rank (int, optional) – Rank or precedence of the fence.
nodes (str | list[str], optional) – List of nodes across which the fence is applied.
users (User | list[User], optional) – List of users, to which the fence is applied.
user_groups (UserGroup | list[UserGroup], optional) – List of user groups, to which the fence is applied.
projects (Project | list[Project], optional) – List of projects, to which the fence is applied.
- classmethod create(connection: Connection, rank: int, name: str, type: FenceType, nodes: str | list[str], users: User | list[User] | None = None, user_groups: mstrio.users_and_groups.user_group.UserGroup | list[mstrio.users_and_groups.user_group.UserGroup] | None = None, projects: mstrio.server.project.Project | list[mstrio.server.project.Project] | None = None) Fence ¶
Create a new Fence.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
rank (int) – Rank or precedence of the fence.
name (str) – Name of the fence.
type (FenceType) – Type of fence.
nodes (str | list[str]) – List of nodes across which the fence is applied.
users (User | list[User], optional) – List of users, to which the fence is applied.
user_groups (UserGroup | list[UserGroup], optional) – List of user groups, to which the fence is applied.
projects (Project | list[Project], optional) – List of projects, to which the fence is applied.
- Returns:
Fence object
- class mstrio.server.fence.FenceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- USER_FENCE = 'user_fence'¶
- WORKLOAD_FENCE = 'workload_fence'¶
- mstrio.server.fence.list_fences(connection: Connection, to_dictionary: bool = False, limit: int | None = None, **filters) list[mstrio.server.fence.Fence] | list[dict] ¶
Get list of fences.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
to_dictionary (bool, optional) – If True returns dicts, by default (False) returns objects.
limit (int, optional) – limit the number of elements returned. If None (default), all objects are returned.
**filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘rank’]
- Returns:
A list of fences objects or dictionaries representing them.
mstrio.server.job_monitor module¶
- class mstrio.server.job_monitor.DeliveryType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- ALL_INCLUDING_SNAPSHOT = 'all_including_snapshot'¶
- ANDROID = 'android'¶
- BLACKBERRY = 'blackberry'¶
- CACHE = 'cache'¶
- CAMPAIGN = 'campaign'¶
- CLIENT = 'client'¶
- COUNT = 'count'¶
- CUSTOM = 'custom'¶
- EMAIL = 'email'¶
- FILE = 'file'¶
- FTP = 'ftp'¶
- INBOX = 'inbox'¶
- IPAD = 'ipad'¶
- IPHONE = 'iphone'¶
- LAST_ONE = 'last_one'¶
- MOBILE = 'mobile'¶
- PRINTER = 'printer'¶
- RESERVED = 'reserved'¶
- SNAPSHOT = 'snapshot'¶
- class mstrio.server.job_monitor.Job(connection: Connection, id: str)¶
Bases:
EntityBase
Python representation of a Job object. Note: Some functionality is missing when working with 11.3.2 I-Server
versions. To use all functionality 11.3.3 and up will be required. There are also some differences between 11.3.2 and 11.3.3+ Job attributes values.
- connection¶
A Strategy One connection object
- id¶
Job information id
- description¶
Description of the job
- status¶
Status of the job
- type¶
Type of the job
- object_id¶
Id of object
- object_name¶
Name of object
- object_type¶
Type of object
- parent_id¶
Parent ID
- childs_ids¶
Array of children IDs
- subscription_recipient¶
Subscription recipient of the job
- subscription_type¶
Subscription delivery type of the job
- processing_unit_priority¶
Job Processing Unit Priority
- step_id¶
Step ID of the job
- user¶
Full name of the job initiator
- user_id¶
ID of the job initiator
- username¶
Username of the job initiator
- project_name¶
Name of the project in which the job is active
- project_id¶
Id of the project in which the job is active
- pu_name¶
Processing Unit name
- creation_time¶
Creation time of the job
- elapsed_time¶
Time elapsed since the creation of the job in milliseconds (11.3.3+) or seconds (11.3.2)
- step_elapsed_time¶
Time elapsed since the creation of the step in milliseconds
- memory_usage¶
Memory usage of the job in bytes
- client_machine¶
Client machine running the job
- total_tasks¶
Total tasks of the job
- completed_tasks¶
Completed tasks of the job
- error_message¶
Error message for the job
- error_time¶
Error time of the job
- filter_name¶
Name of the filter for the job
- sql¶
SQL of the job
- subscription_owner¶
Subscription owner
- template_name¶
Name of the template for the job
- step_statistics¶
Step statistics for the job
- kill() bool ¶
Kill the job.
- Returns:
True if successfully killed job, False otherwise.
- list_properties(excluded_properties: list[str] | None = None) dict ¶
List Job object properties.
- refresh_status() None ¶
Refresh the job status.
- class mstrio.server.job_monitor.JobStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- CACHE_READY = 'cache_ready'¶
- CANCELING = 'canceling'¶
- COMPLETED = 'completed'¶
- DELIVERING = 'delivering'¶
- ERROR = 'error'¶
- EXECUTING = 'executing'¶
- EXPORTING = 'exporting'¶
- LOADING_PROMPT = 'loading_prompt'¶
- READY = 'ready'¶
- RESOLVING_DESTINATION = 'resolving_destination'¶
- STEP_PAUSING = 'step_pausing'¶
- STOPPED = 'stopped'¶
- WAITING = 'waiting'¶
- WAITING_FOR_AUTOPROMPT = 'waiting_for_autoprompt'¶
- WAITING_FOR_CACHE = 'waiting_for_cache'¶
- WAITING_FOR_CHILDREN = 'waiting_for_children'¶
- WAITING_FOR_CONFLICT_RESOLVE = 'waiting_for_conflict_resolve'¶
- WAITING_FOR_DI_FILE = 'waiting_for_di_file'¶
- WAITING_FOR_PROJECT = 'waiting_for_project'¶
- WAITING_FOR_RESULTS = 'waiting_for_results'¶
- WAITING_ON_GOVERNOR = 'waiting_on_governor'¶
- class mstrio.server.job_monitor.JobType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- INTERACTIVE = 'interactive'¶
- PREDICTIVE_CACHE = 'predictive_cache'¶
- SUBSCRIPTION = 'subscription'¶
- class mstrio.server.job_monitor.ObjectType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- CUBE = 'cube'¶
- DASHBOARD = 'dossier'¶
- DOCUMENT = 'document'¶
- OTHERS = 'others'¶
- REPORT = 'report'¶
- class mstrio.server.job_monitor.PUName(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- ANALYTICAL = 'analytical'¶
- BROWSING = 'browsing'¶
- DATA_FORMATTING = 'data_formatting'¶
- NCS = 'ncs'¶
- QUERY_EXECUTIONS = 'query_execution'¶
- RESOLUTION = 'resolution'¶
- REST_ASYNCHRONOUS = 'rest_asynchronous'¶
- SQL_ENGINE = 'sql_engine'¶
- class mstrio.server.job_monitor.SortBy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- COMPLETED_TASKS_ASC = '+completedTasks'¶
- COMPLETED_TASKS_DESC = '-completedTasks'¶
- CREATION_TIME_ASC = '+creationTime'¶
- CREATION_TIME_DESC = '-creationTime'¶
- DESCRIPTION_ASC = '+description'¶
- DESCRIPTION_DESC = '-description'¶
- ELAPSED_TIME_ASC = '+elapsedTime'¶
- ELAPSED_TIME_DESC = '-elapsedTime'¶
- ID_ASC = '+id'¶
- ID_DESC = '-id'¶
- MEMORY_USAGE_ASC = '+memoryUsage'¶
- MEMORY_USAGE_DESC = '-memoryUsage'¶
- OBJECT_ID_ASC = '+objectId'¶
- OBJECT_ID_DESC = '-objectId'¶
- OBJECT_TYPE_ASC = '+objectType'¶
- OBJECT_TYPE_DESC = '-objectType'¶
- PROCESSING_UNIT_PRIORITY_ASC = '+processingUnitPriority'¶
- PROCESSING_UNIT_PRIORITY_DESC = '-processingUnitPriority'¶
- PROJECT_ID_ASC = '+projectId'¶
- PROJECT_ID_DESC = '-projectId'¶
- PROJECT_NAME_ASC = '+projectName'¶
- PROJECT_NAME_DESC = '-projectName'¶
- STATUS_ASC = '+status'¶
- STATUS_DESC = '-status'¶
- SUBSCRIPTION_RECIPIENT_ASC = '+subscriptionRecipient'¶
- SUBSCRIPTION_RECIPIENT_DESC = '-subscriptionRecipient'¶
- SUBSCRIPTION_TYPE_ASC = '+subscriptionType'¶
- SUBSCRIPTION_TYPE_DESC = '-subscriptionType'¶
- TYPE_ASC = '+type'¶
- TYPE_DESC = '-type'¶
- USER_ASC = '+user'¶
- USER_DESC = '-user'¶
- class mstrio.server.job_monitor.SortByV1(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- CREATION_TIME = 'creationTime'¶
- DESCRIPTION = 'description'¶
- JOB_ID = 'jobId'¶
- JOB_TYPE = 'jobType'¶
- OBJECT_ID = 'objectId'¶
- PROJECT_ID = 'projectId'¶
- PROJECT_NAME = 'projectName'¶
- STATUS = 'status'¶
- USER_FULL_NAME = 'userFullName'¶
- class mstrio.server.job_monitor.SubscriptionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
- ALL = 'all'¶
- ALL_INCLUDING_SNAPSHOT = 'all_including_snapshot'¶
- CACHE = 'cache'¶
- CAMPAIGN = 'campaign'¶
- CLIENT = 'client'¶
- COUNT = 'count'¶
- CUSTOM = 'custom'¶
- EMAIL = 'email'¶
- FTP = 'ftp'¶
- INBOX = 'inbox'¶
- LAST_ONE = 'last_one'¶
- MOBILE = 'mobile'¶
- MOBILE_ANDROID = 'mobile_android'¶
- MOBILE_BLACKBERRY = 'mobile_blackberry'¶
- MOBILE_IPAD = 'mobile_ipad'¶
- MOBILE_IPHONE = 'mobile_iphone'¶
- PRINTER = 'printer'¶
- RESERVED = 'reserved'¶
- SNAPSHOT = 'snapshot'¶
- mstrio.server.job_monitor.kill_all_jobs(connection: Connection, user: Optional[Union[User, str]] = None, description: str | None = None, type: mstrio.server.job_monitor.JobType | str | None = None, status: mstrio.server.job_monitor.JobStatus | str | None = None, object_id: str | None = None, object_type: mstrio.server.job_monitor.ObjectType | str | None = None, project: mstrio.server.project.Project | str | None = None, pu_name: mstrio.server.job_monitor.PUName | str | None = None, subscription_type: mstrio.server.job_monitor.SubscriptionType | str | None = None, subscription_recipient: Optional[Union[User, str]] = None, memory_usage: str | None = None, elapsed_time: str | None = None, force: bool = False, **filters) mstrio.helpers.Success | mstrio.helpers.PartialSuccess | mstrio.helpers.MstrException ¶
Kill jobs filtered by passed fields
- Parameters:
connection (object) –
- Strategy One connection object returned by
connection.Connection()
- node(Node, str, optional): Node object or name, if not passed kill jobs
on all nodes
user (User, str, optional) – Field to filter on job owner’s full name
match) ((exact) –
description (str, optional) – Field to filter on job description (partial match)
type (subscription) – Field to filter on job type (exact match),
status (JobStatus, optional) – Field to filter on job status (exact match)
object_id (str, optional) – Field to filter on object id (exact match)
object_type (ObjectType, optional) – Field to filter on object type (exact match)
project (Project, str, optional) – Field to filter on project name (exact match)
pu_name (PUName, optional) – Field to filter on processing unit name (exact match)
subscription_type (SubscriptionType, optional) – Field to filter on
type –
subscription_recipient (User, str, optional) – Field to filter on subscription recipient’s full name (exact match)
memory_usage (str, optional) – Field to filter on the job elapsed time, for example ‘gt:100’ means filtering jobs with memory usage greater than to 100 MB. Valid operators are: gt - greater than lt - less than
elapsed_time (str, optional) – Field to filter on the job elapsed time, for example ‘gt:100’ means filtering jobs with elapsed time greater than 100 milliseconds(11.3.3+) or seconds(11.3.2). Valid operators: gt - greater than lt - less than
force (bool, optional) – Force flag
- Returns:
object if all jobs were killed PartialSuccess: if not all jobs were killed MstrException: otherwise
- Return type:
- mstrio.server.job_monitor.kill_jobs(connection: Connection, jobs: list[Union[mstrio.server.job_monitor.Job, str]]) mstrio.helpers.Success | mstrio.helpers.PartialSuccess | mstrio.helpers.MstrException ¶
Kill existing jobs by Job objects or job ids.
- Parameters:
connection (object) – Strategy One connection object returned by ‘connection.Connection()’
jobs – List of Job objects or job ids to kill
- Returns:
object if all jobs were killed PartialSuccess: if not all jobs were killed MstrException: otherwise
- Return type:
- mstrio.server.job_monitor.list_jobs(connection: Connection, node: mstrio.server.node.Node | str | None = None, user: Optional[Union[User, str]] = None, description: str | None = None, type: mstrio.server.job_monitor.JobType | str | None = None, status: mstrio.server.job_monitor.JobStatus | str | None = None, object_id: str | None = None, object_type: mstrio.server.job_monitor.ObjectType | None = None, project: mstrio.server.project.Project | str | None = None, pu_name: mstrio.server.job_monitor.PUName | str | None = None, subscription_type: mstrio.server.job_monitor.SubscriptionType | str | None = None, subscription_recipient: Optional[Union[User, str]] = None, memory_usage: str | None = None, elapsed_time: str | None = None, sort_by: mstrio.server.job_monitor.SortBy | str | None = None, to_dictionary: bool = False, limit: int | None = None, **filters) list['Job'] | list[dict] ¶
List jobs objects or job dictionaires. :param connection: Strategy One connection object returned by
connection.Connection()
- Parameters:
node (Node, str, optional) – Node object or name, if not passed list jobs on all nodes
user (User, str, optional) – Field to filter on job owner’s full name
match) ((exact) –
description (str, optional) – Field to filter on job description (partial match)
type (subscription) – Field to filter on job type (exact match),
status (JobStatus, optional) – Field to filter on job status (exact match)
object_id (str, optional) – Field to filter on object type (exact match)
object_type (ObjectType, optional) – Field to filter on object type (exact match)
project (Project, str, optional) – Field to filter on project name (exact match)
pu_name (PUName, optional) – Field to filter on processing unit name (exact match)
subscription_type (SubscriptionType, optional) – Field to filter on
type –
subscription_recipient (User, str, optional) – Field to filter on subscription recipient’s full name (exact match)
memory_usage (str, optional) – Field to filter on the job elapsed time, for example ‘gt:100’ means filtering jobs with memory usage greater than to 100 MB. Valid operators are: gt - greater than lt - less than
elapsed_time (str, optional) – Field to filter on the job elapsed time, for example ‘gt:100’ means filtering jobs with elapsed time greater than 100 milliseconds(11.3.3+) or seconds(11.3.2). Valid operators: gt - greater than lt - less than
sort_by (SortBy, optional) – Specify sorting criteria, for example SortBy.STATUS_ASC means sorting status is ascending order or SortBy.USER_DESC means sorting user in descending order. Currently, the server supports sorting only by single field.
to_dictionary (bool, optional) – if True, return Schedules as list of dicts
limit (int, optional) – maximum number of schedules returned
**filters (optional) – Local filter parameters
Examples
>>> list_jobs_v1(connection, duration='gt:100')
- Returns:
list of Job objects or dictionaries.
- Return type:
List[Job] | List[dict]
- mstrio.server.job_monitor.list_jobs_v1(connection: Connection, node: mstrio.server.node.Node | str | None = None, project: mstrio.server.project.Project | str | None = None, status: mstrio.server.job_monitor.JobStatus | str | None = None, job_type: mstrio.server.job_monitor.JobType | str | None = None, user: Optional[Union[User, str]] = None, object_id: str | None = None, sort_by: mstrio.server.job_monitor.SortBy | str | None = None, to_dictionary: bool = False, limit: int | None = None, **filters) list['Job'] | list[dict] ¶
List job objects or job dictionaries. Optionally filter list. NOTE: list_jobs can return up to 1024 jobs per request.
- Parameters:
connection (object) – Strategy One connection object returned by ‘connection.Connection()’
node (Node, str, optional) – Node object or name, if not passed list jobs on all nodes
project (str, Project, optional) – Project id or object to filter by
status (JobStatus, optional) – Job status to filter by
job_type (JobType, optional) – Job type to filter by
user (User, str, optional) – User object or full name to filter by
object_id (str, optional) – Object id to filter by
sort_by (SortBy, optional) – Specifies sorting criteria to sort by
to_dictionary (bool, optional) – if True, return Schedules as list of dicts
limit (int, optional) – maximum number of schedules returned.
**filters –
Available filter parameters:[id, description, status, jobType, duration, jobId, objectd] - duration(str, optional): Field to filter on the job elapsed time,
for example ‘gt:100’ means filtering jobs with elapsed time greater than to 100 seconds. Valid operators: gt - greater than lt - less than
Examples
>>> list_jobs_v1(connection, duration='gt:100')
- Returns:
list of Job objects or dictionaries.
- Return type:
List[Job] | List[dict]
mstrio.server.language module¶
- class mstrio.server.language.Language(connection: Connection, id: str | None = None, name: str | None = None)¶
Bases:
Entity
,DeleteMixin
Python representation of a Strategy One Language object.
- id¶
language’s ID
- Type:
str
- name¶
language’s name
- Type:
str
- base_language_lcid¶
LC ID of the language serving as a base for the language
- Type:
int
- lcid¶
LC ID of the language
- Type:
int
- last_modified¶
date of when language was last modified
- Type:
datetime
- formatting_settings¶
formatting settings of the language
- Type:
- interface_language¶
details of the language’s interface language
- Type:
whether the language is hidden
- Type:
bool
- is_language_supported¶
whether the language is supported
- Type:
bool
- class InterfaceLanguage(name: str, id: str, sub_type: mstrio.types.ObjectSubTypes | None = None)¶
Bases:
Dictable
Object that stores the interface language of the Language.
- name¶
name of the interface language
- Type:
str
- id¶
id of the interface language
- Type:
str
- sub_type¶
subtype of the interface language, defaults to None
- Type:
- id: str¶
- name: str¶
- sub_type: ObjectSubTypes | None = None¶
- class TimeInterval(minutes15: str, minutes30: str, hour: str, day: str, week: str, hour_of_day: str, month: str, quarter: str, year: str)¶
Bases:
Dictable
Object that stores formatting settings of the Language.
- minutes15¶
formatting settings for 15 minutes
- Type:
str
- minutes30¶
formatting settings for 30 minutes
- Type:
str
- hour¶
formatting settings for an hour
- Type:
str
- day¶
formatting settings for a day
- Type:
str
- week¶
formatting settings for a week
- Type:
str
- hour_of_day¶
formatting settings for the hour of the day
- Type:
str
- month¶
formatting settings for a month
- Type:
str
- quarter¶
formatting settings for a quarter
- Type:
str
- year¶
formatting settings for a year
- Type:
str
- Formatting settings instructions:
- To specify formatting for:
hours: use the letter h minutes: use the letter m days: use the letter d months: use the capital letter M quarters: use the letter q years: use the letter y
To specify 12 hour clock use AM/PM afterwards, example: h:mm AM/PM
- Default formatting settings examples:
minutes15: h:mm AM/PM -> 9:44 AM minutes30: h:mm AM/PM -> 9:44 AM hour: h:mm AM/PM -> 9:44 AM day: M/d -> 7/26 week: M/d -> 7/26 hour_of_day: h:mm AM/PM -> 9:44 AM month: MMM -> Jul quarter: qqq -> Q3 year: yyyy -> 2023
- day: str¶
- hour: str¶
- hour_of_day: str¶
- minutes15: str¶
- minutes30: str¶
- month: str¶
- quarter: str¶
- week: str¶
- year: str¶
- alter(name: str | None = None, comments: str | None = None, owner: str | User | None = None, formatting_settings: TimeInterval | None = None) None ¶
Alter the language’s specified properties.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
name (str, Optional) – new name for the Language
comments (str, optional) – long description of the Language
owner – (str, User, optional): owner of the Language object
formatting_settings (TimeInverval, Optional) – new formatting settings for the Language
- classmethod create(connection: Connection, name: str, base_language: Language | str | int, interface_language_id: str | None = None, formatting_settings: TimeInterval | None = None) Language ¶
Create a new language with specified properties.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
name (str) – the name for the new Language
base_language (Language | str | int) –
one of the following: - lcid attribute of the language that will be used as a base
language for the new Language
- ID of the language that will be used as a base language for
the new Language
- Language class object that will be used as a base language for
the new Language
interface_language_id (str, Optional) – id of the new Language’s interface language
formatting_settings (TimeInterval, Optional) – formatting settings for the new Language
- Returns:
Language class object.
- mstrio.server.language.list_interface_languages(connection: Connection, to_dictionary: bool = False) list[mstrio.server.language.Language.InterfaceLanguage] | list[dict] ¶
List all available interface languages.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
to_dictionary – if True returns a list of InterfaceLanguage dicts, otherwise returns a list of InterfaceLanguage objects
Returns: A list of interface languages as dictionaries.
- mstrio.server.language.list_languages(connection: Connection, to_dictionary: bool = False, limit: int | None = None, **filters) list[mstrio.server.language.Language] | list[dict] ¶
Get all languages as a list of Language objects or dictionaries. Optionally filter the languages by specifying filters.
- Parameters:
connection – Strategy One connection object
to_dictionary – if True returns a list of Language dicts, otherwise returns a list of Language objects
limit – limit the number of elements returned. If None (default), all objects are returned.
**filters – Available filter parameters: [‘name’, ‘base_language_lcid’, ‘lcid’, ‘interface_language’, ‘last_modified’, ‘hidden’, ‘is_language_supported’]
mstrio.server.license module¶
- class mstrio.server.license.ActivationInfo(activated: bool, activation_count: int, activation_needed: bool, user_provided_info: dict | None = None, activation_code: str | None = None, deactivation_code: str | None = None, activation_date: str | None = None)¶
Bases:
Dictable
Class that represents license activation information. It contains details about the activation status, activation and deactivation codes, and other related information.
- activated: bool¶
- activation_code: str | None = None¶
- activation_count: int¶
- activation_date: str | None = None¶
- activation_needed: bool¶
- deactivation_code: str | None = None¶
- user_provided_info: dict | None = None¶
- class mstrio.server.license.ContactInformation(department: str, first_name: str, last_name: str, job_title: str, phone: str, email: str, confirm_email: str, address: str, city: str, postal: str, country: str, company: str, use_personal_info: bool = False, state: str | None = None)¶
Bases:
Dictable
Contact information for license management. This class represents contact information required for license operations.
- address: str¶
- city: str¶
- company: str¶
- confirm_email: str¶
- country: str¶
- department: str¶
- email: str¶
- first_name: str¶
- job_title: str¶
- last_name: str¶
- phone: str¶
- postal: str¶
- state: str | None = None¶
- use_personal_info: bool = False¶
- class mstrio.server.license.InstallationUse(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
Enumeration constant indicating installation use
- DEVELOPMENT = 'development'¶
- OTHER = 'other'¶
- PRODUCTION = 'production'¶
- TESTING = 'testing'¶
- TRAINING = 'training'¶
- class mstrio.server.license.License(connection: Connection, node_name: str | None = None)¶
Bases:
Dictable
License class for Strategy license management.
This class provides functionality to manage Strategy licenses, including: - Retrieving license information - Registering new license keys - Activating and deactivating licenses - Managing activation requests - Generating and downloading activation XML files
- bypass_audit¶
Flag indicating if audit functionality is bypassed.
- Type:
bool
- bypass_cpu_controls¶
Flag indicating if CPU controls are bypassed.
- Type:
bool
- contract_id¶
The contract ID of the license.
- Type:
str
- disable_activation¶
Flag indicating if activation is disabled.
- Type:
bool
- enable_daily_report¶
Flag indicating if daily reporting is enabled.
- Type:
bool
- enable_key_level_evaluation¶
Flag for key level evaluation.
- Type:
bool
- installation_version¶
Version of the installation.
- Type:
str
- internal¶
Flag indicating if the license is internal.
- Type:
bool
- issue_date¶
Date when the license was issued.
- Type:
str
- license_key_group¶
License key group information.
- Type:
str
- machine_info¶
Information about the machine where license is installed.
- Type:
- platform¶
Platform information for the license.
- Type:
str
- pre_release¶
Flag indicating if it’s a pre-release version.
- Type:
bool
- products¶
List of products included in the license.
- Type:
list
- register_date¶
Date when the license was registered.
- Type:
str
- registration_disabled¶
Flag indicating if registration is disabled.
- Type:
bool
- status¶
Current status of the license.
- Type:
str
- edition¶
Edition of the license.
- Type:
str
- cpu_allowance¶
CPU allowance for the license.
- Type:
int
- AWS¶
Flag indicating if it’s an AWS installation.
- Type:
bool
- act_aware_products¶
List of activation aware products.
- Type:
list
- DSI¶
Flag indicating if DSI is enabled.
- Type:
bool
- installation_type¶
Type of installation.
- Type:
str
- enabled_poc¶
Flag indicating if PoC is enabled.
- Type:
bool
- key¶
License key.
- Type:
str
- v_cpus¶
Number of virtual CPUs.
- Type:
int
- activation_info¶
Information about license activation.
- Type:
- activate(activation_code: str) None ¶
Activate the license.
- Parameters:
activation_code – Activation code. To obtain the activation code you need to upload xml activation file on the Strategy licensing site.
- deactivate() None ¶
Deactivate the license.
- fetch() None ¶
Fetch the current license information from the environment.
- get_activation_info() ActivationInfo ¶
Get information about the license activation.
- Returns:
ActivationInfo object with license activation details.
- get_activation_xml_file(save_path: str) None ¶
Get the activation XML file to upload to the Strategy licensing site.
- Parameters:
save_path (str) – Path where the XML file will be saved. Must end with ‘.xml’.
- Raises:
ValueError – If save_path doesn’t end with ‘.xml’ or if there’s an error saving the file.
- list_details() dict ¶
Return a dictionary with license details.
- Returns:
Dictionary with license details excluding products information.
- list_products(module: str = 'intelligence_module') list ¶
Return a list of licensed products. :param module: Module name to filter products list.
Default is ‘intelligence_module’, input ‘all’ to get list of products in every module.
- Returns:
List of licensed products.
- list_properties() dict ¶
Return a dictionary with all license properties.
- Returns:
Dictionary with all license properties.
- register_new_key(key: str) None ¶
Register a new license key. After registering a new key, the server must be restarted to apply the changes.
- Parameters:
key (str) – License key to register.
- update_activation_request_information(location: str, installation_use: InstallationUse, customer_contact: mstrio.server.license.ContactInformation | dict | str, employee_of_licensed_company: bool = True, installer_contact: mstrio.server.license.ContactInformation | dict | str | None = None) None ¶
Update activation request information for the license.
- Parameters:
location (str) – Physical location of the installation.
installation_use (InstallationUse) – Purpose of the installation (development, testing, production, training, or other).
customer_contact (ContactInformation | dict | str) – Contact information of the customer. Can be a ContactInformation object, dictionary or path to a file (JSON or CSV).
employee_of_licensed_company (bool) – Whether the person performing installation is an employee of licensed company or not. If False, installer_contact must be provided.
installer_contact (ContactInformation | dict | str, optional) – Contact information of the installer. Can be a ContactInformation object, dictionary or path to a file (JSON or CSV). Required when employee_of_licensed_company is False.
- class mstrio.server.license.MachineInfo(cpu_speed: str, cpu_type: str, OS: str, host_id: str, kernel_release: str, machine_name: str, num_physical_cpus: int, system_language: str)¶
Bases:
Dictable
Class representing system hardware and operating system information for a machine.
- OS: str¶
- cpu_speed: str¶
- cpu_type: str¶
- host_id: str¶
- kernel_release: str¶
- machine_name: str¶
- num_physical_cpus: int¶
- system_language: str¶
- class mstrio.server.license.Product(count: int, duration: int, id: int, name: str, period: int, type: str, module: str)¶
Bases:
object
Class encapsulating details about a licensed product within the Strategy ecosystem.
- count: int¶
- duration: int¶
- id: int¶
- module: str¶
- name: str¶
- period: int¶
- type: str¶
mstrio.server.node module¶
- class mstrio.server.node.Node(name: str | None = None, address: str | None = None, service_control: bool | None = None, port: int | None = None, status: str | None = None, load: int | None = None, projects: list[mstrio.server.project.Project] | None = None, default: bool | None = None)¶
Bases:
Dictable
- address: str | None = None¶
- default: bool | None = None¶
- classmethod from_dict(source: dict, connection: Connection | None = None)¶
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, 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
- load: int | None = None¶
- name: str | None = None¶
- port: int | None = None¶
- projects: list[mstrio.server.project.Project] | None = None¶
- service_control: bool | None = None¶
- status: str | None = None¶
- class mstrio.server.node.Service(id: str, service: str, port: int, status: str, tags: dict | None = None, output: str | None = None)¶
Bases:
Dictable
- id: str¶
- output: str | None = None¶
- port: int¶
- service: str¶
- status: str¶
- tags: dict | None = None¶
- class mstrio.server.node.ServiceWithNode(node: str, address: str, id: str, service_control: bool, port: int, status: str, service_address: str, tags: dict | None = None, output: str | None = None)¶
Bases:
Dictable
- address: str¶
- id: str¶
- node: str¶
- output: str | None = None¶
- port: int¶
- service_address: str¶
- service_control: bool¶
- status: str¶
- tags: dict | None = None¶
mstrio.server.project module¶
- class mstrio.server.project.IdleMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
Used to specify the exact behaviour of idle request.
- REQUEST (Request Idle): all executing and queued jobs finish executing
and any newly submitted jobs are rejected.
- EXECUTION (Execution Idle for All Jobs): all executing, queued, and
newly submitted jobs are placed in the queue, to be executed when the project resumes.
- WAREHOUSEEXEC (Execution Idle for Warehouse jobs): all executing,
queued, and newly submitted jobs that require SQL to be submitted to the data warehouse are placed in the queue, to be executed when the project resumes. Any jobs that do not require SQL to be executed against the data warehouse are executed.
- FULL (Request Idle and Execution Idle for All jobs): all executing and
queued jobs are canceled, and any newly submitted jobs are rejected.
- PARTIAL (Request Idle and Execution Idle for Warehouse jobs): all
executing and queued jobs that do not submit SQL against the data warehouse are canceled, and any newly submitted jobs are rejected. Any currently executing and queued jobs that do not require SQL to be executed against the data warehouse are executed.
- EXECUTION = 'exec_idle'¶
- FULL = 'partial_idle'¶
- LOADED = 'loaded'¶
- LOADED_PENDING = 'loaded_pending'¶
- PARTIAL = 'full_idle'¶
- PENDING = 'pending'¶
- REQUEST = 'request_idle'¶
- UNKNOWN = 'unknown'¶
- UNLOADED = 'unloaded'¶
- UNLOADED_PENDING = 'unloaded_pending'¶
- WAREHOUSEEXEC = 'wh_exec_idle'¶
- class mstrio.server.project.LockType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
Enum representing the type of lock applied to a project.
- TEMPORAL_INDIVIDUAL: A temporary lock that restricts all other sessions
except the current user’s session from editing the project. This lock disappears when the user’s session expires.
- TEMPORAL_CONSTITUENT: A temporary lock that restricts all other sessions
except the current user’s session from editing the project and all objects in the project. This lock disappears when the user’s session expires.
- PERMANENT_INDIVIDUAL: A permanent lock that prevents all users from
editing the project. This lock does not expire and must be removed before the project can be edited again.
- PERMANENT_CONSTITUENT: A permanent lock that prevents all users from
editing the project and all objects in the project. This lock does not expire and must be removed before the project and its objects can be edited again.
- NOT_LOCKED: Represents the state where the project is not locked
and can be edited by users.
- NOT_LOCKED = 'not_locked'¶
- PERMANENT_CONSTITUENT = 'permanent_constituent'¶
- PERMANENT_INDIVIDUAL = 'permanent_individual'¶
- TEMPORAL_CONSTITUENT = 'temporal_constituent'¶
- TEMPORAL_INDIVIDUAL = 'temporal_individual'¶
- class mstrio.server.project.Project(connection: Connection, name: str | None = None, id: str | None = None)¶
Bases:
Entity
,ModelVldbMixin
,DeleteMixin
Object representation of Strategy One Project (Project) object.
- connection¶
A Strategy One connection object
- settings¶
Project settings object
- id¶
Project ID
- name¶
Project name
- description¶
Project description
- alias¶
Project alias
- type¶
Object type
- subtype¶
Object subtype
- ext_type¶
Object extended type
- nodes¶
List of nodes on which project is loaded
- date_created¶
Creation time, “yyyy-MM-dd HH:mm:ss” in UTC
- date_modified¶
Last modification time, “yyyy-MM-dd
- version¶
Version ID
- owner¶
owner ID and name
- acg¶
Access rights (See EnumDSSXMLAccessRightFlags for possible values)
- acl¶
Object access control list
- status¶
Project
- ancestors¶
List of ancestor folders
- data_language_settings¶
Project data language settings
- metadata_language_settings¶
Project metadata language settings
- class LockStatus(lock_type: LockType, lock_time: datetime.datetime | None = None, comment: str | None = None, machine_name: str | None = None, owner: User | None = None)¶
Bases:
Dictable
Object representation of Project Lock Status.
- lock_type¶
Lock type
- lock_time¶
Lock time
- Type:
datetime.datetime | None
- comment¶
Lock comment
- Type:
str | None
- machine_name¶
Machine name
- Type:
str | None
- comment: str | None = None¶
- lock_time: datetime.datetime | None = None¶
- machine_name: str | None = None¶
- add_datasource(datasources: list['DatasourceInstance | str']) list['DatasourceInstance'] ¶
Add datasources to the project.
- Parameters:
datasources (list["DatasourceInstance", str]) – List of datasource objects or datasource IDs to be added to the project.
- Returns:
List of datasource objects for the project.
- alter(name: str | None = None, description: str | None = None, comments: str | None = None, owner: str | User | None = None, alias: str | None = None) None ¶
Alter project name or/and description.
- Parameters:
name (str, optional) – new name of the project.
description (str, optional) – new description of the project.
comments (str, optional) – long description of the project.
owner – (str, User, optional): owner of the project.
alias (str, optional) – new alias of the project.
- delete() bool ¶
Delete project.
- Returns:
True if project was deleted, False otherwise.
- delete_element_cache() None ¶
Delete element cache for the current project on the I-Server.
- delete_object_cache() None ¶
Delete object cache for the current project on the I-Server.
- disable_caching() None ¶
Disable caching settings for the current project on the I-Server.
- enable_caching() None ¶
Enable caching settings for the current project on the I-Server.
- fetch_settings() None ¶
Fetch the current project settings from the I-Server.
- get_current_engine_version()¶
- get_data_engine_versions() dict ¶
Fetch the currently available data engine versions for project.
- get_status_on_node(node: str | Node) IdleMode ¶
Get status of the project of specific node in the connected Intelligence server cluster.
- idle(on_nodes: str | list[str] | None = None, mode: mstrio.server.project.IdleMode | str = IdleMode.REQUEST) None ¶
Request to idle a specific cluster node. Idle project with mode options.
- Parameters:
on_nodes – Name of node, if not passed, project will be idled on all of the nodes.
mode – One of: IdleMode values.
- is_loaded() bool ¶
Check if the project is loaded on any node (server).
- list_caching_settings() dict ¶
Fetch current project settings connected with caching from I-Server
- load(on_nodes: str | list[str] | Node | list[Node] | None = None) None ¶
Request to load the project onto the chosen cluster nodes. If nodes are not specified, the project will be loaded on all nodes.
- Parameters:
on_nodes – Name of node, if not passed, project will be loaded on all of the nodes.
- lock(lock_type: str | mstrio.server.project.LockType, lock_id: str | None = None) None ¶
Lock the project.
- Parameters:
lock_type (str, LockType) – Lock type.
lock_id (str, optional) – Lock ID.
- register(on_nodes: str | list | None = None) None ¶
Register project on nodes.
A registered project will load on node (server) startup.
- Parameters:
on_nodes – Name of node, if not passed, project will be loaded on all available nodes on startup.
- remove_datasource(datasources: list['DatasourceInstance | str']) None ¶
Remove datasources from the project.
- Parameters:
datasources (list["DatasourceInstance", str]) – List of datasource objects or datasource IDs to be removed from the project.
- resume(on_nodes: str | list[str] | None = None) None ¶
Request to resume the project on the chosen cluster nodes. If nodes are not specified, the project will be loaded on all nodes.
- Parameters:
on_nodes – Name of node, if not passed, project will be resumed on all of the nodes.
- unload(on_nodes: str | list[str] | Node | list[Node] | None = None) None ¶
Request to unload the project from the chosen cluster nodes. If nodes are not specified, the project will be unloaded on all nodes. The unload action cannot be performed until all jobs and connections for project are completed. Once these processes have finished, pending project will be automatically unloaded.
- Parameters:
on_nodes – Name of node, if not passed, project will be unloaded on all of the nodes.
- unlock(lock_type: str | mstrio.server.project.LockType | None = None, lock_id: str | None = None, force: bool = False) None ¶
Unlock the project.
- Parameters:
lock_type (str, LockType, optional) – Lock type. Optional only if force is set to True.
lock_id (str, optional) – Lock ID.
force (bool, optional) – Whether to force unlock the project.
- unregister(on_nodes: str | list | None = None) None ¶
Unregister project on nodes.
An unregistered project will not load on node (server) startup.
- Parameters:
on_nodes (str or list, optional) – Name of node, if not passed, project will not be loaded on any nodes on startup.
- update_data_engine_version(new_version: str) None ¶
Update data engine version for project.
- update_settings() None ¶
Update the current project settings on the I-Server.
- class mstrio.server.project.ProjectSettings(connection: Connection, project_id: str | None = None)¶
Bases:
BaseSettings
Object representation of Strategy One Project (Project) Settings.
Used to fetch, view, modify, update, export to file, import from file and validate Project settings.
The object can be optionally initialized with connection and project_id, which will automatically fetch the current settings for the specified project. If not specified, settings can be loaded from file using import_from() method. Object attributes (representing settings) can be modified manually. Lastly, the object can be applied to any project using the update() method.
- connection¶
A Strategy One connection object
- disable_caching() None ¶
—————— WORK IN PROGRESS ——————
This functionality is a work-in-progress. Use it only if you understand the underlying code. It may change in future updates.
Disable caching settings for the current project on I-Server using this Settings object
- enable_caching() None ¶
—————— WORK IN PROGRESS ——————
This functionality is a work-in-progress. Use it only if you understand the underlying code. It may change in future updates.
Enable caching settings for the current project on I-Server using this Settings object
- fetch(project_id: str | None = None) None ¶
Fetch current project settings from I-Server and update this ProjectSettings object.
- Parameters:
project_id – Project ID
- list_caching_properties(show_description: bool = False) dict ¶
—————— WORK IN PROGRESS ——————
This functionality is a work-in-progress. Use it only if you understand the underlying code. It may change in future updates.
Fetch current project settings connected with caching from I-Server
- Args:
- show_description (bool): if True return, description and value
for each setting, else, return values only
- update(project_id: str | None = None) None ¶
Update the current project settings on I-Server using this Settings object.
- Parameters:
project_id – Project ID
- class mstrio.server.project.ProjectStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
IntEnum
- ACTIVE = 0¶
- ERRORSTATE = -3¶
- EXECIDLE = 1¶
- FULLIDLE = 7¶
- OFFLINE = -1¶
- OFFLINEPENDING = -2¶
- ONLINEPENDING = -4¶
- REQUESTIDLE = 2¶
- WHEXECIDLE = 4¶
- mstrio.server.project.compare_project_settings(projects: list[mstrio.server.project.Project], show_diff_only: bool = False) DataFrame ¶
Compares settings of project objects.
- Parameters:
projects (List[Project]) – List of project objects to compare.
show_diff_only (bool, optional) – Whether to display all settings or only different from first project in list.
- mstrio.server.project.list_projects(conn: Connection | Environment | None = None, env: Environment | None = None, *args, **kwargs)¶
Return list of project objects or project dicts if to_dictionary=True. Optionally filter the Projects by specifying the filters keyword arguments.
This is a helper method using Environment.list_projects() under the hood. See Environment.list_projects() documentation for more details.
Either conn or env must be provided.
- mstrio.server.project.conn¶
A Strategy One connection object.
- Type:
Connection, optional
- mstrio.server.project.env¶
Environment object instance.
- Type:
Environment, optional
- ...
Additional parameters to pass to Environment.list_projects().
- Type:
optional
mstrio.server.project_languages module¶
- class mstrio.server.project_languages.CurrentMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
AutoName
Enum that specify a Current Mode for Data Internationalization.
- CONNECTION = 'connection'¶
- NONE = 'none'¶
- SQL = 'sql'¶
- class mstrio.server.project_languages.DataLanguageSettings(default_language: DataLocalizationLanguage, current_mode: CurrentMode, languages: list[mstrio.server.project_languages.DataLocalizationLanguage])¶
Bases:
Dictable
Object that specify a Data Language Settings for a Project.
- default_language¶
Default language for the Project.
- Type:
- current_mode¶
Current mode for data internationalization.
- Type:
- languages¶
List of languages for the Project.
- Type:
list[DataLocalizationLanguage]
- add_language(languages: list[mstrio.server.project_languages.DataLocalizationLanguage]) None ¶
Adds languages to the Project.
- Parameters:
languages (list[DataLocalizationLanguage]) – list of languages to be added to the Project
- alter_current_mode(mode: str | mstrio.server.project_languages.CurrentMode) None ¶
Alters the current mode for data internationalization
- Parameters:
mode (str | CurrentMode) –
mode for data internationalization Available values:
none | CurrentMode.NONE
sql | CurrentMode.SQL
connection | CurrentMode.CONNECTION
- alter_default_language(language: str | mstrio.server.project_languages.DataLocalizationLanguage) None ¶
Alters the default language used by data internationalization
- Parameters:
language (str | DataLocalizationLanguage) – Language or it’s ID to be set as default.
- alter_language(languages: list[mstrio.server.project_languages.DataLocalizationLanguage], path: str) None ¶
Alters languages for the Project.
- Parameters:
languages (list[DataLocalizationLanguage]) – list of languages to be altered for the Project
path (str) – path to target where operation will be performed
values (Available) –
column
table
connectionId
- current_mode: CurrentMode¶
- default_language: DataLocalizationLanguage¶
- languages: list[mstrio.server.project_languages.DataLocalizationLanguage]¶
- remove_language(languages: list[mstrio.server.project_languages.DataLocalizationLanguage]) None ¶
Removes languages from the Project.
- Parameters:
languages (list[DataLocalizationLanguage]) – list of languages to be removed from the Project
- to_dict(camel_case: bool = True) dict ¶
Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.
- Parameters:
camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
- class mstrio.server.project_languages.DataLocalizationLanguage(id: str, name: str | None = None, column: str | None = None, table: str | None = None, connection_id: str | None = None)¶
Bases:
SimpleLanguage
Object that specify a Data Localization Language.
- id¶
ID of the language.
- Type:
str
- name¶
Name of the language.
- Type:
str, optional
- column¶
Column name for the language.
- Type:
str, optional
- table¶
Table name for the language.
- Type:
str, optional
- connection_id¶
Connection ID for the language.
- Type:
str, optional
- column: str | None = None¶
- connection_id: str | None = None¶
- table: str | None = None¶
- class mstrio.server.project_languages.MetadataLanguageSettings(default: SimpleLanguage, languages: list[mstrio.server.project_languages.SimpleLanguage])¶
Bases:
Dictable
Object that specify a Metadata Language Settings for a Project.
- default¶
Default language for the Project.
- Type:
- languages¶
List of languages for the Project.
- Type:
list[SimpleLanguage]
- add_language(languages: list[mstrio.server.project_languages.SimpleLanguage]) None ¶
Adds languages to the Project.
- Parameters:
languages (list[SimpleLanguage]) – list of languages to be added to the Project
- default: SimpleLanguage¶
- languages: list[mstrio.server.project_languages.SimpleLanguage]¶
- remove_language(languages: list[mstrio.server.project_languages.SimpleLanguage]) None ¶
Removes languages from the Project.
- Parameters:
languages (list[SimpleLanguage]) – list of languages to be removed from the Project
- to_dict(camel_case: bool = True) dict ¶
Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.
- Parameters:
camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.
- Returns:
- A dictionary representation of object’s attributes and values.
By default, the dictionary keys are in camel case.
- Return type:
dict
mstrio.server.server module¶
- class mstrio.server.server.ServerSettings(connection: Connection)¶
Bases:
BaseSettings
Object representation of Strategy One I-Server Settings.
Used to fetch, view, modify, update, export to file, import from file and validate Server settings.
The object can be optionally initialized with connection, which will automatically fetch the current I-Server settings. If not specified, settings can be loaded from file using import_from() method. Object attributes (representing settings) can be modified manually. Lastly, the object can be applied to any project using the update() method.
- settings¶
settings_value
- fetch() None ¶
Fetch current I-Server settings and update this ServerSettings object.
- update() None ¶
Update the current I-Server settings using this ServerSettings object.
mstrio.server.setting_types module¶
- class mstrio.server.setting_types.CacheEncryptionLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Cache encryption level on disk
- HIGH = 2¶
- LOW = 1¶
- NONE = 0¶
- class mstrio.server.setting_types.CompressionLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Level of File | Email | FTP delivery compression
- HIGH = 9¶
- LOW = 3¶
- MEDIUM = 6¶
- OFF = 0¶
- class mstrio.server.setting_types.DisplayEmptyReportMessageInRWD(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Display mode for empty Grid/Graphs in documents
- DISPLAY_MESSAGE_IN_DOCUMENT_GRIDS = -1¶
- HIDE_DOCUMENT_GRID = 0¶
- class mstrio.server.setting_types.FailedCacheCreation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.FailedEmailDelivery(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_EMAIL_ADDRESS = 'email_address'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.FailedFTPDelivery(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- FILE_LOCATION = 'file_location'¶
- LINK_TO_FILE = 'link_to_file'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.FailedFileDelivery(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- FILE_LOCATION = 'file_location'¶
- LINK_TO_FILE = 'link_to_file'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.FailedHistoryListDelivery(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- LINK_TO_HISTORY_LIST = 'link_to_history_list'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.FailedMobileDelivery(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.FailedPrinterDelivery(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
- DELIVERY_DATE = 'date'¶
- DELIVERY_ERROR_MESSAGE = 'error_message'¶
- DELIVERY_STATUS = 'delivery_status'¶
- DELIVERY_TIME = 'time'¶
- PRINTER_NAME = 'printer_name'¶
- SUBSCRIPTION_DELIVERY_METHOD = 'delivery_method'¶
- SUBSCRIPTION_NAME = 'subscription_name'¶
- SUBSCRIPTION_OWNER_NAME = 'owner_name'¶
- SUBSCRIPTION_PROJECT_NAME = 'project_name'¶
- SUBSCRIPTION_RECIPIENT_NAME = 'recipient_name'¶
- SUBSCRIPTION_REPORT_OR_DOCUMENT_NAME = 'report_document_name'¶
- SUBSCRIPTION_SCHEDULE = 'schedule'¶
- class mstrio.server.setting_types.MergeSecurityFilters(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Rules to merge multiple Security Filters across user groups and users
- INTERSECT = 3¶
- UNION = 0¶
- class mstrio.server.setting_types.OrderMultiSourceDBI(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Rules to order multi-source Database Instances
- MULTISOURCE_DEFAULT_ORDERING = 0¶
- PROJECT_LEVEL_DATABASE_ORDERING = 1¶
- class mstrio.server.setting_types.ShowBaseViewInLibrary(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Always open dashboards/documents with the last saved view in Library
- DEFAULT = 'use_inherited_value'¶
- NO = 'no'¶
- YES = 'yes'¶
- class mstrio.server.setting_types.SmartMemoryUsageForIntelligenceServer(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum
Smart Memory Usage for Intelligence Server
- APPLY_BEST_STRATEGY = 0¶
- DISABLE_THE_CAPABILITY = 2¶
- ENABLE_THE_CAPABILITY = 3¶
- TURN_OFF_THE_CAPABILITY_WITHOUT_EXCEPTIONS = 1¶
- USE_INHERITED_VALUE = -1¶
mstrio.server.storage module¶
- class mstrio.server.storage.StorageService(type: StorageType = StorageType.UNSET, alias: str | None = None, location: str | None = None, s3_region: str | None = None, aws_access_id: str | None = None, aws_secret_key: str | None = None, azure_storage_account_name: str | None = None, azure_secret_key: str | None = None, gcs_service_account_key: str | None = None, configured: bool = False)¶
Bases:
Dictable
StorageService configuration of environment. .. attribute:: type
Type of storage (e.g. file system, S3)
- type:
StorageType
- alias¶
Alias of the storage configuration,
- Type:
str, optional
- location¶
Storage location, e.g. bucket name for S3, absolute path of folder for File System
- Type:
str, optional
- s3_region¶
S3 bucket region
- Type:
str, optional
- aws_access_id¶
Access ID for AWS S3
- Type:
str, optional
- aws_secret_key¶
Access key for AWS S3
- Type:
str, optional
- azure_storage_account_name¶
Account name for Azure
- Type:
str, optional
- azure_secret_key¶
Access key for Azure
- Type:
str, optional
- configured¶
whether Storage Service is configured
- Type:
bool
- alias: str | None = None¶
- aws_access_id: str | None = None¶
- aws_secret_key: str | None = None¶
- azure_secret_key: str | None = None¶
- azure_storage_account_name: str | None = None¶
- configured: bool = False¶
- gcs_service_account_key: str | None = None¶
- location: str | None = None¶
- s3_region: str | None = None¶
- type: StorageType = 'unset'¶
mstrio.server.timezone module¶
- class mstrio.server.timezone.TimeZone(connection: Connection, id: str = None, name: str = None)¶
Bases:
Entity
,CopyMixin
,DeleteMixin
- alter(name: str = None, base_timezone: str | mstrio.server.timezone.TimeZone | None = None, description: str = None, comments: str | None = None, owner: str | mstrio.users_and_groups.user.User | None = None) None ¶
Alter the time zone’s properties. :param name: Name of the time zone object :type name: str, optional :param base_timezone: Reference (ID or TimeZone
object) to the base time zone
- Parameters:
description (str, optional) – Description of the time zone object
comments (str, optional) – long description of the time zone object
owner – (str or User, optional): owner of the time zone object
- classmethod create(connection: Connection, name: str, base_timezone: str | mstrio.server.timezone.TimeZone, description: str | None = None) TimeZone ¶
Create a new time zone object with the specified properties.
- Parameters:
connection – Strategy One connection object returned by connection.Connection().
name (str) – Name of the new time zone.
base_timezone (str | TimeZone) – Existing time zone object to base the new time zone on.
description (str, optional) – Description of the new time zone.
- mstrio.server.timezone.list_timezones(connection: Connection, to_dictionary: bool = False, limit: int | None = None, only_system_timezones: bool | None = None, only_custom_timezones: bool | None = None, **filters)¶
Get list of all time zones.
- Parameters:
connection – Strategy One connection object returned by connection.Connection().
to_dictionary (bool, optional) – If True, returns list of time zones as dicts, otherwise list of TimeZone objects. Defaults to False.
limit (int, optional) – The maximum number of time zones to return.
only_system_timezones (bool, optional) – If True, returns only system time zones. Cannot be used with only_custom_timezones.
only_custom_timezones (bool, optional) – If True, returns only custom time zones. Cannot be used with only_system_timezones.
- Returns:
List of time zones as TimeZone objects or dictionaries.