PolicyClient Class
To manage and control access to your resources, you can define customized policies and assign them at a scope.
This ready contains multiple API versions, to help you deal with all of the Azure clouds (Azure Stack, Azure Government, Azure China, etc.). By default, it uses the latest API version available on public Azure. For production, you should stick to a particular api-version and/or profile. The profile sets a mapping between an operation group and its API version. The api-version parameter sets the default API version if the operation group is not described in the profile.
- Inheritance
-
PolicyClientazure.mgmt.resource.policy._policy_client._SDKClientPolicyClient
Constructor
PolicyClient(credential: TokenCredential, subscription_id: str, api_version: str | None = None, base_url: str = 'https://management.azure.com', profile: KnownProfiles = KnownProfiles.default, **kwargs: Any)
Parameters
Name | Description |
---|---|
credential
Required
|
Credential needed for the client to connect to Azure. Required. |
subscription_id
Required
|
The ID of the target subscription. The value must be an UUID. Required. |
api_version
|
API version to use if no profile is provided, or if missing in profile. Default value: None
|
base_url
|
Service URL Default value: https://management.azure.com
|
profile
|
A profile definition, from KnownProfiles to dict. Default value: KnownProfiles.default
|
Methods
close | |
models |
Module depends on the API version:
|
close
close()
models
Module depends on the API version:
2015-10-01-preview: models
2016-04-01: models
2016-12-01: models
2017-06-01-preview: models
2018-03-01: models
2018-05-01: models
2019-01-01: models
2019-06-01: models
2019-09-01: models
2020-07-01-preview: models
2020-09-01: models
2021-06-01: models
2022-06-01: models
2022-07-01-preview: models
2022-08-01-preview: models
2023-04-01: models
models(api_version='2023-04-01')
Parameters
Name | Description |
---|---|
api_version
|
Default value: 2023-04-01
|
Attributes
data_policy_manifests
Instance depends on the API version:
- 2020-09-01: DataPolicyManifestsOperations
policy_assignments
Instance depends on the API version:
2015-10-01-preview: PolicyAssignmentsOperations
2016-04-01: PolicyAssignmentsOperations
2016-12-01: PolicyAssignmentsOperations
2017-06-01-preview: PolicyAssignmentsOperations
2018-03-01: PolicyAssignmentsOperations
2018-05-01: PolicyAssignmentsOperations
2019-01-01: PolicyAssignmentsOperations
2019-06-01: PolicyAssignmentsOperations
2019-09-01: PolicyAssignmentsOperations
2020-09-01: PolicyAssignmentsOperations
2021-06-01: PolicyAssignmentsOperations
2022-06-01: PolicyAssignmentsOperations
2023-04-01: PolicyAssignmentsOperations
policy_definition_versions
Instance depends on the API version:
- 2023-04-01: PolicyDefinitionVersionsOperations
policy_definitions
Instance depends on the API version:
2015-10-01-preview: PolicyDefinitionsOperations
2016-04-01: PolicyDefinitionsOperations
2016-12-01: PolicyDefinitionsOperations
2018-03-01: PolicyDefinitionsOperations
2018-05-01: PolicyDefinitionsOperations
2019-01-01: PolicyDefinitionsOperations
2019-06-01: PolicyDefinitionsOperations
2019-09-01: PolicyDefinitionsOperations
2020-09-01: PolicyDefinitionsOperations
2021-06-01: PolicyDefinitionsOperations
2023-04-01: PolicyDefinitionsOperations
policy_exemptions
Instance depends on the API version:
2020-07-01-preview: PolicyExemptionsOperations
2022-07-01-preview: PolicyExemptionsOperations
policy_set_definition_versions
Instance depends on the API version:
- 2023-04-01: PolicySetDefinitionVersionsOperations
policy_set_definitions
Instance depends on the API version:
2017-06-01-preview: PolicySetDefinitionsOperations
2018-03-01: PolicySetDefinitionsOperations
2018-05-01: PolicySetDefinitionsOperations
2019-01-01: PolicySetDefinitionsOperations
2019-06-01: PolicySetDefinitionsOperations
2019-09-01: PolicySetDefinitionsOperations
2020-09-01: PolicySetDefinitionsOperations
2021-06-01: PolicySetDefinitionsOperations
2023-04-01: PolicySetDefinitionsOperations
variable_values
Instance depends on the API version:
- 2022-08-01-preview: VariableValuesOperations
variables
Instance depends on the API version:
- 2022-08-01-preview: VariablesOperations
DEFAULT_API_VERSION
DEFAULT_API_VERSION = '2023-04-01'
LATEST_PROFILE
LATEST_PROFILE = azure.mgmt.resource.policy.PolicyClient latest
Azure SDK for Python