azure.mgmt.resource.policy.v2016_12_01.operations module¶
-
class
azure.mgmt.resource.policy.v2016_12_01.operations.
PolicyDefinitionsOperations
(client, config, serializer, deserializer)[source]¶ Bases:
object
PolicyDefinitionsOperations operations.
You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.
- Parameters
client – Client for service requests.
config – Configuration of service client.
serializer – An object model serializer.
deserializer – An object model deserializer.
- Variables
api_version – The API version to use for the operation. Constant value: “2016-12-01”.
-
create_or_update
(policy_definition_name, parameters, custom_headers=None, raw=False, **operation_config)[source]¶ Creates or updates a policy definition.
- Parameters
policy_definition_name (str) – The name of the policy definition to create.
parameters (PolicyDefinition) – The policy definition properties.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyDefinition or ClientRawResponse if raw=true
- Return type
PolicyDefinition or ClientRawResponse
- Raises
CloudError
-
create_or_update_at_management_group
(policy_definition_name, parameters, management_group_id, custom_headers=None, raw=False, **operation_config)[source]¶ Creates or updates a policy definition at management group level.
- Parameters
policy_definition_name (str) – The name of the policy definition to create.
parameters (PolicyDefinition) – The policy definition properties.
management_group_id (str) – The ID of the management group.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyDefinition or ClientRawResponse if raw=true
- Return type
PolicyDefinition or ClientRawResponse
- Raises
CloudError
-
delete
(policy_definition_name, custom_headers=None, raw=False, **operation_config)[source]¶ Deletes a policy definition.
- Parameters
- Returns
None or ClientRawResponse if raw=true
- Return type
None or ClientRawResponse
- Raises
CloudError
-
delete_at_management_group
(policy_definition_name, management_group_id, custom_headers=None, raw=False, **operation_config)[source]¶ Deletes a policy definition at management group level.
- Parameters
policy_definition_name (str) – The name of the policy definition to delete.
management_group_id (str) – The ID of the management group.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
None or ClientRawResponse if raw=true
- Return type
None or ClientRawResponse
- Raises
CloudError
-
get
(policy_definition_name, custom_headers=None, raw=False, **operation_config)[source]¶ Gets the policy definition.
- Parameters
- Returns
PolicyDefinition or ClientRawResponse if raw=true
- Return type
PolicyDefinition or ClientRawResponse
- Raises
CloudError
-
get_at_management_group
(policy_definition_name, management_group_id, custom_headers=None, raw=False, **operation_config)[source]¶ Gets the policy definition at management group level.
- Parameters
policy_definition_name (str) – The name of the policy definition to get.
management_group_id (str) – The ID of the management group.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyDefinition or ClientRawResponse if raw=true
- Return type
PolicyDefinition or ClientRawResponse
- Raises
CloudError
-
get_built_in
(policy_definition_name, custom_headers=None, raw=False, **operation_config)[source]¶ Gets the built in policy definition.
- Parameters
- Returns
PolicyDefinition or ClientRawResponse if raw=true
- Return type
PolicyDefinition or ClientRawResponse
- Raises
CloudError
-
list
(custom_headers=None, raw=False, **operation_config)[source]¶ Gets all the policy definitions for a subscription.
- Parameters
- Returns
An iterator like instance of PolicyDefinition
- Return type
- Raises
CloudError
-
list_built_in
(custom_headers=None, raw=False, **operation_config)[source]¶ Gets all the built in policy definitions.
- Parameters
- Returns
An iterator like instance of PolicyDefinition
- Return type
- Raises
CloudError
-
list_by_management_group
(management_group_id, custom_headers=None, raw=False, **operation_config)[source]¶ Gets all the policy definitions for a subscription at management group level.
- Parameters
- Returns
An iterator like instance of PolicyDefinition
- Return type
- Raises
CloudError
-
models
= <module 'azure.mgmt.resource.policy.v2016_12_01.models' from '/usr/lib/python3/dist-packages/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py'>¶
-
class
azure.mgmt.resource.policy.v2016_12_01.operations.
PolicyAssignmentsOperations
(client, config, serializer, deserializer)[source]¶ Bases:
object
PolicyAssignmentsOperations operations.
You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute.
- Parameters
client – Client for service requests.
config – Configuration of service client.
serializer – An object model serializer.
deserializer – An object model deserializer.
- Variables
api_version – The API version to use for the operation. Constant value: “2016-12-01”.
-
create
(scope, policy_assignment_name, parameters, custom_headers=None, raw=False, **operation_config)[source]¶ 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.
policy_assignment_name (str) – The name of the policy assignment.
parameters (PolicyAssignment) – Parameters for the policy assignment.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyAssignment or ClientRawResponse if raw=true
- Return type
PolicyAssignment or ClientRawResponse
- Raises
CloudError
-
create_by_id
(policy_assignment_id, parameters, custom_headers=None, raw=False, **operation_config)[source]¶ 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}’.
parameters (PolicyAssignment) – Parameters for policy assignment.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyAssignment or ClientRawResponse if raw=true
- Return type
PolicyAssignment or ClientRawResponse
- Raises
CloudError
-
delete
(scope, policy_assignment_name, custom_headers=None, raw=False, **operation_config)[source]¶ Deletes a policy assignment.
- Parameters
scope (str) – The scope of the policy assignment.
policy_assignment_name (str) – The name of the policy assignment to delete.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyAssignment or ClientRawResponse if raw=true
- Return type
PolicyAssignment or ClientRawResponse
- Raises
CloudError
-
delete_by_id
(policy_assignment_id, custom_headers=None, raw=False, **operation_config)[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}’.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyAssignment or ClientRawResponse if raw=true
- Return type
PolicyAssignment or ClientRawResponse
- Raises
CloudError
-
get
(scope, policy_assignment_name, custom_headers=None, raw=False, **operation_config)[source]¶ Gets a policy assignment.
- Parameters
scope (str) – The scope of the policy assignment.
policy_assignment_name (str) – The name of the policy assignment to get.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyAssignment or ClientRawResponse if raw=true
- Return type
PolicyAssignment or ClientRawResponse
- Raises
CloudError
-
get_by_id
(policy_assignment_id, custom_headers=None, raw=False, **operation_config)[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}’.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
PolicyAssignment or ClientRawResponse if raw=true
- Return type
PolicyAssignment or ClientRawResponse
- Raises
CloudError
-
list
(filter=None, custom_headers=None, raw=False, **operation_config)[source]¶ Gets all the policy assignments for a subscription.
- Parameters
- Returns
An iterator like instance of PolicyAssignment
- Return type
- Raises
CloudError
-
list_for_resource
(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, filter=None, custom_headers=None, raw=False, **operation_config)[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.
resource_provider_namespace (str) – The namespace of the resource provider.
parent_resource_path (str) – The parent resource path.
resource_type (str) – The resource type.
resource_name (str) – The name of the resource with policy assignments.
filter (str) – The filter to apply on the operation.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
An iterator like instance of PolicyAssignment
- Return type
- Raises
CloudError
-
list_for_resource_group
(resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config)[source]¶ Gets policy assignments for the resource group.
- Parameters
resource_group_name (str) – The name of the resource group that contains policy assignments.
filter (str) – The filter to apply on the operation.
custom_headers (dict) – headers that will be added to the request
raw (bool) – returns the direct response alongside the deserialized response
operation_config – Operation configuration overrides.
- Returns
An iterator like instance of PolicyAssignment
- Return type
- Raises
CloudError
-
models
= <module 'azure.mgmt.resource.policy.v2016_12_01.models' from '/usr/lib/python3/dist-packages/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py'>¶