TagsOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:tags> attribute.
- Inheritance
-
builtins.objectTagsOperations
Constructor
TagsOperations(*args, **kwargs)
Methods
create_or_update |
Creates a tag in the subscription. The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes. |
create_or_update_value |
Creates a tag value. The name of the tag must already exist. |
delete |
Deletes a tag from the subscription. You must remove all values from a resource tag before you can delete it. |
delete_value |
Deletes a tag value. |
list |
Gets the names and values of all resource tags that are defined in a subscription. |
create_or_update
Creates a tag in the subscription.
The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes.
create_or_update(tag_name: str, **kwargs: Any) -> TagDetails
Parameters
Name | Description |
---|---|
tag_name
Required
|
The name of the tag to create. Required. |
Returns
Type | Description |
---|---|
TagDetails or the result of cls(response) |
Exceptions
Type | Description |
---|---|
create_or_update_value
Creates a tag value. The name of the tag must already exist.
create_or_update_value(tag_name: str, tag_value: str, **kwargs: Any) -> TagValue
Parameters
Name | Description |
---|---|
tag_name
Required
|
The name of the tag. Required. |
tag_value
Required
|
The value of the tag to create. Required. |
Returns
Type | Description |
---|---|
TagValue or the result of cls(response) |
Exceptions
Type | Description |
---|---|
delete
Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
delete(tag_name: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
tag_name
Required
|
The name of the tag. Required. |
Returns
Type | Description |
---|---|
None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
delete_value
Deletes a tag value.
delete_value(tag_name: str, tag_value: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
tag_name
Required
|
The name of the tag. Required. |
tag_value
Required
|
The value of the tag to delete. Required. |
Returns
Type | Description |
---|---|
None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list
Gets the names and values of all resource tags that are defined in a subscription.
list(**kwargs: Any) -> Iterable[TagDetails]
Returns
Type | Description |
---|---|
An iterator like instance of either TagDetails or the result of cls(response) |
Exceptions
Type | Description |
---|---|
Attributes
models
models = <module 'azure.mgmt.resource.resources.v2019_07_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\resource\\resources\\v2019_07_01\\models\\__init__.py'>
Azure SDK for Python