tag
Generated on 19 Jun 2025
from digitalocean.cloud
version
v1.2.1
Synopsis
Create or delete tags. A tag is a label that can be applied to a resource (currently Droplets, Images, Volumes, Volume Snapshots, and Database clusters) in order to better organize or facilitate the lookups and actions on it. View the create API documentation at https://docs.digitalocean.com/reference/api/api-reference/#tag/Tags.
Requirements
- pydo >= 0.1.3
- azure-core >= 1.26.1
Parameters
Parameter | Choices / Default | Description |
---|---|---|
client_override_options dict |
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options. | |
module_override_options dict |
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options. | |
name str / required |
The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. Note: Tag names are case stable, which means the capitalization you use when you first create a tag is canonical. When working with tags in the API, you must use the tag’s canonical capitalization. Tagged resources in the control panel will always display the canonical capitalization. For example, if you create a tag named “PROD”, you can tag resources in the control panel by entering “prod”. The tag will still display with its canonical capitalization, “PROD”. | |
state str |
Choices:
|
State of the resource, present to create, absent to destroy. |
timeout int |
Default: 300 |
Polling timeout in seconds. |
token str |
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN , DIGITALOCEAN_TOKEN , DO_API_TOKEN , DO_API_KEY , DO_OAUTH_TOKEN and OAUTH_TOKEN |
Examples
- name: Create tag
digitalocean.cloud.tag:
token: "{{ token }}"
state: present
name: extra-awesome
Return Values
Key | Returned | Description |
---|---|---|
error dict |
failure | DigitalOcean API error. Sample:
|
msg str |
always | Droplet result information. Sample:
|
tag dict |
always | Tag information. Sample:
|