pydo.droplet_actions.post_by_tag()

Generated on 8 May 2026 from pydo version v0.34.0

Usage

client.droplet_actions.post_by_tag(
    tag_name=None,
    body={
        "type": "reboot",
        "name": "Nifty New Snapshot",
    },
)
Returns JSONRaises HttpResponseError

Description

Some actions can be performed in bulk on tagged Droplets. The actions can be initiated by sending a POST to /v2/droplets/actions?tag_name=$TAG_NAME with the action arguments.

Only a sub-set of action types are supported:

  • power_cycle
  • power_on
  • power_off
  • shutdown
  • enable_ipv6
  • enable_backups
  • disable_backups
  • snapshot (also requires image:create permission)

Parameters

tag_name string optional

Used to filter Droplets by a specific tag. Can not be combined with name or type.
Requires tag:read scope.

type string required

The type of action to initiate for the Droplet.

One of: enable_backups, disable_backups, reboot, power_cycle, shutdown, power_off, power_on, restore, password_reset, resize, rebuild, rename, change_kernel, enable_ipv6, snapshot

name string optional

Example: Nifty New Snapshot

The name to give the new snapshot of the Droplet.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
"type": "enable_backups"
}

resp = client.droplet_actions.post_by_tag(tag_name="production",body=req)

Response Example

Show Response Example
{
  "actions": [
    {
      "id": 36804636,
      "status": "completed",
      "type": "create",
      "started_at": "2020-11-14T16:29:21Z",
      "completed_at": "2020-11-14T16:30:06Z",
      "resource_id": 3164444,
      "resource_type": "droplet",
      "region_slug": "nyc3"
    }
  ]
}

More Information

See /v2/droplets/actions in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.