Documentation

Skip to end of metadata
Go to start of metadata

VolumesResource

Volumes Resource allows you to manage volumes at the virtual datacenter level.

Main URI of the Resource

This class operates mainly over the Resource URI: /cloud/virtualdatacenters/{virtualdatacenter}/volumes

Exposed Methods

Retrieve volumes

Retrieve the list of volumes in a specified virtual datacenter

Paging Method

This method works with paging. Check out Basic Behaviors for information about how it works

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes
Roles Required: ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE,ROLE_PHYS_DC_RETRIEVE_DETAILS,ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.volumes+json; version=3.2; application/vnd.abiquo.volumes+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

startwith

false

0

First element to retrieve

by

false

id

How to order the search. Available values are: {NAME, VIRTUALDATACENTER,
VIRTUALAPPLIANCE, VIRUTALMACHINE, TIER, TOTALSIZE, USEDSIZE, AVAILABLESIZE}

has

false

 

A way 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

false

25

Number of elements to retrieve.

asc

false

true

The way to order the search (ascendant -> true, descendant -> false). Ascendant by
default.

available

false

false

Retrieve all or only available volumes (only available -> true, all ->
false)

persistent

false

true

Include or not the persistent volumes in the result

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: VolumesManagement Media Type
Request Example:

 Click here to show or hide the request example

Retrieve volumes example
$ curl -X GET http://example.com/api/cloud/virtualdatacenters/1/volumes\
     -H 'Accept: application/vnd.abiquo.iscsivolumes+xml; version=2.4'    \
     -u user:password --verbose


GET http://example.com/api/cloud/virtualdatacenters/1/volumes HTTP/1.1
Accept: application/vnd.abiquo.iscsivolumes+xml;version=2.4
HTTP/1.1 200 OK
Content-Type: application/vnd.abiquo.iscsivolumes+xml;version=2.4

<?xml version="1.0" encoding="UTF-8"?>
<volumes>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes" rel="first"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes?startwith=0" rel="last"/>
  <totalSize>1</totalSize>
  <volume>
    <link
      href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530"
      rel="edit" type="application/vnd.abiquo.volume+xml"/>
    <link
      href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530/action/initiatormappings"
      rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml"/>
    <link
      href="http://example.com/api/cloud/virtualdatacenters/1/tiers/1"
      rel="tier" title="Default Tier 1" type="application/vnd.abiquo.tier+xml"/>
    <link href="http://example.com/api/cloud/virtualdatacenters/1"
      rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml"/>
    <id>1530</id>
    <name>Hawaian volume updated</name>
    <state>DETACHED</state>
    <sizeInMB>32</sizeInMB>
    <sequence>0</sequence>
  </volume>
</volumes>


Retrieve volumes including virtual machine, virtual appliance and virtual datacenter.

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

Paging Method

This method works with paging. Check out Basic Behaviors for information about how it works

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes
Roles Required: ROLE_VDC_MANAGE_STORAGE, ROLE_VDC_ENUMERATE,ROLE_PHYS_DC_RETRIEVE_DETAILS,ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.volumeswithvirtualmachine+json; version=3.2; application/vnd.abiquo.volumeswithvirtualmachine+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

startwith

false

0

First element to retrieve

by

false

id

How to order the search. Available values are: {NAME, VIRTUALDATACENTER,
VIRTUALAPPLIANCE, VIRUTALMACHINE, TIER, TOTALSIZE, USEDSIZE, AVAILABLESIZE}

has

false

 

A way 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

false

25

Number of elements to retrieve.

asc

false

true

The way to order the search (ascendant -> true, descendant -> false). Ascendant by
default.

persistent

false

true

Include or not the persistent volumes in the result

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: VolumesManagementWithVirtualMachine Media Type
Request Example:

 Click here to show or hide the request example

