azure.mgmt.resource.policy.v2015_10_01_preview.operations module¶
-
class
azure.mgmt.resource.policy.v2015_10_01_preview.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, *, content_type: str = "'application/json'", **kwargs: Any) → _models.PolicyAssignment Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.
- Parameters
scope (str) – The scope of the policy assignment. Required.
policy_assignment_name (str) – The name of the policy assignment. Required.
parameters (PolicyAssignment or IO) – Parameters for the policy assignment. Is either a PolicyAssignment type or a IO type. Required.
- Keyword Arguments
- 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, *, content_type: str = "'application/json'", **kwargs: Any) → _models.PolicyAssignment Creates a policy assignment by ID.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assignment, use ‘/subscriptions/{subscription-id}/’ for subscriptions, ‘/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}’ for resource groups, and ‘/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}’ for resources.
- Parameters
policy_assignment_id (str) – The ID of the policy assignment to create. Use the format ‘/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}’. Required.
parameters (PolicyAssignment or IO) – Parameters for policy assignment. Is either a PolicyAssignment type or a IO type. Required.
- Keyword Arguments
- Returns
PolicyAssignment or the result of cls(response)
- Return type
- Raises
-
delete
(scope: str, policy_assignment_name: str, **kwargs: Any) → azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment[source]¶ Deletes a policy assignment.
- Parameters
- Keyword Arguments
cls (callable) – A custom type or function that will be passed the direct response
- Returns
PolicyAssignment or the result of cls(response)
- Return type
- Raises
-
delete_by_id
(policy_assignment_id: str, **kwargs: Any) → azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment[source]¶ Deletes a policy assignment by ID.
When providing a scope for the assignment, use ‘/subscriptions/{subscription-id}/’ for subscriptions, ‘/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}’ for resource groups, and ‘/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}’ for resources.
- Parameters
policy_assignment_id (str) – The ID of the policy assignment to delete. Use the format ‘/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}’. Required.
- Keyword Arguments
cls (callable) – A custom type or function that will be passed the direct response
- Returns
PolicyAssignment or the result of cls(response)
- Return type
- Raises
-
get
(scope: str, policy_assignment_name: str, **kwargs: Any) → azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment[source]¶ Gets a policy assignment.
- Parameters
- Keyword Arguments
cls (callable) – A custom type or function that will be passed the direct response
- Returns
PolicyAssignment or the result of cls(response)
- Return type
- Raises
-
get_by_id
(policy_assignment_id: str, **kwargs: Any) → azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment[source]¶ Gets a policy assignment by ID.
When providing a scope for the assignment, use ‘/subscriptions/{subscription-id}/’ for subscriptions, ‘/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}’ for resource groups, and ‘/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}’ for resources.
- Parameters
policy_assignment_id (str) – The ID of the policy assignment to get. Use the format ‘/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}’. Required.
- Keyword Arguments
cls (callable) – A custom type or function that will be passed the direct response
- Returns
PolicyAssignment or the result of cls(response)
- Return type
- Raises
-
list
(filter: Optional[str] = None, **kwargs: Any) → Iterable[azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment][source]¶ Gets all the policy assignments for a subscription.
-
list_for_resource
(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, filter: Optional[str] = None, **kwargs: Any) → Iterable[azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment][source]¶ Gets policy assignments for a resource.
- Parameters
resource_group_name (str) – The name of the resource group containing the resource. The name is case insensitive. Required.
resource_provider_namespace (str) – The namespace of the resource provider. Required.
parent_resource_path (str) – The parent resource path. Required.
resource_type (str) – The resource type. Required.
resource_name (str) – The name of the resource with policy assignments. Required.
filter (str) – The filter to apply on the operation. Default value is None.
- Keyword Arguments
cls (callable) – A custom type or function that will be passed the direct response
- 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: Optional[str] = None, **kwargs: Any) → Iterable[azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyAssignment][source]¶ Gets policy assignments for the resource group.
- Parameters
- Keyword Arguments
cls (callable) – A custom type or function that will be passed the direct response
- Returns
An iterator like instance of either PolicyAssignment or the result of cls(response)
- Return type
- Raises
-
models
= <module 'azure.mgmt.resource.policy.v2015_10_01_preview.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.9/site-packages/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py'>¶
-
-
class
azure.mgmt.resource.policy.v2015_10_01_preview.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, *, content_type: str = "'application/json'", **kwargs: Any) → _models.PolicyDefinition Creates or updates a policy definition.
- Parameters
policy_definition_name (str) – The name of the policy definition to create. Required.
parameters (PolicyDefinition or IO) – The policy definition properties. Is either a PolicyDefinition type or a IO type. Required.
- Keyword Arguments
- Returns
PolicyDefinition or the result of cls(response)
- Return type
- Raises
-
delete
(policy_definition_name: str, **kwargs: Any) → None[source]¶ Deletes a policy definition.
-
get
(policy_definition_name: str, **kwargs: Any) → azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyDefinition[source]¶ Gets the policy definition.
-
list
(filter: Optional[str] = None, **kwargs: Any) → Iterable[azure.mgmt.resource.policy.v2015_10_01_preview.models._models_py3.PolicyDefinition][source]¶ Gets all the policy definitions for a subscription.
-
models
= <module 'azure.mgmt.resource.policy.v2015_10_01_preview.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.9/site-packages/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py'>¶
-