Skip to main content

actions

Creates, updates, deletes, gets or lists a actions resource.

Overview

Nameactions
TypeResource
Iddigitalocean.images.actions

Fields

NameDatatypeDescription
idintegerA unique numeric ID that can be used to identify and reference an action.
completed_atstringA time value given in ISO8601 combined date and time format that represents when the action was completed.
regionobject
region_slugstringA human-readable string that is used as a unique identifier for each region.
resource_idintegerA unique identifier for the resource that the action is associated with.
resource_typestringThe type of resource that the action is associated with.
started_atstringA time value given in ISO8601 combined date and time format that represents when the action was initiated.
statusstringThe current status of the action. This can be "in-progress", "completed", or "errored".
typestringThis is the type of action that the object represents. For example, this could be "transfer" to represent the state of an image transfer action.

Methods

NameAccessible byRequired ParamsDescription
image_actions_getSELECTaction_id, image_idTo retrieve the status of an image action, send a GET request to /v2/images/$IMAGE_ID/actions/$IMAGE_ACTION_ID.
image_actions_listSELECTimage_idTo retrieve all actions that have been executed on an image, send a GET request to /v2/images/$IMAGE_ID/actions.
image_actions_postEXECimage_idThe 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.

SELECT examples

To retrieve all actions that have been executed on an image, send a GET request to /v2/images/$IMAGE_ID/actions.

SELECT
id,
completed_at,
region,
region_slug,
resource_id,
resource_type,
started_at,
status,
type
FROM digitalocean.images.actions
WHERE image_id = '{{ image_id }}';