Retrieve volumes example
curl --verbose -X GET  http://example.com/api/cloud/virtualdatacenters/2/volumes 
     -H "Accept: application/vnd.abiquo.iscsivolumeswithvirtualmachine+xml; version=2.4"
     -u user:password 

GET /api/cloud/virtualdatacenters/2/volumes HTTP/1.1
Accept: application/vnd.abiquo.iscsivolumeswithvirtualmachine+xml; version=2.4

< HTTP/1.1 200 OK
< Content-Type: application/vnd.abiquo.iscsivolumeswithvirtualmachine+xml;version=2.4

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<volumes>
    <link rel="first" href="http://example.com/api/cloud/virtualdatacenters/2/volumes?limit=25&amp;by=id"/>
    <link rel="last" href="http://example.com/api/cloud/virtualdatacenters/2/volumes?startwith=0&amp;limit=25&amp;by=id"/>
    <totalSize>2</totalSize>
    <volume>
        <link rel="edit" type="application/vnd.abiquo.volume+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/255"/>
        <link rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/255/action/initiatormappings"/>
        <link title="Default Tier 1" rel="tier" type="application/vnd.abiquo.tier+xml" href="http://example.com/api/cloud/virtualdatacenters/2/tiers/1"/>
        <link title="vd2" rel="virtualdatacenter" type="application/vnd.abiquo.virtualdatacenter+xml" href="http://example.com/api/cloud/virtualdatacenters/2"/>
        <id>255</id>
        <uuid>ee6400b8-f6b3-4bfc-be28-877e38348805</uuid>
        <name>vol1</name>
        <description></description>
        <state>DETACHED</state>
        <sizeInMB>102</sizeInMB>
        <virtualDatacenterWithDatacenter>
            <cpuHard>0</cpuHard>
            <cpuSoft>0</cpuSoft>
            <hdHard>0</hdHard>
            <hdSoft>0</hdSoft>
            <publicIpsHard>0</publicIpsHard>
            <publicIpsSoft>0</publicIpsSoft>
            <ramHard>0</ramHard>
            <ramSoft>0</ramSoft>
            <storageHard>0</storageHard>
            <storageSoft>0</storageSoft>
            <vlansHard>0</vlansHard>
            <vlansSoft>0</vlansSoft>
            <id>2</id>
            <hypervisorType>VMX_04</hypervisorType>
            <name>vd2</name>
            <datacenter>
                <id>1</id>
                <location>oslo</location>
                <name>datacenter</name>
            </datacenter>
        </virtualDatacenterWithDatacenter>
        <storagePoolWithDevice>
            <idStorage>178f2137-3018-4bc1-9db0-a7575c7ab8de</idStorage>
            <name>abiquo</name>
            <totalSizeInMb>15360</totalSizeInMb>
            <usedSizeInMb>6942</usedSizeInMb>
            <availableSizeInMb>8417</availableSizeInMb>
            <enabled>false</enabled>
            <device>
                <id>1</id>
                <name>lvm</name>
                <storageTechnology>LVM</storageTechnology>
                <managementIp>10.60.12.177</managementIp>
                <managementPort>8180</managementPort>
                <iscsiIp>10.60.12.177</iscsiIp>
                <iscsiPort>3260</iscsiPort>
            </device>
        </storagePoolWithDevice>
    </volume>
    <volume>
        <link rel="edit" type="application/vnd.abiquo.volume+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/512"/>
        <link rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/512/action/initiatormappings"/>
        <link title="Default Tier 2" rel="tier" type="application/vnd.abiquo.tier+xml" href="http://example.com/api/cloud/virtualdatacenters/2/tiers/2"/>
        <link title="vd2" rel="virtualdatacenter" type="application/vnd.abiquo.virtualdatacenter+xml" href="http://example.com/api/cloud/virtualdatacenters/2"/>
        <id>512</id>
        <uuid>vol1</uuid>
        <name>vol</name>
        <state>DETACHED</state>
        <sizeInMB>200</sizeInMB>
        <virtualDatacenterWithDatacenter>
            <cpuHard>0</cpuHard>
            <cpuSoft>0</cpuSoft>
            <hdHard>0</hdHard>
            <hdSoft>0</hdSoft>
            <publicIpsHard>0</publicIpsHard>
            <publicIpsSoft>0</publicIpsSoft>
            <ramHard>0</ramHard>
            <ramSoft>0</ramSoft>
            <storageHard>0</storageHard>
            <storageSoft>0</storageSoft>
            <vlansHard>0</vlansHard>
            <vlansSoft>0</vlansSoft>
            <id>2</id>
            <hypervisorType>VMX_04</hypervisorType>
            <name>vd2</name>
            <datacenter>
                <id>1</id>
                <location>oslo</location>
                <name>datacenter</name>
            </datacenter>
        </virtualDatacenterWithDatacenter>
        <storagePoolWithDevice>
            <idStorage>6c507932-fe21-4a2c-85ee-7fb21066e22d</idStorage>
            <name>iscsi_pool</name>
            <totalSizeInMb>9223372036854775807</totalSizeInMb>
            <usedSizeInMb>0</usedSizeInMb>
            <availableSizeInMb>9223372036854775807</availableSizeInMb>
            <enabled>false</enabled>
            <device>
                <id>2</id>
                <name>iscsi</name>
                <storageTechnology>GENERIC_ISCSI</storageTechnology>
                <managementIp>10.60.11.7</managementIp>
                <managementPort>3260</managementPort>
                <iscsiIp>10.60.11.7</iscsiIp>
                <iscsiPort>3260</iscsiPort>
            </device>
        </storagePoolWithDevice>
    </volume>
