droplet_action_snapshot

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.
droplet_id
(int)
A unique identifier for a Droplet instance. If provided, name and region are ignore.
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 Droplet to act on. If provided, must be unique and given with region.
region
(str)
The name of the Droplet to act on. Required with name.
snapshot_name
(str)
The name to give the new snapshot of the Droplet.
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: Snapshot a Droplet
  digitalocean.cloud.droplet_action_snapshot:
    token: "{{ token }}"
    state: present
    name: my-droplet
    region: nyc3
    snapshot_name: my-droplet-snapshot

Return Values

Key Returned Description
action
(dict)
always DigitalOcean snapshot action information.

Sample:

{
  "completed_at": "2020-11-14T16:30:06Z",
  "id": 36804636,
  "region": {
    "available": true,
    "features": [
      "private_networking",
      "backups",
      "ipv6",
      "metadata",
      "install_agent",
      "storage",
      "image_transfer"
    ],
    "name": "New York 3",
    "sizes": [
      "s-1vcpu-1gb",
      "s-1vcpu-2gb",
      "s-1vcpu-3gb",
      "s-2vcpu-2gb",
      "s-3vcpu-1gb",
      "s-2vcpu-4gb",
      "s-4vcpu-8gb",
      "s-6vcpu-16gb",
      "s-8vcpu-32gb",
      "s-12vcpu-48gb",
      "s-16vcpu-64gb",
      "s-20vcpu-96gb",
      "s-24vcpu-128gb",
      "s-32vcpu-192g"
    ],
    "slug": "nyc3"
  },
  "region_slug": "string",
  "resource_id": 3164444,
  "resource_type": "droplet",
  "started_at": "2020-11-14T16:29:21Z",
  "status": "completed",
  "type": "create"
}
error
(dict)
failure DigitalOcean API error.

Sample:

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

Sample:

[
  "No Droplet with ID 336851565",
  "No Droplet with name test-droplet-1 in nyc3",
  "Droplet test-droplet-1 (336851565) in nyc3 would be sent action \u0027snapshot\u0027",
  "Droplet test-droplet-1 (336851565) in nyc3 sent action \u0027snapshot\u0027",
  "Droplet test-droplet-1 (336851565) in nyc3 sent action \u0027snapshot\u0027 and it has not completed, status is \u0027in-progress\u0027"
]