Adaptable Application
- class Adaptable(api)
Bases:
_ApplicationBase
- create(name, device, policy_folder, powershell_script_name, powershell_script_content, locked=False, retry_after_script_hash_mismatch=None, description=None, contacts=None, approvers=None, application_credential=None, secondary_credential=None, port=None, private_key_credential=None, log_debug=None, attributes=None, get_if_already_exists=True)
- Parameters
name (str) – Name of the application object.
device (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the device object.
policy_folder (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the folder to write the Adaptable PowerShell script policy.
powershell_script_name (str) – Name of the PowerShell script.
powershell_script_content (bytes) – Content of the PowerShell script in bytes. Use
open(ps_script, 'rb')
.locked (bool) – Lock this script on the
policy_folder
.retry_after_script_hash_mismatch (bool) – When the script is updated fix the related provisioning and discovery errors.
description (str) – Description for the application object.
contacts (List[Union[ident.Identity, str]]) – List of Identity Object or Prefixed Name as contacts for the application object.
approvers (List[Union[ident.Identity, str]]) – List of Identity Object or Prefixed Name as approvers for the application object.
application_credential (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the application credential object.
secondary_credential (Union[config.Object, str]) – Config Object or Distinguished Name (DN) of the supplemental application credential to pass to PowerShell script.
port (int) – Port number.
private_key_credential (str) – Optional private key credential.
log_debug (bool) – Enable log debug.
attributes (dict) – Additional attributes pertaining to the application object.
get_if_already_exists (bool) – If the objects already exists, just return it as is.
- Returns
Config Object of the application.
- delete(application)
Deletes an application object.
- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
- disable(application)
Disables all processing and provisioning of the application.
- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
- enable(application)
Enables all processing and provisioning of the application.
- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
- get(application_dn, raise_error_if_not_exists=True)
- Parameters
application_dn (str) – Distinguished Name (DN) of the application object.
raise_error_if_not_exists (bool) – Raise an exception if the application Distinguished Name (DN) does not exist.
- Returns
Config Object of the application
- get_associated_certificate(application)
- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
- Returns
Config Object of the certificate object associated to the application object.
- get_stage(application)
- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
- Returns
The current stage if it exists. Otherwise, returns
None
.- Return type
int
- get_status(application)
- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
- Returns
The current processing status of the application object or
None
if a status does not exist.- Return type
str
- wait_for_installation_to_complete(application, timeout=60)
Waits for the application object’s “Last Pushed On” attribute to be a date greater than or equal to the “Last Renewed On” date on the associated certificate. If the certificate has not been recently renewed and is simply being associated to the certificate, either clear the “Last Pushed On” date from the application object or use
pytpp.pytpp.features.certificate.Certificate.associate_application()
withpush_to_new=True
.- Parameters
application (Union[Object, str]) – Config Object or Distinguished Name (DN) of the application object.
timeout (int) – Timeout in seconds.