</volumes>




Create a volume in a virtual datacenter

To create a Volume in the Virtual Datacenter, a Tier must be specified. The Tier is the service level desired for the volume, and it must be supplied in the request body.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes
Roles Required: ROLE_VDC_MANAGE_STORAGE
Request Headers: Accept: application/vnd.abiquo.volume+json; version=3.2; application/vnd.abiquo.volume+xml; version=3.2;  Content-type:  application/vnd.abiquo.volume+json; version=3.2; application/vnd.abiquo.volume+xml; version=3.2;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VolumeManagement Media Type
Response Message Body Entity: VolumeManagement Media Type
Request Example:

 Click here to show or hide the request example

Create a volume in a virtual datacenter example
$ curl -X POST http://example.com/api/cloud/virtualdatacenters/1/volumes\
     -H 'Accept: application/vnd.abiquo.volume+xml; version=2.4'    \
     -H 'Content-Type: application/vnd.abiquo.volume+xml; version=2.4'    \
     -d @entity.xml    \
     -u user:password --verbose


POST http://example.com/api/cloud/virtualdatacenters/1/volumes HTTP/1.1
Accept: application/vnd.abiquo.volume+xml;version=2.4
Content-Type: application/vnd.abiquo.volume+xml;version=2.4
Content-Length: 252


HTTP/1.1 201 Created
Date: Wed, 16 Jan 2013 14:06:46 GMT
Location: http://example.com/api/cloud/virtualdatacenters/1/volumes/763
Set-Cookie: JSESSIONID=11351FE4B380F2F1C2808405320D1687; Path=/api
Set-Cookie: auth=YWRtaW46MTM1ODM0Njk4MTQ2OTpjYzFlOGYxMjNlM2E2N2JiNGI1NmFiZGY2NTdmZDM0MzpBQklRVU8; Expires=Wed, 16-Jan-2013 14:36:21 GMT; Path=/api
Server: Apache-Coyote/1.1
Content-Type: application/vnd.abiquo.volume+xml;version=2.4
Content-Length: 804

