Volumes
1. volumes(id=None, detail=False)
Lists volumes.
Parameters:
| Name | Type | Description |
|---|---|---|
| id (optional) | String | Provided to get specific volume |
| detail | Boolean | show detail version if true |
Return value: Volume Object or a list
Return value example:
status : creating
displayDescription : None
availabilityZone : nova
displayName : None
attachments : [{}]
volumeType : None
snapshotId : None
metadata : {}
id : a7c70ea4-9bba-4bb1-95ec-b225d651b0f5
createdAt : 2016-08-29T06:29:54.784601
size : 30
list:
status : error
displayDescription : None
availabilityZone : nova
displayName : None
attachments : [{}]
volumeType : None
snapshotId : None
metadata : {}
id : a7c70ea4-9bba-4bb1-95ec-b225d651b0f5
createdAt : 2016-08-29T06:29:54.000000
size : 30
status : error
displayDescription : None
availabilityZone : nova
displayName : second test for create volume
attachments : [{}]
volumeType : None
snapshotId : None
metadata : {}
id : d7e340d7-1772-4176-9dee-8f8dc368868b
createdAt : 2016-08-29T05:56:12.000000
size : 10
2. create_volume(**attr)
Create a volume.
Parameters: attr(Dict)
| Name | Type | Description |
|---|---|---|
| size | integer | The size of the volume, in gibibytes (GiB). |
| availability_zone (Optional) | string | The availability zone name. |
| display_name (Optional) | string | The volume name. |
| display_description (Optional) | string | The volume description. |
| volume_type (Optional) | string | The unique identifier for a volume type. |
| snapshot_id (Optional) | string | The UUID for a snapshot. |
Parameters example:
attr = {
“size”:30
}
Return value: Volume Object
Return value example:
status : creating
displayDescription : None
availabilityZone : nova
displayName : None
attachments : [{}]
volumeType : None
snapshotId : None
metadata : {}
id : 3905858b-30eb-4abe-9e87-e4892c66ff3f
createdAt : 2016-08-29T06:35:21.829885
size : 30
4. delete_volume(volume)
Delete volume.
Parameters: volume(String): volume id or Object
Return value: None on success
5. snapshots(id=None, detail=False)
List snapshot.
Parameters:
| Name | Type | Description |
|---|---|---|
| id (optional) | String | Provided to get specific snapshot |
| detail | Boolean | show detail version if true |
Return value: Snapshot Object or a list
Return value example:
status : error
displayDescription : Daily backup
displayName : snap-test-php
size : 10
volumeId : 043d96d8-e605-4ebb-8c06-b8f2e19aee1d
createdAt : 2016-08-19T16:20:36.000000
id : 4e1d18e9-d095-44f6-abb5-3ad6fd77b73d
status : error
displayDescription : Daily backup
displayName : snap-test-php
size : 10
volumeId : 043d96d8-e605-4ebb-8c06-b8f2e19aee1d
createdAt : 2016-08-19T16:20:32.000000
id : ebf23463-ca36-4897-a311-134d5fbc0418
6. create_snapshot(**attr)
Create a snapshot.
Parameters: attr(Dict)
| Name | Type | Description |
|---|---|---|
| volume_id | string | The source volume ID. |
| display_description (Optional) | string | The volume description. |
| display_name (Optional) | string | The volume name. |
| force (Optional) | boolean | Indicates whether to create a snapshot, even if the volume is attached. |
Parameters example:
attr = {
"volume_id": "a7c70ea4-9bba-4bb1-95ec-b225d651b0f5"
}
Return value: Snapshot Object
7. delete_snapshot(snapshot)
Delete snapshot.
Parameters: snapshot(String): snapshot id or Object
Return value: None on success