waft.warp_client.warp_config.warp_mdm_handler module

File to manage, validate, and export MDM settings.

class waft.warp_client.warp_config.warp_mdm_handler.WarpMDMHandler(node: BaseNode)

Bases: ABC

Base Class for MDM handling.

add_mdm_config(mdm_config: MDMConfiguration, validate: bool = True, enroll: bool = False)

Adds MDM Config to WARP MDM handler.

Parameters:
  • mdm_config – Config structure to add to configuration instance.

  • validate – Boolean to indicate if config should be validated before being added to config’s list of configs

  • enroll – True to enroll the device using a Service Auth service token. False to not enroll the device by configuration (default).

apply_mdm()

Applies current MDM settings by writing XML or appropriate file and structure

backup_config_array(backup_path: Path)

Back up config array existing into given filename.

Parameters:

backup_path – Local path to file where XML config array will be backed up

clear_configs()

Clear all MDM configs currently defined

property current_mdm_config: list[MDMConfiguration] | MDMConfiguration

Return list of MDMConfiguration objects, or single MDMConfiguration object, representing all MDM configs

default_mdm_filepath: PurePath
delete_config(config_name: str)

Delete MDM config with given name.

Parameters:

config_name – Name of MDM config to be deleted

get_first_config() MDMConfiguration

Return the first entry of the current MDM configuration.

Returns:

MDM config object

Return type:

MDMConfiguration

get_org_info(mdm_config: MDMConfiguration) TrmOrganization

Return corresponding TRM organization details for an MDM configuration.

Parameters:

mdm_config (MDMConfiguration) – MDM config object

Returns:

Test resource managed organization details

Return type:

TrmOrganization

load_mdm(mdm_text: str | None = None)

Load the mdm file from the system into memory.

Parameters:

mdm_text – Optional raw text of mdm XML to load, if not given MDM on node will be read back and loaded.

mdm_exists()

Return boolean indicating whether or not the mdm file exists

property mdm_xml: Element

Output the entire config’s array of MDM configs to XML structure

modify_config(config_name: str, key: str, value)

Modify the MDM config of given name and set thee given key:value pair.

Parameters:
  • config_name – Name of the config to modify

  • key – Key of the value to set

  • value – Value to be set for given key

read_backup(backup_path: Path)

Back up config array existing into given filename

Parameters:

backup_path – Local path to file where XML config array has been backed up

read_mdm() str

Read the mdm file from the system into memory.

remove_mdm()

Remove the mdm file from the system.