<?xml version="1.0" encoding="UTF-8"?>
<volume>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes/763"
    rel="edit" type="application/vnd.abiquo.volume+xml"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/tiers/1"
    rel="tier" title="Default Tier 1" type="application/vnd.abiquo.tier+xml"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes/763/action/initiatormappings"
    rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml"/>
  <link href="http://example.com/api/cloud/virtualdatacenters/1"
    rel="virtualdatacenter" title="JC-1ee3e168-c87" type="application/vnd.abiquo.virtualdatacenter+xml"/>
  <id>763</id>
  <name>JC-Event vol</name>
  <state>DETACHED</state>
  <sizeInMB>32</sizeInMB>
  <sequence>0</sequence>
</volume>


Download a template

You can download the template of the entity here (click right mouse button and 'Save Link As..')

Create a volume in a Generic iSCSI pool

To import an existing volume into a Generic iSCSI pool, we need to provide the volume information with the iSCSI information too. The following XML shows an example document to import an existing iSCSI volume.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes
Roles Required: ROLE_VDC_MANAGE_STORAGE
Request Headers: Accept: application/vnd.abiquo.iscsivolume+json; version=3.2; application/vnd.abiquo.iscsivolume+xml; version=3.2;  Content-type:  application/vnd.abiquo.iscsivolume+json; version=3.2; application/vnd.abiquo.iscsivolume+xml; version=3.2;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VolumeManagement Media Type
Response Message Body Entity: VolumeManagement Media Type
Request Example:

 Click here to show or hide the request example

Create a volume in a Generic iSCSI pool example
$ curl --verbose 'http://1.1.1.1/api/cloud/virtualdatacenters/1/volumes' \
      -X "POST" \
      -H "Accept:application/vnd.abiquo.iscsivolume+xml" \
      -H "Content-type:application/vnd.abiquo.iscsivolume+xml" \
      -u admin:xabiquo \
      -d '<volume>
            <link href="http://1.1.1.1/api/admin/datacenters/1/storage/devices/34/pools/075615ea-6558-45de-b40f-96ec2413735d" rel="pool"/>
            <link href="http://1.1.1.1/api/cloud/virtualdatacenters/1/tiers/3" rel="tier"/>
            <name>vol</name>
            <uuid>iscsi_volume</uuid>
            <sizeInMB>100</sizeInMB>
            <connection>ip-2.2.2.2:3260-iscsi-iqn.1992-08.com.netapp:sn.99929383-lun-1</connection>
        </volume>'
 
 
 
