azure.mgmt.resource.policy.v2020_09_01.operations module
- class azure.mgmt.resource.policy.v2020_09_01.operations.DataPolicyManifestsOperations(*args, **kwargs)[source]
Bases:
object
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
PolicyClient
’sdata_policy_manifests
attribute.- get_by_policy_mode(policy_mode: str, **kwargs: Any) DataPolicyManifest [source]
Retrieves a data policy manifest.
This operation retrieves the data policy manifest with the given policy mode.
- Parameters:
policy_mode (str) – The policy mode of the data policy manifest to get. Required.
- Returns:
DataPolicyManifest or the result of cls(response)
- Return type:
- Raises:
- list(filter: str | None = None, **kwargs: Any) Iterable[DataPolicyManifest] [source]
Retrieves data policy manifests.
This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid values for $filter are: “$filter=namespace eq ‘{0}’”. If $filter is not provided, the unfiltered list includes all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value.
- Parameters:
filter (str) – The filter to apply on the operation. Valid values for $filter are: “namespace eq ‘{value}’”. If $filter is not provided, no filtering is performed. If $filter=namespace eq ‘{value}’ is provided, the returned list only includes all data policy manifests that have a namespace matching the provided value. Default value is None.
- Returns:
An iterator like instance of either DataPolicyManifest or the result of cls(response)
- Return type:
- Raises:
- models = <module 'azure.mgmt.resource.policy.v2020_09_01.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.11/site-packages/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py'>
- class azure.mgmt.resource.policy.v2020_09_01.operations.PolicyAssignmentsOperations(*args, **kwargs)[source]
Bases:
object
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
PolicyClient
’spolicy_assignments
attribute.- create(scope: str, policy_assignment_name: str, parameters: _models.PolicyAssignment, *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyAssignment [source]
- create(scope: str, policy_assignment_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyAssignment
Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.
- Parameters:
scope (str) – The scope of the policy assignment. Valid scopes are: management group (format: ‘/providers/Microsoft.Management/managementGroups/{managementGroup}’), subscription (format: ‘/subscriptions/{subscriptionId}’), resource group (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}’, or resource (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}’. Required.
policy_assignment_name (str) – The name of the policy assignment. Required.
parameters (PolicyAssignment or IO[bytes]) – Parameters for the policy assignment. Is either a PolicyAssignment type or a IO[bytes] type. Required.
- Returns:
PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- create_by_id(policy_assignment_id: str, parameters: _models.PolicyAssignment, *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyAssignment [source]
- create_by_id(policy_assignment_id: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyAssignment
Creates or updates a policy assignment.
This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope apply to all resources contained in that scope. For example, when you assign a policy to a resource group that policy applies to all resources in the group. Policy assignment IDs have this format: ‘{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’. Valid scopes are: management group (format: ‘/providers/Microsoft.Management/managementGroups/{managementGroup}’), subscription (format: ‘/subscriptions/{subscriptionId}’), resource group (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}’, or resource (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}’.
- Parameters:
policy_assignment_id (str) – The ID of the policy assignment to create. Use the format ‘{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’. Required.
parameters (PolicyAssignment or IO[bytes]) – Parameters for policy assignment. Is either a PolicyAssignment type or a IO[bytes] type. Required.
- Returns:
PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- delete(scope: str, policy_assignment_name: str, **kwargs: Any) PolicyAssignment | None [source]
Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding ‘/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’.
- Parameters:
scope (str) – The scope of the policy assignment. Valid scopes are: management group (format: ‘/providers/Microsoft.Management/managementGroups/{managementGroup}’), subscription (format: ‘/subscriptions/{subscriptionId}’), resource group (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}’, or resource (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}’. Required.
policy_assignment_name (str) – The name of the policy assignment to delete. Required.
- Returns:
PolicyAssignment or None or the result of cls(response)
- Return type:
PolicyAssignment or None
- Raises:
- delete_by_id(policy_assignment_id: str, **kwargs: Any) PolicyAssignment | None [source]
Deletes a policy assignment.
This operation deletes the policy with the given ID. Policy assignment IDs have this format: ‘{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’. Valid formats for {scope} are: ‘/providers/Microsoft.Management/managementGroups/{managementGroup}’ (management group), ‘/subscriptions/{subscriptionId}’ (subscription), ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}’ (resource group), or ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}’ (resource).
- Parameters:
policy_assignment_id (str) – The ID of the policy assignment to delete. Use the format ‘{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’. Required.
- Returns:
PolicyAssignment or None or the result of cls(response)
- Return type:
PolicyAssignment or None
- Raises:
- get(scope: str, policy_assignment_name: str, **kwargs: Any) PolicyAssignment [source]
Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was created at.
- Parameters:
scope (str) – The scope of the policy assignment. Valid scopes are: management group (format: ‘/providers/Microsoft.Management/managementGroups/{managementGroup}’), subscription (format: ‘/subscriptions/{subscriptionId}’), resource group (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}’, or resource (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}’. Required.
policy_assignment_name (str) – The name of the policy assignment to get. Required.
- Returns:
PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- get_by_id(policy_assignment_id: str, **kwargs: Any) PolicyAssignment [source]
Retrieves the policy assignment with the given ID.
The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: ‘{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’. Valid scopes are: management group (format: ‘/providers/Microsoft.Management/managementGroups/{managementGroup}’), subscription (format: ‘/subscriptions/{subscriptionId}’), resource group (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}’, or resource (format: ‘/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}’.
- Parameters:
policy_assignment_id (str) – The ID of the policy assignment to get. Use the format ‘{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}’. Required.
- Returns:
PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- list(filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyAssignment] [source]
Retrieves all policy assignments that apply to a subscription.
This operation retrieves the list of all policy assignments associated with the given subscription that match the optional given $filter. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy assignments associated with the subscription, including those that apply directly or from management groups that contain the given subscription, as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the subscription, which is everything in the unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the subscription. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value}.
- Parameters:
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- list_for_management_group(management_group_id: str, filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyAssignment] [source]
Retrieves all policy assignments that apply to a management group.
This operation retrieves the list of all policy assignments applicable to the management group that match the given $filter. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the management group or the management group’s ancestors. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the management group.
- Parameters:
management_group_id (str) – The ID of the management group. Required.
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- list_for_resource(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyAssignment] [source]
Retrieves all policy assignments that apply to a resource.
This operation retrieves the list of all policy assignments associated with the specified resource in the given resource group and subscription that match the optional given $filter. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource, including those that apply directly or from all containing scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific resource. If the resource is not part of a parent resource (the more common case), the parent resource path should not be provided (or provided as ‘’). For example a web app could be specified as ({resourceProviderNamespace} == ‘Microsoft.Web’, {parentResourcePath} == ‘’, {resourceType} == ‘sites’, {resourceName} == ‘MyWebApp’). If the resource is part of a parent resource, then all parameters should be provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == ‘Microsoft.Compute’, {parentResourcePath} == ‘virtualMachines/MyVirtualMachine’, {resourceType} == ‘domainNames’, {resourceName} == ‘MyComputerName’). A convenient alternative to providing the namespace and type name separately is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == ‘’, {parentResourcePath} == ‘’, {resourceType} == ‘Microsoft.Web/sites’, {resourceName} == ‘MyWebApp’).
- Parameters:
resource_group_name (str) – The name of the resource group containing the resource. Required.
resource_provider_namespace (str) – The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). Required.
parent_resource_path (str) – The parent resource path. Use empty string if there is none. Required.
resource_type (str) – The resource type name. For example the type name of a web app is ‘sites’ (from Microsoft.Web/sites). Required.
resource_name (str) – The name of the resource. Required.
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- list_for_resource_group(resource_group_name: str, filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyAssignment] [source]
Retrieves all policy assignments that apply to a resource group.
This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource group. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the resource group.
- Parameters:
resource_group_name (str) – The name of the resource group that contains policy assignments. Required.
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atScope()’, ‘atExactScope()’ or ‘policyDefinitionId eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. If $filter=policyDefinitionId eq ‘{value}’ is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyAssignment or the result of cls(response)
- Return type:
- Raises:
- models = <module 'azure.mgmt.resource.policy.v2020_09_01.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.11/site-packages/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py'>
- class azure.mgmt.resource.policy.v2020_09_01.operations.PolicyDefinitionsOperations(*args, **kwargs)[source]
Bases:
object
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
PolicyClient
’spolicy_definitions
attribute.- create_or_update(policy_definition_name: str, parameters: _models.PolicyDefinition, *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyDefinition [source]
- create_or_update(policy_definition_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyDefinition
Creates or updates a policy definition in a subscription.
This operation creates or updates a policy definition in the given subscription with the given name.
- Parameters:
policy_definition_name (str) – The name of the policy definition to create. Required.
parameters (PolicyDefinition or IO[bytes]) – The policy definition properties. Is either a PolicyDefinition type or a IO[bytes] type. Required.
- Returns:
PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- create_or_update_at_management_group(policy_definition_name: str, management_group_id: str, parameters: _models.PolicyDefinition, *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyDefinition [source]
- create_or_update_at_management_group(policy_definition_name: str, management_group_id: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.PolicyDefinition
Creates or updates a policy definition in a management group.
This operation creates or updates a policy definition in the given management group with the given name.
- Parameters:
policy_definition_name (str) – The name of the policy definition to create. Required.
management_group_id (str) – The ID of the management group. Required.
parameters (PolicyDefinition or IO[bytes]) – The policy definition properties. Is either a PolicyDefinition type or a IO[bytes] type. Required.
- Returns:
PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- delete(policy_definition_name: str, **kwargs: Any) None [source]
Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
- Parameters:
policy_definition_name (str) – The name of the policy definition to delete. Required.
- Returns:
None or the result of cls(response)
- Return type:
None
- Raises:
- delete_at_management_group(policy_definition_name: str, management_group_id: str, **kwargs: Any) None [source]
Deletes a policy definition in a management group.
This operation deletes the policy definition in the given management group with the given name.
- Parameters:
- Returns:
None or the result of cls(response)
- Return type:
None
- Raises:
- get(policy_definition_name: str, **kwargs: Any) PolicyDefinition [source]
Retrieves a policy definition in a subscription.
This operation retrieves the policy definition in the given subscription with the given name.
- Parameters:
policy_definition_name (str) – The name of the policy definition to get. Required.
- Returns:
PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- get_at_management_group(policy_definition_name: str, management_group_id: str, **kwargs: Any) PolicyDefinition [source]
Retrieve a policy definition in a management group.
This operation retrieves the policy definition in the given management group with the given name.
- Parameters:
- Returns:
PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- get_built_in(policy_definition_name: str, **kwargs: Any) PolicyDefinition [source]
Retrieves a built-in policy definition.
This operation retrieves the built-in policy definition with the given name.
- Parameters:
policy_definition_name (str) – The name of the built-in policy definition to get. Required.
- Returns:
PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- list(filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyDefinition] [source]
Retrieves policy definitions in a subscription.
This operation retrieves a list of all the policy definitions in a given subscription that match the optional given $filter. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy definitions associated with the subscription, including those that apply directly or from management groups that contain the given subscription. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given subscription. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy definitions whose category match the {value}.
- Parameters:
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy definitions whose category match the {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- list_built_in(filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyDefinition] [source]
Retrieve built-in policy definitions.
This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all built-in policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all built-in policy definitions whose category match the {value}.
- Parameters:
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy definitions whose category match the {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- list_by_management_group(management_group_id: str, filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicyDefinition] [source]
Retrieve policy definitions in a management group.
This operation retrieves a list of all the policy definitions in a given management group that match the optional given $filter. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given management group. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy definitions whose category match the {value}.
- Parameters:
management_group_id (str) – The ID of the management group. Required.
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy definitions whose category match the {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicyDefinition or the result of cls(response)
- Return type:
- Raises:
- models = <module 'azure.mgmt.resource.policy.v2020_09_01.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.11/site-packages/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py'>
- class azure.mgmt.resource.policy.v2020_09_01.operations.PolicySetDefinitionsOperations(*args, **kwargs)[source]
Bases:
object
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
PolicyClient
’spolicy_set_definitions
attribute.- create_or_update(policy_set_definition_name: str, parameters: _models.PolicySetDefinition, *, content_type: str = 'application/json', **kwargs: Any) _models.PolicySetDefinition [source]
- create_or_update(policy_set_definition_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.PolicySetDefinition
Creates or updates a policy set definition.
This operation creates or updates a policy set definition in the given subscription with the given name.
- Parameters:
policy_set_definition_name (str) – The name of the policy set definition to create. Required.
parameters (PolicySetDefinition or IO[bytes]) – The policy set definition properties. Is either a PolicySetDefinition type or a IO[bytes] type. Required.
- Returns:
PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- create_or_update_at_management_group(policy_set_definition_name: str, management_group_id: str, parameters: _models.PolicySetDefinition, *, content_type: str = 'application/json', **kwargs: Any) _models.PolicySetDefinition [source]
- create_or_update_at_management_group(policy_set_definition_name: str, management_group_id: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.PolicySetDefinition
Creates or updates a policy set definition.
This operation creates or updates a policy set definition in the given management group with the given name.
- Parameters:
policy_set_definition_name (str) – The name of the policy set definition to create. Required.
management_group_id (str) – The ID of the management group. Required.
parameters (PolicySetDefinition or IO[bytes]) – The policy set definition properties. Is either a PolicySetDefinition type or a IO[bytes] type. Required.
- Returns:
PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- delete(policy_set_definition_name: str, **kwargs: Any) None [source]
Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
- Parameters:
policy_set_definition_name (str) – The name of the policy set definition to delete. Required.
- Returns:
None or the result of cls(response)
- Return type:
None
- Raises:
- delete_at_management_group(policy_set_definition_name: str, management_group_id: str, **kwargs: Any) None [source]
Deletes a policy set definition.
This operation deletes the policy set definition in the given management group with the given name.
- Parameters:
- Returns:
None or the result of cls(response)
- Return type:
None
- Raises:
- get(policy_set_definition_name: str, **kwargs: Any) PolicySetDefinition [source]
Retrieves a policy set definition.
This operation retrieves the policy set definition in the given subscription with the given name.
- Parameters:
policy_set_definition_name (str) – The name of the policy set definition to get. Required.
- Returns:
PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- get_at_management_group(policy_set_definition_name: str, management_group_id: str, **kwargs: Any) PolicySetDefinition [source]
Retrieves a policy set definition.
This operation retrieves the policy set definition in the given management group with the given name.
- Parameters:
- Returns:
PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- get_built_in(policy_set_definition_name: str, **kwargs: Any) PolicySetDefinition [source]
Retrieves a built in policy set definition.
This operation retrieves the built-in policy set definition with the given name.
- Parameters:
policy_set_definition_name (str) – The name of the policy set definition to get. Required.
- Returns:
PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- list(filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicySetDefinition] [source]
Retrieves the policy set definitions for a subscription.
This operation retrieves a list of all the policy set definitions in a given subscription that match the optional given $filter. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the subscription, including those that apply directly or from management groups that contain the given subscription. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given subscription. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn and Custom. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy set definitions whose category match the {value}.
- Parameters:
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy set definitions whose category match the {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- list_built_in(filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicySetDefinition] [source]
Retrieves built-in policy set definitions.
This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. If $filter=’category -eq {value}’ is provided, the returned list only includes all built-in policy set definitions whose category match the {value}.
- Parameters:
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy set definitions whose category match the {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- list_by_management_group(management_group_id: str, filter: str | None = None, top: int | None = None, **kwargs: Any) Iterable[PolicySetDefinition] [source]
Retrieves all policy set definitions in management group.
This operation retrieves a list of all the policy set definitions in a given management group that match the optional given $filter. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, the unfiltered list includes all policy set definitions associated with the management group, including those that apply directly or from management groups that contain the given management group. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given management group. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn and Custom. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy set definitions whose category match the {value}.
- Parameters:
management_group_id (str) – The ID of the management group. Required.
filter (str) – The filter to apply on the operation. Valid values for $filter are: ‘atExactScope()’, ‘policyType -eq {value}’ or ‘category eq ‘{value}’’. If $filter is not provided, no filtering is performed. If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. If $filter=’policyType -eq {value}’ is provided, the returned list only includes all policy set definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If $filter=’category -eq {value}’ is provided, the returned list only includes all policy set definitions whose category match the {value}. Default value is None.
top (int) – Maximum number of records to return. When the $top filter is not provided, it will return 500 records. Default value is None.
- Returns:
An iterator like instance of either PolicySetDefinition or the result of cls(response)
- Return type:
- Raises:
- models = <module 'azure.mgmt.resource.policy.v2020_09_01.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.11/site-packages/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py'>