VariablesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

PolicyClient's

<xref:variables> attribute.

Inheritance
builtins.object
VariablesOperations

Constructor

VariablesOperations(*args, **kwargs)

Methods

create_or_update

Creates or updates a variable.

This operation creates or updates a variable with the given subscription and name. Policy variables can only be used by a policy definition at the scope they are created or below.

create_or_update_at_management_group

Creates or updates a variable.

This operation creates or updates a variable with the given management group and name. Policy variables can only be used by a policy definition at the scope they are created or below.

delete

Deletes a variable.

This operation deletes a variable, given its name and the subscription it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.

delete_at_management_group

Deletes a variable.

This operation deletes a variable, given its name and the management group it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.

get

Retrieves a variable.

This operation retrieves a single variable, given its name and the subscription it was created at.

get_at_management_group

Retrieves a variable.

This operation retrieves a single variable, given its name and the management group it was created at.

list

Retrieves all variables that are at this subscription level.

This operation retrieves the list of all variables associated with the given subscription.

list_for_management_group

Retrieves all variables that are at this management group level.

This operation retrieves the list of all variables applicable to the management group.

create_or_update

Creates or updates a variable.

This operation creates or updates a variable with the given subscription and name. Policy variables can only be used by a policy definition at the scope they are created or below.

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

Parameters

Name Description
variable_name
Required
str

The name of the variable to operate on. Required.

parameters
Required

Parameters for the variable. Is either a Variable type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

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

cls

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

Returns

Type Description

Variable or the result of cls(response)

Exceptions

Type Description

create_or_update_at_management_group

Creates or updates a variable.

This operation creates or updates a variable with the given management group and name. Policy variables can only be used by a policy definition at the scope they are created or below.

create_or_update_at_management_group(management_group_id: str, variable_name: str, parameters: _models.Variable, *, content_type: str = 'application/json', **kwargs: Any) -> _models.Variable

Parameters

Name Description
management_group_id
Required
str

The ID of the management group. Required.

variable_name
Required
str

The name of the variable to operate on. Required.

parameters
Required

Parameters for the variable. Is either a Variable type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

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

cls

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

Returns

Type Description

Variable or the result of cls(response)

Exceptions

Type Description

delete

Deletes a variable.

This operation deletes a variable, given its name and the subscription it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.

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

Parameters

Name Description
variable_name
Required
str

The name of the variable to operate on. 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

delete_at_management_group

Deletes a variable.

This operation deletes a variable, given its name and the management group it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.

delete_at_management_group(management_group_id: str, variable_name: str, **kwargs: Any) -> None

Parameters

Name Description
management_group_id
Required
str

The ID of the management group. Required.

variable_name
Required
str

The name of the variable to operate on. 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

Retrieves a variable.

This operation retrieves a single variable, given its name and the subscription it was created at.

get(variable_name: str, **kwargs: Any) -> Variable

Parameters

Name Description
variable_name
Required
str

The name of the variable to operate on. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

Variable or the result of cls(response)

Exceptions

Type Description

get_at_management_group

Retrieves a variable.

This operation retrieves a single variable, given its name and the management group it was created at.

get_at_management_group(management_group_id: str, variable_name: str, **kwargs: Any) -> Variable

Parameters

Name Description
management_group_id
Required
str

The ID of the management group. Required.

variable_name
Required
str

The name of the variable to operate on. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

Variable or the result of cls(response)

Exceptions

Type Description

list

Retrieves all variables that are at this subscription level.

This operation retrieves the list of all variables associated with the given subscription.

list(**kwargs: Any) -> Iterable[Variable]

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 Variable or the result of cls(response)

Exceptions

Type Description

list_for_management_group

Retrieves all variables that are at this management group level.

This operation retrieves the list of all variables applicable to the management group.

list_for_management_group(management_group_id: str, **kwargs: Any) -> Iterable[Variable]

Parameters

Name Description
management_group_id
Required
str

The ID of the management group. Required.

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 Variable or the result of cls(response)

Exceptions

Type Description

Attributes

models

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