mstrio.distribution_services.device package

Submodules

mstrio.distribution_services.device.device module

class mstrio.distribution_services.device.device.Device(connection: Connection, name: str = None, id: str = None)

Bases: Entity, DeleteMixin, TranslationMixin

Devices are Distribution Services components that specify the format

and transmission process of subscribed reports and documents. They are instances of transmitters that contain specific settings specific to a user’s environments.

name

name of the device

id

identifier of the Device

description

description of the device

device_type

type of the Device, DeviceType Enum

transmitter

information of Transmitter attached

device_properties

properties of the device, different for every device type

ancestors

List of ancestor folders

type

Object type. Enum

subtype

Object subtype

ext_type

Object extended type.

date_created

Creation time, DateTime object

date_modified

Last modification time, DateTime object

owner

User object that is the owner

version

Object version ID

acg

Access rights (See EnumDSSXMLAccessRightFlags for possible values)

acl

Object access control list

alter(name: str | None = None, description: str | None = None, device_properties: mstrio.utils.helper.Dictable | dict | None = None, comments: str | None = None)

Alter the device object properties.

Parameters:
  • name – device object name

  • description – device object description

  • device_properties – properties of the device, specific for each device type

  • comments – long description of the device object

classmethod create(connection: Connection, name: str, device_type: mstrio.distribution_services.device.device.DeviceType | str, transmitter: mstrio.distribution_services.transmitter.transmitter.Transmitter | str, device_properties: dict | mstrio.utils.helper.Dictable, description: str = None) Device

Create a new device.

Parameters:
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name – device object name

  • device_type – type of the device

  • transmitter – Transmitter object

  • description – device object description

  • device_properties – properties of the device

Returns:

Device object.

update_properties() None

Save compatible local changes of the object attributes to the I-Server.

Raises:

requests.HTTPError – if I-Server raises exception

class mstrio.distribution_services.device.device.DeviceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

ALL = 'all'
ANDROID = 'android'
EMAIL = 'email'
FILE = 'file'
FTP = 'ftp'
IPAD = 'ipad'
IPHONE = 'iphone'
PRINTER = 'printer'
UNSUPPORTED = 'unsupported'
mstrio.distribution_services.device.device.list_devices(connection: Connection, to_dictionary: bool = False, limit: int = None, **filters) list['Device'] | list[dict]

Get list of Device objects or dicts. Optionally filter the devices by specifying filters.

Parameters:
  • connection – MicroStrategy connection object returned by connection.Connection()

  • to_dictionary – If True returns dict, by default (False) returns Device objects.

  • limit – limit the number of elements returned. If None (default), all objects are returned.

  • **filters – Available filter parameters: [‘id’, ‘name’, ‘description’, ‘date_created’, ‘date_modified’, ‘device_type’, ‘transmitter’, ‘device_properties’]

Examples

>>> list_devices(connection, name='device_name')

mstrio.distribution_services.device.device_properties module

class mstrio.distribution_services.device.device_properties.AndroidDeviceProperties(package_name: str, server: str | None = None, port: int | None = None, auth_key: str | None = None, collapse_key: str | None = None, delay_with_idle: bool = False, notification_active_hours: int | None = None, use_proxy: bool = False, proxy_server: str | None = None, proxy_port: int | None = None)

Bases: Dictable

Device properties for android device type.

package_name

Mobile Application Package name

server

Firebase cloud messaging service server name/IP address

port

Firebase cloud messaging service Port number, default: 0

auth_key

Firebase cloud messaging service Authentication Key

collapse_key

Firebase cloud messaging service Collapse Key

delay_with_idle

Whether to use Delay with idle

notification_active_hours

Notification active for hours, 1 to 99999

use_proxy

Whether to use Proxy for Firebase cloud messaging

proxy_server

Firebase cloud messaging proxy service server name/IP address

proxy_port

Firebase cloud messaging proxy service Port number

class mstrio.distribution_services.device.device_properties.BackupPrinterProperties(print_on_backup: bool = False, backup_location_type: mstrio.distribution_services.device.device_properties.PrinterBackupLocationType | str | None = None, backup_printer_location: str | None = None, backup_file_location: str | None = None)

Bases: Dictable

