Skip to main content

droplets

Overview

Namedroplets
TypeResource
Iddigitalocean.droplets.droplets

Fields

NameDatatypeDescription
idintegerA unique identifier for each Droplet instance. This is automatically generated upon Droplet creation.
namestringThe human-readable name set for the Droplet instance.
diskintegerThe size of the Droplet's disk in gigabytes.
vpc_uuidstringA string specifying the UUID of the VPC to which the Droplet is assigned.
tagsarrayAn array of Tags the Droplet has been tagged with.
statusstringA status string indicating the state of the Droplet instance. This may be "new", "active", "off", or "archive".
networksobjectThe details of the network that are configured for the Droplet instance. This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is.
size_slugstringThe unique slug identifier for the size of this Droplet.
imageobject
memoryintegerMemory of the Droplet in megabytes.
snapshot_idsarrayAn array of snapshot IDs of any snapshots created from the Droplet instance.
featuresarrayAn array of features enabled on this Droplet.
regionobject
vcpusintegerThe number of virtual CPUs.
next_backup_windowobjectThe details of the Droplet's backups feature, if backups are configured for the Droplet. This object contains keys for the start and end times of the window during which the backup will start.
backup_idsarrayAn array of backup IDs of any backups that have been taken of the Droplet instance. Droplet backups are enabled at the time of the instance creation.
lockedbooleanA boolean value indicating whether the Droplet has been locked, preventing actions by users.
kernelobjectNote: All Droplets created after March 2017 use internal kernels by default.
These Droplets will have this attribute set to null.

The current kernel
for Droplets with externally managed kernels. This will initially be set to
the kernel of the base image when the Droplet is created.
sizeobject
created_atstringA time value given in ISO8601 combined date and time format that represents when the Droplet was created.
volume_idsarrayA flat array including the unique identifier for each Block Storage volume attached to the Droplet.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdroplet_idTo show information about an individual Droplet, send a GET request to
/v2/droplets/$DROPLET_ID.
listSELECTTo list all Droplets in your account, send a GET request to /v2/droplets.

The response body will be a JSON object with a key of droplets. This will be
set to an array containing objects each representing a Droplet. These will
contain the standard Droplet attributes.

### Filtering Results by Tag

It's possible to request filtered results by including certain query parameters.
To only list Droplets assigned to a specific tag, include the tag_name query
parameter set to the name of the tag in your GET request. For example,
/v2/droplets?tag_name=$TAG_NAME.
createINSERTTo create a new Droplet, send a POST request to /v2/droplets setting the
required attributes.

A Droplet will be created using the provided information. The response body
will contain a JSON object with a key called droplet. The value will be an
object containing the standard attributes for your new Droplet. The response
code, 202 Accepted, does not indicate the success or failure of the operation,
just that the request has been accepted for processing. The actions returned
as part of the response's links object can be used to check the status
of the Droplet create event.

### Create Multiple Droplets

Creating multiple Droplets is very similar to creating a single Droplet.
Instead of sending name as a string, send names as an array of strings. A
Droplet will be created for each name you send using the associated
information. Up to ten Droplets may be created this way at a time.

Rather than returning a single Droplet, the response body will contain a JSON
array with a key called droplets. This will be set to an array of JSON
objects, each of which will contain the standard Droplet attributes. The
response code, 202 Accepted, does not indicate the success or failure of any
operation, just that the request has been accepted for processing. The array
of actions returned as part of the response's links object can be used to
check the status of each individual Droplet create event.
_getEXECdroplet_idTo show information about an individual Droplet, send a GET request to
/v2/droplets/$DROPLET_ID.
_listEXECTo list all Droplets in your account, send a GET request to /v2/droplets.

The response body will be a JSON object with a key of droplets. This will be
set to an array containing objects each representing a Droplet. These will
contain the standard Droplet attributes.

### Filtering Results by Tag

It's possible to request filtered results by including certain query parameters.
To only list Droplets assigned to a specific tag, include the tag_name query
parameter set to the name of the tag in your GET request. For example,
/v2/droplets?tag_name=$TAG_NAME.
destroyEXECdroplet_idTo delete a Droplet, send a DELETE request to /v2/droplets/$DROPLET_ID.

A successful request will receive a 204 status code with no body in response.
This indicates that the request was processed successfully.
destroy_byTagEXECtag_nameTo delete all Droplets assigned to a specific tag, include the tag_name
query parameter set to the name of the tag in your DELETE request. For
example, /v2/droplets?tag_name=$TAG_NAME.

A successful request will receive a 204 status code with no body in response.
This indicates that the request was processed successfully.
destroy_retryWithAssociatedResourcesEXECdroplet_idIf the status of a request to destroy a Droplet with its associated resources
reported any errors, it can be retried by sending a POST request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/retry endpoint.

Only one destroy can be active at a time per Droplet. If a retry is issued
while another destroy is in progress for the Droplet a 409 status code will
be returned. A successful response will include a 202 response code and no
content.
destroy_withAssociatedResourcesDangerousEXECX-Dangerous, droplet_idTo destroy a Droplet along with all of its associated resources, send a DELETE
request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/dangerous
endpoint. The headers of this request must include an X-Dangerous key set to
true. To preview which resources will be destroyed, first query the
Droplet's associated resources. This operation can not be reverse and should
be used with caution.

A successful response will include a 202 response code and no content. Use the
status endpoint to check on the success or failure of the destruction of the
individual resources.
destroy_withAssociatedResourcesSelectiveEXECdroplet_idTo destroy a Droplet along with a sub-set of its associated resources, send a
DELETE request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources/selective
endpoint. The JSON body of the request should include reserved_ips, snapshots, volumes,
or volume_snapshots keys each set to an array of IDs for the associated
resources to be destroyed. The IDs can be found by querying the Droplet's
associated resources. Any associated resource not included in the request
will remain and continue to accrue changes on your account.

A successful response will include a 202 response code and no content. Use
the status endpoint to check on the success or failure of the destruction of
the individual resources.
get_DestroyAssociatedResourcesStatusEXECdroplet_idTo check on the status of a request to destroy a Droplet with its associated
resources, send a GET request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources/status endpoint.
list_associatedResourcesEXECdroplet_idTo list the associated billable resources that can be destroyed along with a
Droplet, send a GET request to the
/v2/droplets/$DROPLET_ID/destroy_with_associated_resources endpoint.

The response will be a JSON object containing snapshots, volumes, and
volume_snapshots keys. Each will be set to an array of objects containing
information about the associated resources.
list_neighborsIdsEXECTo retrieve a list of all Droplets that are co-located on the same physical
hardware, send a GET request to /v2/reports/droplet_neighbors_ids.

The results will be returned as a JSON object with a key of neighbor_ids.
This will be set to an array of arrays. Each array will contain a set of
Droplet IDs for Droplets that share a physical server. An empty array
indicates that all Droplets associated with your account are located on
separate physical hardware.