PolicyDefinitionsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

PolicyClient's

<xref:policy_definitions> attribute.

Inheritance
builtins.object
PolicyDefinitionsOperations

Constructor

PolicyDefinitionsOperations(*args, **kwargs)

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.

create_or_update(policy_definition_name: str, parameters: _models.PolicyDefinition, *, content_type: str = 'application/json', **kwargs: Any) -> _models.PolicyDefinition

Parameters

Name Description
policy_definition_name
Required
str

The name of the policy definition to create. Required.

parameters
Required

The policy definition properties. Is either a PolicyDefinition type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json', 'text/json'. Default value is None.

cls

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

Returns

Type Description

PolicyDefinition or the result of cls(response)

Exceptions

Type Description

delete

Deletes a policy definition.

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

Parameters

Name Description
policy_definition_name
Required
str

The name of the policy definition to delete. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

None or the result of cls(response)

Exceptions

Type Description

get

Gets the policy definition.

get(policy_definition_name: str, **kwargs: Any) -> PolicyDefinition

Parameters

Name Description
policy_definition_name
Required
str

The name of the policy definition to get. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

PolicyDefinition or the result of cls(response)

Exceptions

Type Description

list

Gets all the policy definitions for a subscription.

list(filter: str | None = None, **kwargs: Any) -> Iterable[PolicyDefinition]

Parameters

Name Description
filter
Required
str

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

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

Attributes

models

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