PolicyDefinitionsOperations Class

PolicyDefinitionsOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
PolicyDefinitionsOperations

Constructor

PolicyDefinitionsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

create_or_update

Creates or updates a policy definition.

delete

Deletes a policy definition.

get

Gets the policy definition.

list

Gets all the policy definitions for a subscription.

create_or_update

Creates or updates a policy definition.

async create_or_update(policy_definition_name: str, parameters: azure.mgmt.resource.policy.v2016_04_01.models._models_py3.PolicyDefinition, *, content_type: Optional[str] = 'application/json', **kwargs: Any) -> azure.mgmt.resource.policy.v2016_04_01.models._models_py3.PolicyDefinition

Parameters

policy_definition_name
str
Required

The name of the policy definition to create.

parameters
PolicyDefinition
Required

The policy definition properties.

content_type
str

Media type of the body sent to the API. Possible values are: "application/json" or "text/json". Default value is "application/json".

cls
callable

A custom type or function that will be passed the direct response

Returns

PolicyDefinition, or the result of cls(response)

Return type

Exceptions

delete

Deletes a policy definition.

async delete(policy_definition_name: str, **kwargs: Any) -> None

Parameters

policy_definition_name
str
Required

The name of the policy definition to delete.

cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

get

Gets the policy definition.

async get(policy_definition_name: str, **kwargs: Any) -> azure.mgmt.resource.policy.v2016_04_01.models._models_py3.PolicyDefinition

Parameters

policy_definition_name
str
Required

The name of the policy definition to get.

cls
callable

A custom type or function that will be passed the direct response

Returns

PolicyDefinition, or the result of cls(response)

Return type

Exceptions

list

Gets all the policy definitions for a subscription.

list(filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.resource.policy.v2016_04_01.models._models_py3.PolicyDefinitionListResult]

Parameters

filter
str
Required

The filter to apply on the operation. Default value is None.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either PolicyDefinitionListResult or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.resource.policy.v2016_04_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\resource\\policy\\v2016_04_01\\models\\__init__.py'>