HTTP/1.1 201 Creado
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTM5MDM4MjgyMDkzOToxMjgyYTZjMzRmOWU5YTRjYmJkMmQyNjBhMmYwZjBhMDpBQklRVU8; Expires=Wed, 22-Jan-2014 09:27:00 GMT; Path=/api
< Location: http://10.60.11.22:8009/api/cloud/virtualdatacenters/1/volumes/1084
< Set-Cookie: JSESSIONID=768475DBD333EC8E96769B5DFC51ADB0; Path=/api; Secure
< Content-Type: application/vnd.abiquo.iscsivolume+xml
< Content-Length: 1039
< Date: Wed, 22 Jan 2014 08:57:07 GMT
< 
{ [data not shown]
100  1473  100  1039  100   434    170     71  0:00:06  0:00:06 --:--:--   147
* Connection #0 to host 10.60.11.22 left intact
* Closing connection #0
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<volume>
    <link title="vol" rel="edit" type="application/vnd.abiquo.volume+xml" href="http://1.1.1.1/api/cloud/virtualdatacenters/1/volumes/1084"/>
    <link title="Default Tier 3" rel="tier" type="application/vnd.abiquo.tier+xml" href="http://1.1.1.1/api/cloud/virtualdatacenters/1/tiers/3"/>
    <link title="initiator mappings" rel="initiatormappings" type="application/vnd.abiquo.initiatormappings+xml" href="http://1.1.1.1/api/cloud/virtualdatacenters/1/volumes/1084/action/initiatormappings"/>
    <link title="vdc" rel="virtualdatacenter" type="application/vnd.abiquo.virtualdatacenter+xml" href="http://1.1.1.1/api/cloud/virtualdatacenters/1"/>
    <link title="iscsi_pool" rel="pool" type="application/vnd.abiquo.storagepool+xml" href="http://1.1.1.1/api/admin/datacenters/1/storage/devices/34/pools/075615ea-6558-45de-b40f-96ec2413735d"/>
    <id>1084</id>
    <name>vol</name>
    <state>DETACHED</state>
    <sizeInMB>100</sizeInMB>
    <sequence>0</sequence>
</volume>


Download a template

You can download the template of the entity here (click right mouse button and 'Save Link As..')

 

 

Get Persistent Volume Candidates

Get the volumes of the given virtual datacenter that can be used to hold a persistent template. A persistent template was previously called a stateful image. This method will be called when generating a persistent template that will reside on a GENERIC

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/action/statefulcandidates
Roles Required: ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.iscsivolumes+json; version=3.2; application/vnd.abiquo.iscsivolumes+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: VolumesManagement Media Type
Request Example:


 Click here to show or hide the request example

Get Persistent Volume Candidates example
 curl --verbose -X GET http://example.com/api/cloud/virtualdatacenters/2/volumes/action/statefulcandidates
     -H 'Accept: application/vnd.abiquo.iscsivolumes+xml;version=2.4'    \
     -u user:password --verbose 
 
GET http://example.com/api/cloud/virtualdatacenters/1/volumes/1530 HTTP/1.1
Authorization: Basic YWRtaW46eGFiaXF1bw==
Accept: application/vnd.abiquo.volume+xml;version=2.4
 
 
HTTP/1.1 200 OK
Content-Type: application/vnd.abiquo.iscsivolumes+xml;version=2.4
Content-Length: 795
 
<?xml version="1.0" encoding="UTF-8"?>
<volumes>
    <volume>
        <link rel="edit" type="application/vnd.abiquo.volume+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/512"/>
        <link rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/512/action/initiatormappings"/>
        <link title="Default Tier 2" rel="tier" type="application/vnd.abiquo.tier+xml" href="http://example.com/api/cloud/virtualdatacenters/2/tiers/2"/>
        <link title="vd2" rel="virtualdatacenter" type="application/vnd.abiquo.virtualdatacenter+xml" href="http://example.com/api/cloud/virtualdatacenters/2"/>
        <id>512</id>
        <name>vol</name>
        <state>DETACHED</state>
        <sizeInMB>200</sizeInMB>
        <sequence>0</sequence>
    </volume>
</volumes>


 

 

------------------------------------------------------------------------------------------------------------------------------

Volume Resource

Resource with operations to get, modify or delete a storage pool. Also, you can retrieve the list of volumes created in a pool.
getvolume (Get a volume in a virtual datacenter) ------------------------------------------------ Retrieve a volume in a specified virtual datacenter

Main URI of the Resource

This class operates mainly over the Resource URI: /cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}

Exposed Methods

Retrieve a volume

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}
Roles Required: ROLE_PHYS_DC_RETRIEVE_DETAILS,ROLE_VDC_MANAGE_STORAGE,ROLE_VDC_ENUMERATE,ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.volume+json; version=3.2; application/vnd.abiquo.volume+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: VolumeManagement Media Type
Request Example:

 Click here to show or hide the request example

Retrieve a volume example
$ curl -X GET http://example.com/api/cloud/virtualdatacenters/1/volumes/1530\
     -H 'Accept: application/vnd.abiquo.volume+xml; version=2.4'    \
     -u user:password --verbose


GET http://example.com/api/cloud/virtualdatacenters/1/volumes/1530 HTTP/1.1
Accept: application/vnd.abiquo.volume+xml;version=2.4