Printer Backup Setting.

print_on_backup

Whether to print on Backup printer if primary printer fails, default: False

backup_location_type

Backup device type, PrinterBackupLocationType class

backup_printer_location

Backup Printer Location

backup_file_location

Backup File Location

class mstrio.distribution_services.device.device_properties.ConnectionParameters(retries_count: int = 5, seconds_between_retries: int = 3, delivery_timeout_seconds: int = 10)

Bases: Dictable

Connection Parameters

retries_count

Number of Retries, default: 5

seconds_between_retries

Time between retries (Seconds), default: 3

delivery_timeout_seconds

Delivery Timeout (Seconds), default: 10

class mstrio.distribution_services.device.device_properties.EmailDeviceProperties(format: str | mstrio.distribution_services.device.device_properties.EmailFormat, mime_settings: dict | mstrio.distribution_services.device.device_properties.EmailMimeSettings | None = None, smart_host_settings: dict | mstrio.distribution_services.device.device_properties.EmailSmartHostSettings | None = None)

Bases: Dictable

Device properties for email device type.

format

indicates the email format of the email device, EmailFormat enum

mime_settings

MIME settings for MIME email format

smart_host_settings

smart host settings

class mstrio.distribution_services.device.device_properties.EmailEncoding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

ASCII_7BIT = 'ascii_7bit'
BASE64 = 'base64'
QUOTED_PRINTABLE = 'quoted_printable'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.EmailFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

