tag

Synopsis

Requirements

  • pydo >= 0.1.3
  • azure-core >= 1.26.1

Parameters

Parameter Choices Default Comments
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)
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)
  • present
  • absent
present State of the resource, present to create, absent to destroy.
timeout
(int)
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:

{
  "Message": "Informational error message.",
  "Reason": "Unauthorized",
  "Status Code": 401
}
msg
(str)
always Droplet result information.

Sample:

[
  "Created tag extra-awesome",
  "Deleted tag extra-awesome",
  "Tag extra-awesome would be created",
  "Tag extra-awesome exists",
  "Tag extra-awesome does not exist",
  "Tag extra-awesome deleted"
]
tag
(dict)
always Tag information.

Sample:

{
  "name": "extra-awesome",
  "resources": {
    "count": 0,
    "databases": {
      "count": 0
    },
    "droplets": {
      "count": 0
    },
    "images": {
      "count": 0
    },
    "volume_snapshots": {
      "count": 0
    },
    "volumes": {
      "count": 0
    }
  }
}
In this article...