HTTP/1.1 200 OK
Date: Wed, 16 Jan 2013 14:09:04 GMT
Set-Cookie: JSESSIONID=A4CC95EA521B38A1C998D3C608FA8612; Path=/api
Set-Cookie: auth=YWRtaW46MTM1ODM0NzE0NDg5MTo2MzA1ODY0OTc4ZThkZmZmMDRiYmRmZTk1MWU0MmE0YzpBQklRVU8; Expires=Wed, 16-Jan-2013 14:39:04 GMT; Path=/api
Server: Apache-Coyote/1.1
Content-Type: application/vnd.abiquo.volume+xml;version=2.4
Content-Length: 810

<?xml version="1.0" encoding="UTF-8"?>
<volume>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530"
    rel="edit" type="application/vnd.abiquo.volume+xml"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530/action/initiatormappings"
    rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/tiers/1"
    rel="tier" title="Default Tier 1" type="application/vnd.abiquo.tier+xml"/>
  <link href="http://example.com/api/cloud/virtualdatacenters/1"
    rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml"/>
  <id>1530</id>
  <name>JC-Hawaian volume</name>
  <state>DETACHED</state>
  <sizeInMB>32</sizeInMB>
  <sequence>0</sequence>
</volume>


Retrieve a volume adding the virtual machine info

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}
Roles Required: ROLE_PHYS_DC_RETRIEVE_DETAILS,ROLE_VDC_MANAGE_STORAGE,ROLE_VDC_ENUMERATE,ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: application/vnd.abiquo.iscsivolumewithvirtualmachine+json; version=3.2; application/vnd.abiquo.iscsivolumewithvirtualmachine+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: VolumeManagementWithVirtualMachine Media Type
Request Example:

 Click here to show or hide the request example

Retrieve a volume adding the virtual machine info example
$ curl -X GET http://example.com/api/cloud/virtualdatacenters/1/volumes/1530\
     -H 'Accept: application/vnd.abiquo.volume+xml; version=2.4'    \
     -u user:password --verbose



GET http://example.com/api/cloud/virtualdatacenters/1/volumes/1530 HTTP/1.1
Accept: application/vnd.abiquo.volume+xml;version=2.4

HTTP/1.1 200 OK
Date: Wed, 16 Jan 2013 14:09:04 GMT
Set-Cookie: JSESSIONID=A4CC95EA521B38A1C998D3C608FA8612; Path=/api
Set-Cookie: auth=YWRtaW46MTM1ODM0NzE0NDg5MTo2MzA1ODY0OTc4ZThkZmZmMDRiYmRmZTk1MWU0MmE0YzpBQklRVU8; Expires=Wed, 16-Jan-2013 14:39:04 GMT; Path=/api
Server: Apache-Coyote/1.1
Content-Type: application/vnd.abiquo.volume+xml;version=2.4
Content-Length: 810


<?xml version="1.0" encoding="UTF-8"?>
<volume>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530"
    rel="edit" type="application/vnd.abiquo.volume+xml"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530/action/initiatormappings"
    rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml"/>
  <link
    href="http://example.com/api/cloud/virtualdatacenters/1/tiers/1"
    rel="tier" title="Default Tier 1" type="application/vnd.abiquo.tier+xml"/>
  <link href="http://example.com/api/cloud/virtualdatacenters/1"
    rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml"/>
  <id>1530</id>
  <name>JC-Hawaian volume</name>
  <state>DETACHED</state>
  <sizeInMB>32</sizeInMB>
  <sequence>0</sequence>
</volume>


Modify a volume

To update an existing volume in a Virtual Datacenter, you can modify the following
properties : name, description, sizeInMB; as shown in the example below. However, you
can't decrease the size of the volume, but only increase it.

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}
Roles Required: ROLE_PHYS_DC_ALLOW_MODIFY_STORAGE,ROLE_VDC_MANAGE_STORAGE
Request Headers: Accept: application/vnd.abiquo.acceptedrequest+json; version=3.2; application/vnd.abiquo.acceptedrequest+xml; version=3.2;  Content-type:  application/vnd.abiquo.volume+json; version=3.2; application/vnd.abiquo.volume+xml; version=3.2;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: VolumeManagement Media Type
Response Message Body Entity: AcceptedRequest Media Type
Request Example:

 Click here to show or hide the request example