MIME = 'mime'
UNSUPPORTED = 'unsupported'
UU_ENCODED = 'uu_encoded'
class mstrio.distribution_services.device.device_properties.EmailMessageSensitivity(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

CONFIDENTIAL = 'confidential'
NORMAL = 'normal'
PERSONAL = 'personal'
PRIVATE = 'private'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.EmailMimeSettings(plain_text_html_body_encoding: mstrio.distribution_services.device.device_properties.EmailEncoding | str, text_attachment_encoding: mstrio.distribution_services.device.device_properties.EmailEncoding | str, binary_attachment_encoding: mstrio.distribution_services.device.device_properties.EmailEncoding | str, message_sensitivity: mstrio.distribution_services.device.device_properties.EmailMessageSensitivity | str, us_ascii_encoding: bool = False, non_us_ascii_quotes: bool = False, embed_html_attachments: bool = False, embed_all_attachments: bool = False, embed_adobe_flash_content: bool = False, html_table_position_only: bool = False, css_inline_style: bool = False)

Bases: Dictable

MIME settings for MIME email format

plain_text_html_body_encoding

Indicates the encoding for plaintext and HTML body, EmailEncoding enum

text_attachment_encoding

Indicates the encoding for text attachment, only quoted_printable and base64 are supported, EmailEncoding enum

binary_attachment_encoding

Indicates the encoding for text attachment, only quoted_printable and base64 are supported, EmailEncoding enum

message_sensitivity

Indicates the message sensitivity, EmailMessageSensitivity enum

us_ascii_encoding

Whether to use US-ASCII for Subject, Attachments Names and Display Names, default: False

non_us_ascii_quotes

Whether to use put quotes around non US-ASCII Display Names. Enable for Microsoft Outlook 98 and Microsoft Outlook 2000 email client only, default: False

embed_html_attachments

Whether to embed HTML Attachments, default: False

embed_all_attachments

Whether to embed All Attachments, default: False

embed_adobe_flash_content

Whether to embed Adobe Flash Content, default: False

html_table_position_only

Whether to use only table to position elements in HTML (Enabled for Microsoft Outlook 2007), default: False

css_inline_style

Whether to use inline style CSS, default: False

class mstrio.distribution_services.device.device_properties.EmailSmartHostSettings(server: str | None = None, port: int | None = None, always_use_smart_host: bool = False, smart_host_username: str | None = None, smart_host_password: bool = False)

Bases: Dictable

Smart host settings

server

Server Name or IP Address

port

Port number, default: 25

always_use_smart_host

Whether to always use smart host, default: 25

smart_host_username

Smart Host Username

smart_host_password

Smart Host Password

class mstrio.distribution_services.device.device_properties.FileDeviceProperties(file_location: mstrio.distribution_services.device.device_properties.FileLocation | dict, file_system: mstrio.distribution_services.device.device_properties.FileSystem | dict, connection_parameters: mstrio.distribution_services.device.device_properties.ConnectionParameters | dict, file_properties: mstrio.distribution_services.device.device_properties.FileProperties | dict, unix_windows_sharity: mstrio.distribution_services.device.device_properties.UnixWindowsSharity | dict)

Bases: Dictable

Device properties for file device type.

file_location

File Location Setting, FileLocation class

file_system

File System Options, FileSystem class

connection_parameters

Connection Parameters, ConnectionParameters class

file_properties

File related properties, FileProperties class

unix_windows_sharity

Unix to Windows Sharity settings, UnixWindowsSharity class

class mstrio.distribution_services.device.device_properties.FileEncoding(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

COMPRESS = 'compress'
ENCRYPT = 'encrypt'
NO_ENCRYPT_COMPRESS = 'no_encrypt_compress'
class mstrio.distribution_services.device.device_properties.FileLocation(file_path: str, append_user_path: bool = False, use_backup_location: bool = False, backup_file_path: str | None = None)

Bases: Dictable

File Location Setting

file_path

File Location

append_user_path

Whether to allow and append user entered path, default: False

use_backup_location

Whether to use backup location, default: False

backup_file_path

Backup File Location

class mstrio.distribution_services.device.device_properties.FileProperties(read_only: bool = True, archive: bool = False, index: bool = False, file_encoding: mstrio.distribution_services.device.device_properties.FileEncoding | str | None = None, unix_access_rights: str | None = None)

Bases: Dictable

File related properties

read_only

Whether to enable read only access for file, default: True

archive

Whether to archive the file, default: False

index

Whether to index the file, default: False

file_encoding

File Encoding, FileEncoding enum

unix_access_rights

UNIX access rights

class mstrio.distribution_services.device.device_properties.FileSystem(create_folder: bool = True, filename_append_time_stamp: bool = True, override_filename: bool = False, append_to_file: bool = False)

Bases: Dictable

File System Options

create_folder

Whether to create required folder in the path, default: True

filename_append_time_stamp

Whether to append timestamp to the file name, default: True

override_filename

Whether to override filename with same name, default: False

append_to_file

Whether to append to the file, default: False

class mstrio.distribution_services.device.device_properties.FtpDeviceProperties(server_settings: mstrio.distribution_services.device.device_properties.FtpServerSettings | dict, file_system: mstrio.distribution_services.device.device_properties.FileSystem | dict)

Bases: Dictable

Device properties for ftp device type.

server_settings

FTP Server Settings, FtpServerSettings class

file_system

File System Options, FileSystem class

class mstrio.distribution_services.device.device_properties.FtpProtocol(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

FTP = 'ftp'
FTP_OVER_SSL_TLS_EXPLICIT = 'ftp_over_ssl_tls_explicit'
FTP_OVER_SSL_TLS_IMPLICIT = 'ftp_over_ssl_tls_implicit'
SFTP = 'sftp'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.FtpServerSettings(protocol: mstrio.distribution_services.device.device_properties.FtpProtocol | str, port: int, path: str, host: str | None = None, passive_mode: bool = True, max_connections: int = -1, ascii_mode: bool = True, user_name: str | None = None, password: str | None = None)

Bases: Dictable

FTP Server Settings

protocol

FTP Protocol, FtpProtocol enum

host

FTP Host IP Address

port

Port number

path

FTP Path

passive_mode

Whether to use Passive Mode for connection, default: True

max_connections

Maximum connection, default: -1

ascii_mode

Whether to use ASCII Mode File Type for connection, default: True

user_name

FTP Account Username

password

FTP Account Password

class mstrio.distribution_services.device.device_properties.IOSDeviceProperties(app_id: str = '', server: str | None = None, port: int | None = None, provider_certificate: str | None = None, feedback_service_server: str | None = None, feedback_service_port: int | None = None)

Bases: Dictable

Device properties for ipad and iphone device types.

app_id

Application ID

server

Push notification server name, default: ‘gateway.push.apple.com’

port

Port number, default: 2195

provider_certificate

Provider Certificate file location on server

feedback_service_server

Feedback Service server name, default: ‘feedback.push.apple.com’

feedback_service_port

Feedback Service Port number, default: 2195

class mstrio.distribution_services.device.device_properties.PdfApplicationPriority(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

I_SERVER = 'i_server'
OTHER = 'other'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.PdfOddEvenPages(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

ALL_PAGES = 'all_pages'
EVEN_PAGES = 'even_pages'
ODD_PAGES = 'odd_pages'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.PrinterBackupLocationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

FILE = 'file'
PRINTER = 'printer'
class mstrio.distribution_services.device.device_properties.PrinterDeviceProperties(printer_location: mstrio.distribution_services.device.device_properties.PrinterLocation | dict, printer_properties: mstrio.distribution_services.device.device_properties.PrinterProperties | dict, connection_parameters: mstrio.distribution_services.device.device_properties.ConnectionParameters | dict, backup_printer_properties: mstrio.distribution_services.device.device_properties.BackupPrinterProperties | dict, temp_file_location: str | None = None)

Bases: Dictable

Device properties for printer device type.

printer_location

Printer Location, PrinterLocation class

printer_properties

Printer Properties, PrinterProperties class

connection_parameters

Connection Parameters, ConnectionParameters class

backup_printer_properties

Printer Backup Setting, BackupPrinterProperties class

temp_file_location

Temp File Location during print execution

class mstrio.distribution_services.device.device_properties.PrinterLocation(location: str | None = None, user_defined_location: bool = False)

Bases: Dictable

Printer Location.

location

Printer Location

user_defined_location

Whether to allow user defined location, default: False

class mstrio.distribution_services.device.device_properties.PrinterPaperSize(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

A3 = 'a3'
A4 = 'a4'
A4_SMALL = 'a4_small'
A5 = 'a5'
B4 = 'b4'
B5 = 'b5'
EXECUTIVE = 'executive'
FOLIO = 'folio'
LEDGER = 'ledger'
LEGAL = 'legal'
LETTER = 'letter'
LETTER_SMALL = 'letter_small'
STATEMENT = 'statement'
TABLOID = 'tabloid'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.PrinterPaperSource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

AUTOMATIC = 'automatic'
MANUAL = 'manual'
UNSUPPORTED = 'unsupported'
class mstrio.distribution_services.device.device_properties.PrinterPdfSettings(post_script_level: int = 2, reverse_pages: bool = False, odd_even_pages: mstrio.distribution_services.device.device_properties.PdfOddEvenPages | str | None = None, application_priority: mstrio.distribution_services.device.device_properties.PdfApplicationPriority | str | None = None)

Bases: Dictable

PDF printing settings.

post_script_level

Post Script Level, 0 to 9

odd_even_pages

Indicates the odd or even printing of pages, PdfOddEvenPages enum

reverse_pages

Whether to use reverse pages, default: False

application_priority

Indicates the which application should get the priority when another application is using Adobe and IServer is trying to print PDF documents, PdfApplicationPriority enum

class mstrio.distribution_services.device.device_properties.PrinterProperties(pdf_setting: mstrio.distribution_services.device.device_properties.PrinterPdfSettings | dict, quality: str | None = None, scale: int = 100, paper_source: mstrio.distribution_services.device.device_properties.PrinterPaperSource | str | None = None, paper_size: mstrio.distribution_services.device.device_properties.PrinterPaperSize | str | None = None)

Bases: Dictable

Printer Properties.

pdf_setting

PDF printing settings, PrinterPdfSettings class

quality

Print Quality

scale

Scale in %, default: 100

paper_source

Paper Source, PrinterPaperSource class

paper_size

Paper Size, PrinterPaperSize class

class mstrio.distribution_services.device.device_properties.UnixWindowsSharity(sharity_enabled: bool = False, server_username: str | None = None, server_password: str | None = None, server_mount_root: str | None = None)

Bases: Dictable

Unix to Windows Sharity settings

sharity_enabled

Whether to enable delivery from Intelligence Server running on UNIX to Windows, default: False

server_username

IServer Username used for Sharity

server_password

IServer Password used for Sharity

server_mount_root

IServer Mount root folder path for Sharity

Module contents