Attach Volume to Stacklet
- Name
put
- Type
- /v1/volumes/:id
- Description
You can attach a volume to a stacklet by sending a
PUT
request with specific action.
Request
Required Attributes
- Name
action
- Type
- string
- Description
Action performed on a volume (attach, detach, resize, rename) in this case
attach
.
- Name
stacklet_id
- Type
- integer
- Description
The stacklet id which the volume will be attached to.
Example
json
curl -X PUT "https://api.simplystack.com/v1/volumes/6c848d7f-0389-4fdf-95bf-7d4d58d9cc04" \
-H "Content-Type: application/json" \
-H "Authorization: Token d359ad9cc9422b5ff07aede0cd2707da4ff82be0" \
-d '{"action": "attach", "stacklet_id": 1}'
Response
JSON object with key named volume
with the following identifiers associated with a volume:
Attributes
Example
json
{
"volume": {
"id": "6c848d7f-0389-4fdf-95bf-7d4d58d9cc04",
"name": "volume01",
"created_at": "2020-01-07T18:37:45.190194Z",
"task": {
"id": 2,
"name": "attach",
"description": {
"completed": "Volume was attached to a Stacklet.",
"progress": "Volume is attaching to a Stacklet."
}
},
"region": {
"available": true,
"features": ["floating_ips"],
"name": "Frankfurt",
"slug": "fra"
},
"size": 10737418240,
"size_gigabytes": 10.0,
"stacklet": {...}
}
}