TagsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ResourceManagementClient's

<xref:tags> attribute.

Inheritance
builtins.object
TagsOperations

Constructor

TagsOperations(*args, **kwargs)

Methods

create_or_update

Creates a predefined tag name.

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.

create_or_update_at_scope

Creates or updates the entire set of tags on a resource or subscription.

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.

create_or_update_value

Creates a predefined value for a predefined tag name.

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.

delete

Deletes a predefined tag name.

This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.

delete_at_scope

Deletes the entire set of tags on a resource or subscription.

Deletes the entire set of tags on a resource or subscription.

delete_value

Deletes a predefined tag value for a predefined tag name.

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.

get_at_scope

Gets the entire set of tags on a resource or subscription.

Gets the entire set of tags on a resource or subscription.

list

Gets a summary of tag usage under the subscription.

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.

update_at_scope

Selectively updates the set of tags on a resource or subscription.

This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.

create_or_update

Creates a predefined tag name.

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.

create_or_update(tag_name: str, **kwargs: Any) -> TagDetails

Parameters

Name Description
tag_name
Required
str

The name of the tag to create. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

TagDetails or the result of cls(response)

Exceptions

Type Description

create_or_update_at_scope

Creates or updates the entire set of tags on a resource or subscription.

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.

create_or_update_at_scope(scope: str, parameters: _models.TagsResource, *, content_type: str = 'application/json', **kwargs: Any) -> _models.TagsResource

Parameters

Name Description
scope
Required
str

The resource scope. Required.

parameters
Required

Is either a TagsResource 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

TagsResource or the result of cls(response)

Exceptions

Type Description

create_or_update_value

Creates a predefined value for a predefined tag name.

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.

create_or_update_value(tag_name: str, tag_value: str, **kwargs: Any) -> TagValue

Parameters

Name Description
tag_name
Required
str

The name of the tag. Required.

tag_value
Required
str

The value of the tag to create. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

TagValue or the result of cls(response)

Exceptions

Type Description

delete

Deletes a predefined tag name.

This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.

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

Parameters

Name Description
tag_name
Required
str

The name of the tag. 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_scope

Deletes the entire set of tags on a resource or subscription.

Deletes the entire set of tags on a resource or subscription.

delete_at_scope(scope: str, **kwargs: Any) -> None

Parameters

Name Description
scope
Required
str

The resource scope. 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_value

Deletes a predefined tag value for a predefined tag name.

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.

delete_value(tag_name: str, tag_value: str, **kwargs: Any) -> None

Parameters

Name Description
tag_name
Required
str

The name of the tag. Required.

tag_value
Required
str

The value of the tag 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_at_scope

Gets the entire set of tags on a resource or subscription.

Gets the entire set of tags on a resource or subscription.

get_at_scope(scope: str, **kwargs: Any) -> TagsResource

Parameters

Name Description
scope
Required
str

The resource scope. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

TagsResource or the result of cls(response)

Exceptions

Type Description

list

Gets a summary of tag usage under the subscription.

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.

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

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

Exceptions

Type Description

update_at_scope

Selectively updates the set of tags on a resource or subscription.

This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.

update_at_scope(scope: str, parameters: _models.TagsPatchResource, *, content_type: str = 'application/json', **kwargs: Any) -> _models.TagsResource

Parameters

Name Description
scope
Required
str

The resource scope. Required.

parameters
Required

Is either a TagsPatchResource 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

TagsResource or the result of cls(response)

Exceptions

Type Description

Attributes

models

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