To create a tag you can send a POST request to /v2/tags
with a name
attribute.
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"tag": {
"name": "extra-awesome",
"resources": {
"count": 0,
"droplets": {
"count": 0
},
"images": {
"count": 0
},
"volumes": {
"count": 0
},
"volume_snapshots": {
"count": 0
},
"databases": {
"count": 0
}
}
}
}
resp = client.tags.create(body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.