pydo.image_actions.post()

Generated on 24 Apr 2025 from pydo version v0.10.0

Description

The following actions are available on an Image.

Convert an Image to a Snapshot

To convert an image, for example, a backup to a snapshot, send a POST request to /v2/images/$IMAGE_ID/actions. Set the type attribute to convert.

Transfer an Image

To transfer an image to another region, send a POST request to /v2/images/$IMAGE_ID/actions. Set the type attribute to transfer and set region attribute to the slug identifier of the region you wish to transfer to.

Parameters

Name Type Required Description Default Value
image_id integer True A unique number that can be used to identify and reference a specific image.
body JSON or IO[bytes] False

Request Sample

import os
from pydo import Client

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

req = {
  "type": "convert"
}
resp = client.image_actions.post(image_id=342341, body=req)

More Information

See the API spec for this endpoint to view 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.