Modify a volume example
$ curl -X PUT http://example.com/api/cloud/virtualdatacenters/1/volumes/1530\
     -H 'Accept: application/vnd.abiquo.acceptedrequest+xml; version=2.4'    \
     -H 'Content-Type: application/vnd.abiquo.volume+xml; version=2.4'    \
     -d @entity.xml    \
     -u user:password --verbose


PUT http://example.com/api/cloud/virtualdatacenters/1/volumes/1530 HTTP/1.1
Accept: application/vnd.abiquo.acceptedrequest+xml;version=2.4
Content-Type: application/vnd.abiquo.volume+xml;version=2.4
Content-Length: 863


HTTP/1.1 204 No Content
Date: Wed, 16 Jan 2013 14:09:04 GMT
Set-Cookie: JSESSIONID=965057B265058EED5A6D9BA62EB054B8; Path=/api
Set-Cookie: auth=YWRtaW46MTM1ODM0NzE0NTA2Nzo0MWExYTBiMGY4ZmM5YTI0M2FkNjYyOTc1YjNlZWU4NjpBQklRVU8; Expires=Wed, 16-Jan-2013 14:39:05 GMT; Path=/api
Server: Apache-Coyote/1.1


Download a template

You can download the template of the entity here (click right mouse button and 'Save Link As..')

Move a volume

You can move a volume from one virtualdatacenter to another. Note, the virtualdatacenter that will receive the volume must belong to the same datacenter as the original one.

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}/action/move
Roles Required: ROLE_VDC_MANAGE_STORAGE
Request Headers: Accept: application/vnd.abiquo.moved-volume+json; version=3.2; application/vnd.abiquo.moved-volume+xml; version=3.2;  Content-type:  application/vnd.abiquo.links+json; version=3.2; application/vnd.abiquo.links+xml; version=3.2;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: Links Media Type
Response Message Body Entity: MovedVolume Media Type
Request Example:

 Click here to show or hide the request example

Move a volume example
curl -X POST http://example.com/api/cloud/virtualdatacenters/1/volumes/255/action/move 
    -H "Accept: application/vnd.abiquo.moved-volume+xml; version=2.4" 
    -H "Content-type: application/vnd.abiquo.links+xml; version=2.4" 
    -d @links.xml 
    -u user:password --verbose

<moved>
    <location rel="volume" type="application/vnd.abiquo.volume+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/255"/>
    <volume>
        <link rel="edit" type="application/vnd.abiquo.volume+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/255"/>
        <link title="Default Tier 1" rel="tier" type="application/vnd.abiquo.tier+xml" href="http://example.com/api/cloud/virtualdatacenters/2/tiers/1"/>
        <link rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml" href="http://example.com/api/cloud/virtualdatacenters/2/volumes/255/action/initiatormappings"/>
        <link title="vd2" rel="virtualdatacenter" type="application/vnd.abiquo.virtualdatacenter+xml" href="example.com/api/cloud/virtualdatacenters/2"/>
        <id>255</id>
        <name>vol1</name>
        <description></description>
        <state>DETACHED</state>
        <sizeInMB>102</sizeInMB>
        <sequence>0</sequence>
    </volume>
</moved>

Download a template

You can download the template of the entity here (click right mouse button and 'Save Link As..')

Delete a volume

Delete a volume from a specified virtual datacenter

Synopsis: DELETE http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}
Roles Required: ROLE_PHYS_DC_ALLOW_MODIFY_STORAGE,ROLE_VDC_MANAGE_STORAGE,ROLE_VAPP_CREATE_STATEFUL
Request Headers: Accept: ; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity:
Request Example:

 Click here to show or hide the request example

