volumes
Creates, updates, deletes, gets or lists a volumes
resource.
Overview
Name | volumes |
Type | Resource |
Id | digitalocean.block_storage.volumes |
Fields
Name | Datatype | Description |
---|---|---|
column_anon | `` |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
volumes_get | SELECT | volume_id | To show information about a block storage volume, send a GET request to /v2/volumes/$VOLUME_ID . |
volumes_list | SELECT |
| To list all of the block storage volumes available on your account, send a GET request to /v2/volumes . ## Filtering Results ### By Region The region may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: /v2/volumes?region=nyc1 ### By Name It is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to /v2/volumes?name=$VOLUME_NAME . Note: You can only create one volume per region with the same name. ### By Name and Region It is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to /v2/volumes?name=$VOLUME_NAME®ion=nyc1 . |
volumes_create | INSERT |
| To create a new volume, send a POST request to /v2/volumes . Optionally, a filesystem_type attribute may be provided in order to automatically format the volume's filesystem. Pre-formatted volumes are automatically mounted when attached to Ubuntu, Debian, Fedora, Fedora Atomic, and CentOS Droplets created on or after April 26, 2018. Attaching pre-formatted volumes to Droplets without support for auto-mounting is not recommended. |
volumes_delete | DELETE | volume_id | To delete a block storage volume, destroying all data and removing it from your account, send a DELETE request to /v2/volumes/$VOLUME_ID . No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. |
volumes_delete_by_name | DELETE |
| Block storage volumes may also be deleted by name by sending a DELETE request with the volume's name and the region slug for the region it is located in as query parameters to /v2/volumes?name=$VOLUME_NAME®ion=nyc1 . No response body will be sent back, but the response code will indicate success. Specifically, the response code will be a 204, which means that the action was successful with no returned body data. |
SELECT
examples
To list all of the block storage volumes available on your account, send a GET request to /v2/volumes
. ## Filtering Results ### By Region The region
may be provided as query parameter in order to restrict results to volumes available in a specific region. For example: /v2/volumes?region=nyc1
### By Name It is also possible to list volumes on your account that match a specified name. To do so, send a GET request with the volume's name as a query parameter to /v2/volumes?name=$VOLUME_NAME
. Note: You can only create one volume per region with the same name. ### By Name and Region It is also possible to retrieve information about a block storage volume by name. To do so, send a GET request with the volume's name and the region slug for the region it is located in as query parameters to /v2/volumes?name=$VOLUME_NAME®ion=nyc1
.
SELECT
column_anon
FROM digitalocean.block_storage.volumes
;
INSERT
example
Use the following StackQL query and manifest file to create a new volumes
resource.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO digitalocean.block_storage.volumes (
data__name,
data__description,
data__size_gigabytes,
data__tags,
data__snapshot_id,
data__filesystem_type,
data__region,
data__filesystem_label
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ size_gigabytes }}',
'{{ tags }}',
'{{ snapshot_id }}',
'{{ filesystem_type }}',
'{{ region }}',
'{{ filesystem_label }}'
;
/*+ create */
INSERT INTO digitalocean.block_storage.volumes (
data__name,
data__size_gigabytes,
data__region
)
SELECT
'{{ name }}',
'{{ size_gigabytes }}',
'{{ region }}'
;
- name: volumes
props:
- name: name
value: string
- name: description
value: string
- name: size_gigabytes
value: integer
- name: tags
value: array
- name: snapshot_id
value: string
- name: filesystem_type
value: string
- name: region
value: string
- name: filesystem_label
value: string
DELETE
example
Deletes the specified volumes
resource.
/*+ delete */
DELETE FROM digitalocean.block_storage.volumes
WHERE = '{{ }}';