mstrio > server > license

class mstrio.server.license.ActivationInfo(activated, activation_count, activation_needed, user_provided_info=None, activation_code=None, deactivation_code=None, activation_date=None)

Bases: Dictable

Class that represents license activation information. It contains details about the activation status, activation and deactivation codes, and other related information.

Parameters:
  • activated (bool) –

  • activation_count (int) –

  • activation_needed (bool) –

  • user_provided_info (dict | None) –

  • activation_code (str | None) –

  • deactivation_code (str | None) –

  • activation_date (str | None) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

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, first_name, last_name, job_title, phone, email, confirm_email, address, city, postal, country, company, use_personal_info=False, state=None)

Bases: Dictable

Contact information for license management. This class represents contact information required for license operations.

Parameters:
  • 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) –

  • state (str | None) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

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
enum mstrio.server.license.InstallationUse(value)

Bases: AutoName

Enumeration constant indicating installation use

Valid values are as follows:

DEVELOPMENT = InstallationUse.DEVELOPMENT
TESTING = InstallationUse.TESTING
PRODUCTION = InstallationUse.PRODUCTION
TRAINING = InstallationUse.TRAINING
OTHER = InstallationUse.OTHER
class mstrio.server.license.License(connection, node_name=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

Parameters:
  • connection (Connection) –

  • node_name (str | None) –

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:

MachineInfo

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:

ActivationInfo

compliance_time

Time of the last compliance check.

Type:

str

compliance_type

Type of the last compliance check.

Type:

str

in_compliance

Flag indicating if the license is in compliance.

Type:

bool

compliance_running

Flag indicating if compliance check is currently running.

Type:

bool

audit_time

Time of the last audit.

Type:

str

activate(activation_code)

Activate the license.

Parameters:

activation_code (str) – Activation code. To obtain the activation code you need to upload xml activation file on the Strategy licensing site.

Return type:

None

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

deactivate()

Deactivate the license.

Return type:

None

export_audit_to_csv(file_path)

Export the audit results to a CSV file.

IMPORTANT: To export detailed audit results, you need to fetch all products and their users’ privileges first using the fetch_all_products_users_privileges method.

Parameters:

file_path (str) – Path to the CSV file where the audit results will be saved.

Returns:

DataFrame containing the audit results.

In case of detailed audit results, if privilege is granted directly to the user, the columns ‘Inherited from User Group’, ‘Inherited from Security Role’ and ‘Project’ will be set to ‘–‘. If privilege is inherited from a UserGroup, the column ‘Inherited from User Group’ will be set to the name of the UserGroup, columns ‘Inherited from Security Role’ and ‘Project’ will be set to ‘–‘. If privilege is inherited from a SecurityRole, the column ‘Inherited from User Group’ will be set to ‘–’, columns ‘Inherited from Security Role’ will be set to the name of the SecurityRole and ‘Project’ will be set to the name of the project the SecurityRole is assigned to.

Return type:

pd.DataFrame

export_audit_to_dataframe(file_path=None)

Create and return a DataFrame containing the audit results. Optionally, save the DataFrame to a file.

IMPORTANT: To export detailed audit results, you need to fetch all products and their users’ privileges first using the fetch_all_products_users_privileges method.

Parameters:

file_path (str, optional) – Path to the file where the DataFrame will be saved. If None, the DataFrame will not be saved. It can be a path to a .pkl, .json or .csv file.

Returns:

DataFrame containing the audit results.

In case of detailed audit results, if privilege is granted directly to the user, the columns ‘Inherited from User Group’, ‘Inherited from Security Role’ and ‘Project’ will be set to ‘–‘. If privilege is inherited from a UserGroup, the column ‘Inherited from User Group’ will be set to the name of the UserGroup, columns ‘Inherited from Security Role’ and ‘Project’ will be set to ‘–‘. If privilege is inherited from a SecurityRole, the column ‘Inherited from User Group’ will be set to ‘–’, columns ‘Inherited from Security Role’ will be set to the name of the SecurityRole and ‘Project’ will be set to the name of the project the SecurityRole is assigned to.

Return type:

pd.DataFrame

fetch()

Fetch the current license information from the environment.

Return type:

None

fetch_all_products_users_privileges()

Fetch all products and their users’ privileges.

Return type:

None

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

get_activation_info()

Get information about the license activation.

Returns:

ActivationInfo object with license activation details.

Return type:

ActivationInfo

get_activation_xml_file(save_path)

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.

Return type:

None

get_audit()

Get the audit results.

Return type:

None

get_compliance_check()

Get the compliance check details.

Return type:

None

get_compliance_check_status()

Get the compliance check status.

Return type:

None

get_history()

Get the license history.

Returns:

List of Record objects representing the license history.

Return type:

list[Record]

get_new_key_entitlements(key)

Get the entitlements for a new license key.

Parameters:

key (str) – License key to get entitlements for.

Returns:

Dictionary with the entitlements for the new license key.

Return type:

dict

list_details()

Return a dictionary with license details.

Returns:

Dictionary with license details excluding products information.

Return type:

dict

list_products(module='intelligence_module', product_id=None, name=None)

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.

Parameters:
  • product_id (int | list[int], optional) – Product IDs to filter products list. If provided, it should be a single ID or a list of IDs.

  • name (str, optional) – Product name to filter products list.

  • module (str, optional) –

Returns:

List of licensed products.

Return type:

list

list_properties()

Return a dictionary with all license properties.

Returns:

Dictionary with all license properties.

Return type:

dict

register_new_key(key)

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.

Return type:

None

run_and_get_audit(timeout=30, retry_interval=1)

Run a license audit and get the results with a timeout.

Parameters:
  • timeout (int, optional) – Maximum time (in seconds) to wait for the audit to complete.

  • retry_interval (int, optional) – Time interval (in seconds) between retries.

Return type:

None

run_and_get_compliance_check(timeout=30, retry_interval=1)

Run a compliance check and get the results with a timeout.

Parameters:
  • timeout (int, optional) – Maximum time (in seconds) to wait for compliance check to complete.

  • retry_interval (int, optional) – Time interval (in seconds) between retries.

Return type:

None

run_audit()

Run a license audit. :returns: Dictionary about the audit request. :rtype: dict

Return type:

dict

run_compliance_check()

Run a compliance check on the license.

Return type:

None

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

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

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

update_activation_request_information(location, installation_use, customer_contact, employee_of_licensed_company=True, installer_contact=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.

Return type:

None

FIELDNAMES = ['Product', 'User Full Name', 'User ID', 'User State', 'Creation Date (User)', 'Last Modified (User)', 'LDAP (User)', 'Privilege Name', 'Privilege ID', 'Inherited from User Group', 'Inherited from Security Role', 'Project']
class mstrio.server.license.MachineInfo(cpu_speed, cpu_type, OS, host_id, kernel_release, machine_name, num_physical_cpus, system_language)

Bases: Dictable

Class representing system hardware and operating system information for a machine.

Parameters:
  • cpu_speed (str) –

  • cpu_type (str) –

  • OS (str) –

  • host_id (str) –

  • kernel_release (str) –

  • machine_name (str) –

  • num_physical_cpus (int) –

  • system_language (str) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

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.PrivilegeInfo(privilege, sources=None)

Bases: Dictable

Class representing a privilege information in the license management system.

Parameters:
  • privilege (Privilege) –

  • sources (list[str] | None) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

privilege: Privilege
sources: list[str] | None = None
class mstrio.server.license.Product(count, duration, id, name, period, type, module, _connection, in_compliance=None, license_in_use=None, users=None)

Bases: Dictable

Class encapsulating details about a licensed product within the Strategy ecosystem.

Parameters:
  • count (int) –

  • duration (int) –

  • id (int) –

  • name (str) –

  • period (int) –

  • type (str) –

  • module (str) –

  • _connection (Connection) –

  • in_compliance (bool | None) –

  • license_in_use (int | None) –

  • users (list[UserLicense] | None) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

fetch_users_privileges()

Fetch users privileges for the product.

Return type:

None

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

PRODUCT_NAME_MAP = {0: 'RESERVED', 6: 'SERVER_REPORTER', 17: 'GATEWAY_EMM_AIRWATCH_BY_VMWARE', 23: 'CLIENT_APPLICATION_OFFICE', 30: 'CLIENT_HYPER_API', 32: 'PLACEHOLDER_1', 33: 'PLACEHOLDER_2', 34: 'CLIENT_APPLICATION_RSTUDIO', 35: 'PRODUCT_01', 36: 'PRODUCT_02', 37: 'PRODUCT_03', 38: 'PRODUCT_04', 39: 'PRODUCT_05', 40: 'PRODUCT_06'}
count: int
duration: int
id: int
in_compliance: bool | None = None
license_in_use: int | None = None
module: str
name: str
period: int
type: str
users: list[UserLicense] | None = None
class mstrio.server.license.Record(activity, build, code, contract_id, issue_date, key, key_group, products_install, products_repair, products_uninstall, products_update, release, source, state, time)

Bases: Dictable

Class representing a record in the license management history

Parameters:
  • activity (str) –

  • build (str) –

  • code (str) –

  • contract_id (str) –

  • issue_date (str) –

  • key (str) –

  • key_group (str) –

  • products_install (list) –

  • products_repair (list) –

  • products_uninstall (list) –

  • products_update (list) –

  • release (str) –

  • source (str) –

  • state (str) –

  • time (str) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

activity: str
build: str
code: str
contract_id: str
issue_date: str
key: str
key_group: str
products_install: list
products_repair: list
products_uninstall: list
products_update: list
release: str
source: str
state: str
time: str
class mstrio.server.license.UserLicense(id, name, enabled, date_created, date_modified, ldap=None, privileges=None)

Bases: Dictable

Class representing a user license in the license management system.

Parameters:
  • id (str) –

  • name (str) –

  • enabled (bool) –

  • date_created (str) –

  • date_modified (str) –

  • ldap (bool | None) –

  • privileges (list[PrivilegeInfo] | None) –

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

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

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

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

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

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

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

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

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

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

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

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

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

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

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

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

date_created: str
date_modified: str
enabled: bool
id: str
ldap: bool | None = None
name: str
privileges: list[PrivilegeInfo] | None = None