Delete a volume example
$ curl -X DELETE http://example.com/api/cloud/virtualdatacenters/1/volumes/4073\
     -u user:password --verbose


DELETE http://example.com/api/cloud/virtualdatacenters/1/volumes/4073 HTTP/1.1

HTTP/1.1 204 No Content
Date: Wed, 16 Jan 2013 14:11:18 GMT
Set-Cookie: JSESSIONID=9F1D31B6B42AFB2129F1979E6124713E; Path=/api
Set-Cookie: auth=YWRtaW46MTM1ODM0NzI1OTQ2Njo2NzgxM2RlMjVmM2M5YzFmYjBiY2NmYWZmY2ZhYzQ0OTpBQklRVU8; Expires=Wed, 16-Jan-2013 14:40:59 GMT; Path=/api
Server: Apache-Coyote/1.1


Get the list of the initiator mappings of the given volume

Retrieve the list of the initiator mappings of the requested volume

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}/action/initiatormappings
Roles Required: ROLE_VDC_MANAGE_STORAGE,ROLE_PHYS_DC_RETRIEVE_DETAILS
Request Headers: Accept: application/vnd.abiquo.initiatormappings+json; version=3.2; application/vnd.abiquo.initiatormappings+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: InitiatorMappings Media Type
Request Example:

 Click here to show or hide the request example

Get the list of the initiator mappings of the given volume example
curl --verbose -X GET -u 'user:password' http://localhost/api/cloud/virtualdatacenters/2/volumes/255/action/initiatormappings

HTTP/1.1 200 OK
Content-Type: application/vnd.abiquo.initiatormappings+xml;version=2.4
<initiatorMappings>
    <initiatorMapping>
        <id>1</id>
        <initiatorIqn>iqn.1998-01.com.vmware:localhost-499b41bd</initiatorIqn>
        <targetIqn>iqn.2008-03.com.abiquo.localhost.localdomain:ee6400b8-f6b3-4bfc-be28-877e38348805</targetIqn>
        <targetLun>1</targetLun>
    </initiatorMapping>
    <initiatorMapping>
        <id>2</id>
        <initiatorIqn>iqn.1998-01.com.vmware:localhost-2520c1b4</initiatorIqn>
        <targetIqn>iqn.2008-03.com.abiquo.localhost.localdomain:ee6400b8-f6b3-4bfc-be28-877e38348805</targetIqn>
        <targetLun>1</targetLun>
    </initiatorMapping>
</initiatorMappings>

Get initiator mappings of the given volume

Retrieve a specified initiator mappings of the requested volume

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/volumes/{volume}/action/initiatormappings/{mapping}
Roles Required: ROLE_VDC_MANAGE_STORAGE,ROLE_PHYS_DC_RETRIEVE_DETAILS
Request Headers: Accept: application/vnd.abiquo.initiatormapping+json; version=3.2; application/vnd.abiquo.initiatormapping+xml; version=3.2;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity: InitiatorMapping Media Type
Request Example:

 Click here to show or hide the request example

Get initiator mappins of the given volume example
curl --verbose -X GET http://localhost/api/cloud/virtualdatacenters/2/volumes/255/action/initiatormappings/1
	-H Content-Type: application/vnd.abiquo.initiatormapping+xml;version=2.4
	-u 'user:password' 


HTTP/1.1 200 OK
Content-Type: application/vnd.abiquo.initiatormapping+xml;version=2.4

<initiatorMapping>
    <id>1</id>
    <initiatorIqn>iqn.1998-01.com.vmware:localhost-499b41bd</initiatorIqn>
    <targetIqn>iqn.2008-03.com.abiquo.localhost.localdomain:ee6400b8-f6b3-4bfc-be28-877e38348805</targetIqn>
    <targetLun>1</targetLun>
</initiatorMapping>

------------------------------------------------------------------------------------------------------------------------------