VolumesResource


List volumes in a location


GET https://example.com/api/cloud/locations/{location}/volumes

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VAPP_CREATE_STATEFUL]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String id How to order the search. Available values are: \{NAME, VIRTUALDATACENTER, VIRTUALAPPLIANCE, VIRUTALMACHINE, TIER, TOTALSIZE, USEDSIZE, AVAILABLESIZE\}
has String If present filter to apply in the search.
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
available Boolean false If true, only return available volumes, not attached to any virtual machine. In public cloud also includes volumes not assigned to any virtual datacenter.
availabilityzone String filter by volumes in the specified availability zone providerId
persistent Boolean true If false, do not return volumes used in persistent virtual machine templates
source String LOCAL use ''REMOTE'' to force the synchronization in the provider

Accept : volumes

Example

List volumes including virtual machine in a location


Retrieve volumes in a location, including the representation of the virtual machine, virtual appliance and virtual datacenter, if the volume is attached to a virtual machine

GET https://example.com/api/cloud/locations/{location}/volumes

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VAPP_CREATE_STATEFUL]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String id How to order the search. Available values are: \{NAME, VIRTUALDATACENTER, VIRTUALAPPLIANCE, VIRUTALMACHINE, TIER, TOTALSIZE, USEDSIZE, AVAILABLESIZE\}
has String How to filter the search. It can be filtered by: Volume name, Virtual Datacenter name, Virtual Appliance name, Virtual Machine name, Tier name, Total size
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
persistent Boolean true If false, do not return volumes used in persistent virtual machine templates
availabilityzone String filter by volumes in the specified availability zone providerId

Example

Delete a volume from a location


Remove a volume from a virtual datacenter

DELETE https://example.com/api/cloud/locations/{location}/volumes/{volume}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_STORAGE, ROLE_VDC_MANAGE_STORAGE, ROLE_VAPP_CREATE_STATEFUL]

Example

Get a volume in a location


Retrieve a volume with links to associated resources

GET https://example.com/api/cloud/locations/{location}/volumes/{volume}

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_VAPP_CREATE_STATEFUL]

Accept : volume

Error Codes

  • VOL-3 - The volume does not exist

Example

Get a volume including virtual machine in a location


Retrieve a volume in a virtual datacenter, including the representation of the virtual machine, virtual appliance and virtual datacenter, if the volume is attached to a virtual machine

GET https://example.com/api/cloud/locations/{location}/volumes/{volume}

Roles : [ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE, ROLE_VAPP_CREATE_STATEFUL]

Example

Update a volume in a location


Update a volume.
When changing the size, you can only increase the size of a volume, not decrease it.

PUT https://example.com/api/cloud/locations/{location}/volumes/{volume}

Roles : [ROLE_PHYS_DC_ALLOW_MODIFY_STORAGE, ROLE_VDC_MANAGE_STORAGE]

Content-Type : volume Accept : acceptedrequest

Error Codes

  • CONSTR-LENGTH - The property 'elementName' length must be between 1 and 255.
  • GEN-24 - The requested disk controller is not supported by the hypervisor plugin
  • SCALING-GROUP-16 - The scaling group must be in maintenance mode in order to apply the requested operation
  • VM-120 - The virtual machine is protected and cannot be used
  • VOL-1 - There are not enough resources in the selected tier to create the volume
  • VOL-10 - The size of the volume cannot be reduced
  • VOL-14 - The volume cannot be edited because it is being used in a virtual machine
  • VOL-46 - The volume cannot be resized or removed from the virtual machine if it has snapshots

Example

List initiator mappings of a volume in a location


Retrieve initiator mappings of a volume

GET https://example.com/api/cloud/locations/{location}/volumes/{volume}/action/initiatormappings

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_PHYS_DC_RETRIEVE_DETAILS]

Example

Get an initiator mapping of a volume in a location


Retrieve an initiator mapping of a volume

GET https://example.com/api/cloud/locations/{location}/volumes/{volume}/action/initiatormappings/{mapping}

Roles : [ROLE_VDC_MANAGE_STORAGE, ROLE_PHYS_DC_RETRIEVE_DETAILS]

Accept : initiatormapping

Example

Move a volume to another virtual datacenter


Move a volume from one virtual datacenter to another.
Requires that both virtual datacenters belong to the same datacenter and enterprise.
Its also possible to remove all the virtual datacenters references

POST https://example.com/api/cloud/locations/{location}/volumes/{volume}/action/move

Roles : [ROLE_VDC_MANAGE_STORAGE]

Content-Type : links Accept : volume

Error Codes

  • VDC-0 - The requested virtual datacenter does not exist
  • VOL-14 - The volume cannot be edited because it is being used in a virtual machine
  • VOL-39 - The volume can only be moved to another virtual datacenter in the same datacenter
  • VOL-41 - The volume can only be moved to another virtual datacenter in the same enterprise
  • VOL-47 - Cannot move a persistent volume. You should try to move the template

Example