sempy_labs.onelake package
Module contents
- sempy_labs.onelake.delete_onelake_lifecycle_policy(workspace: str | UUID | None = None)
Deletes the OneLake lifecycle management policy for a workspace.
This sends an empty
rulesarray to the import policy API, which removes the existing policy.This is a wrapper function for the following API: OneLake Lifecycle Policy - Import Policy.
Service Principal Authentication is supported (see here for examples).
- sempy_labs.onelake.export_onelake_lifecycle_policy(workspace: str | UUID | None = None) dict
Exports the OneLake lifecycle management policy for a workspace.
This is a wrapper function for the following API: OneLake Lifecycle Policy - Export Policy.
Service Principal Authentication is supported (see here for examples).
- Parameters:
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- Returns:
The OneLake workspace lifecycle policy, containing the policy
properties(includinglastModifiedTimeandpolicyrules) and the ARM resourcetype.- Return type:
- sempy_labs.onelake.import_onelake_lifecycle_policy(policy: dict, workspace: str | UUID | None = None) dict
Imports (creates or replaces) the OneLake lifecycle management policy for a workspace.
The policy must be sent in full as a complete replacement. To delete the existing policy, send a request with an empty
rulesarray.This is a wrapper function for the following API: OneLake Lifecycle Policy - Import Policy.
Service Principal Authentication is supported (see here for examples).
- Parameters:
policy (dict) – The lifecycle policy request body. May be specified either as the full request body (
{"properties": {"policy": {"rules": [...]}}}) or as just the policy contents ({"policy": {"rules": [...]}}or{"rules": [...]}). The structure follows Azure Storage lifecycle management. Note that thetierToArchiveaction,deleteaction andblobIndexMatchfilter are not supported.workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- Returns:
The OneLake workspace lifecycle policy response, containing the policy
propertiesand the ARM resourcetype.- Return type: