azure.mgmt.resource.policy.v2022_08_01_preview.operations module

class azure.mgmt.resource.policy.v2022_08_01_preview.operations.VariableValuesOperations(*args, **kwargs)[source]

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through PolicyClient’s variable_values attribute.

create_or_update(variable_name: str, variable_value_name: str, parameters: _models.VariableValue, *, content_type: str = 'application/json', **kwargs: Any) _models.VariableValue[source]
create_or_update(variable_name: str, variable_value_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.VariableValue

Creates or updates a variable value.

This operation creates or updates a variable value with the given subscription and name for a given variable. Variable values are scoped to the variable for which they are created for.

Parameters:
  • variable_name (str) – The name of the variable to operate on. Required.

  • variable_value_name (str) – The name of the variable value to operate on. Required.

  • parameters (VariableValue or IO[bytes]) – Parameters for the variable value. Is either a VariableValue type or a IO[bytes] type. Required.

Returns:

VariableValue or the result of cls(response)

Return type:

VariableValue

Raises:

HttpResponseError

create_or_update_at_management_group(management_group_id: str, variable_name: str, variable_value_name: str, parameters: _models.VariableValue, *, content_type: str = 'application/json', **kwargs: Any) _models.VariableValue[source]
create_or_update_at_management_group(management_group_id: str, variable_name: str, variable_value_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.VariableValue

Creates or updates a variable value.

This operation creates or updates a variable value with the given management group and name for a given variable. Variable values are scoped to the variable for which they are created for.

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

  • variable_value_name (str) – The name of the variable value to operate on. Required.

  • parameters (VariableValue or IO[bytes]) – Parameters for the variable value. Is either a VariableValue type or a IO[bytes] type. Required.

Returns:

VariableValue or the result of cls(response)

Return type:

VariableValue

Raises:

HttpResponseError

delete(variable_name: str, variable_value_name: str, **kwargs: Any) None[source]

Deletes a variable value.

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

Parameters:
  • variable_name (str) – The name of the variable to operate on. Required.

  • variable_value_name (str) – The name of the variable value to operate on. Required.

Returns:

None or the result of cls(response)

Return type:

None

Raises:

HttpResponseError

delete_at_management_group(management_group_id: str, variable_name: str, variable_value_name: str, **kwargs: Any) None[source]

Deletes a variable value.

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

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

  • variable_value_name (str) – The name of the variable value to operate on. Required.

Returns:

None or the result of cls(response)

Return type:

None

Raises:

HttpResponseError

get(variable_name: str, variable_value_name: str, **kwargs: Any) VariableValue[source]

Retrieves a variable value.

This operation retrieves a single variable value; given its name, subscription it was created at and the variable it’s created for.

Parameters:
  • variable_name (str) – The name of the variable to operate on. Required.

  • variable_value_name (str) – The name of the variable value to operate on. Required.

Returns:

VariableValue or the result of cls(response)

Return type:

VariableValue

Raises:

HttpResponseError

get_at_management_group(management_group_id: str, variable_name: str, variable_value_name: str, **kwargs: Any) VariableValue[source]

Retrieves a variable value.

This operation retrieves a single variable value; given its name, management group it was created at and the variable it’s created for.

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

  • variable_value_name (str) – The name of the variable value to operate on. Required.

Returns:

VariableValue or the result of cls(response)

Return type:

VariableValue

Raises:

HttpResponseError

list(variable_name: str, **kwargs: Any) Iterable[VariableValue][source]

List variable values for a variable.

This operation retrieves the list of all variable values associated with the given variable that is at a subscription level.

Parameters:

variable_name (str) – The name of the variable to operate on. Required.

Returns:

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

Return type:

ItemPaged[VariableValue]

Raises:

HttpResponseError

list_for_management_group(management_group_id: str, variable_name: str, **kwargs: Any) Iterable[VariableValue][source]

List variable values at management group level.

This operation retrieves the list of all variable values applicable the variable indicated at the management group scope.

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

Returns:

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

Return type:

ItemPaged[VariableValue]

Raises:

HttpResponseError

models = <module 'azure.mgmt.resource.policy.v2022_08_01_preview.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.11/site-packages/azure/mgmt/resource/policy/v2022_08_01_preview/models/__init__.py'>
class azure.mgmt.resource.policy.v2022_08_01_preview.operations.VariablesOperations(*args, **kwargs)[source]

Bases: object

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through PolicyClient’s variables attribute.

create_or_update(variable_name: str, parameters: _models.Variable, *, content_type: str = 'application/json', **kwargs: Any) _models.Variable[source]
create_or_update(variable_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.Variable

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.

Parameters:
  • variable_name (str) – The name of the variable to operate on. Required.

  • parameters (Variable or IO[bytes]) – Parameters for the variable. Is either a Variable type or a IO[bytes] type. Required.

Returns:

Variable or the result of cls(response)

Return type:

Variable

Raises:

HttpResponseError

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[source]
create_or_update_at_management_group(management_group_id: str, variable_name: str, parameters: IO[bytes], *, content_type: str = 'application/json', **kwargs: Any) _models.Variable

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.

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

  • parameters (Variable or IO[bytes]) – Parameters for the variable. Is either a Variable type or a IO[bytes] type. Required.

Returns:

Variable or the result of cls(response)

Return type:

Variable

Raises:

HttpResponseError

delete(variable_name: str, **kwargs: Any) None[source]

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}’.

Parameters:

variable_name (str) – The name of the variable to operate on. Required.

Returns:

None or the result of cls(response)

Return type:

None

Raises:

HttpResponseError

delete_at_management_group(management_group_id: str, variable_name: str, **kwargs: Any) None[source]

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}’.

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

Returns:

None or the result of cls(response)

Return type:

None

Raises:

HttpResponseError

get(variable_name: str, **kwargs: Any) Variable[source]

Retrieves a variable.

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

Parameters:

variable_name (str) – The name of the variable to operate on. Required.

Returns:

Variable or the result of cls(response)

Return type:

Variable

Raises:

HttpResponseError

get_at_management_group(management_group_id: str, variable_name: str, **kwargs: Any) Variable[source]

Retrieves a variable.

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

Parameters:
  • management_group_id (str) – The ID of the management group. Required.

  • variable_name (str) – The name of the variable to operate on. Required.

Returns:

Variable or the result of cls(response)

Return type:

Variable

Raises:

HttpResponseError

list(**kwargs: Any) Iterable[Variable][source]

Retrieves all variables that are at this subscription level.

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

Returns:

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

Return type:

ItemPaged[Variable]

Raises:

HttpResponseError

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

Retrieves all variables that are at this management group level.

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

Parameters:

management_group_id (str) – The ID of the management group. Required.

Returns:

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

Return type:

ItemPaged[Variable]

Raises:

HttpResponseError

models = <module 'azure.mgmt.resource.policy.v2022_08_01_preview.models' from '/mnt/vss/_work/1/s/sdk/resources/azure-mgmt-resource/.tox/sphinx/lib/python3.11/site-packages/azure/mgmt/resource/policy/v2022_08_01_preview/models/__init__.py'>