mstrio > server > storage

class mstrio.server.storage.StorageService(type=StorageType.UNSET, alias=None, location=None, s3_region=None, aws_access_id=None, aws_secret_key=None, azure_storage_account_name=None, azure_secret_key=None, gcs_service_account_key=None, configured=False)

Bases: Dictable

StorageService configuration of environment. .. attribute:: type

Type of storage (e.g. file system, S3)

type:

StorageType

Parameters:
  • type (StorageType) –

  • alias (str | None) –

  • location (str | None) –

  • s3_region (str | None) –

  • aws_access_id (str | None) –

  • aws_secret_key (str | None) –

  • azure_storage_account_name (str | None) –

  • azure_secret_key (str | None) –

  • gcs_service_account_key (str | None) –

  • configured (bool) –

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

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

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'
enum mstrio.server.storage.StorageType(value)

Bases: Enum

Enumeration of Storage Service types.

Valid values are as follows:

UNSET = <StorageType.UNSET: 'unset'>
UNKNOWN = <StorageType.UNKNOWN: 'unknown'>
FILE_SYSTEM = <StorageType.FILE_SYSTEM: 'file_system'>
S3 = <StorageType.S3: 'S3'>
AZURE = <StorageType.AZURE: 'Azure'>
GCS = <StorageType.GCS: 'GCS'>