Volume

A Volume represents storage at either the block or the file-system level. Volumes can be connected to Machines. Once connected, Volumes can be accessed by processes on that Machine.
A Volume Collection resource represents the collection of Volumes within a Provider.


Retrieve the Volume Collection

Example request:

GET /cimi/volumes HTTP/1.1
Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
User-Agent: curl/7.24.0 (i686-redhat-linux-gnu)
Host: localhost:3001
Accept: application/xml

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
CIMI-Specification-Version: 1.0.1
Content-Length: 1521
ETag: 5e589664c1b03a34ad42ffe606bd61f1
Cache-Control: max-age=0, private, must-revalidate
 Date: Fri, 04 Jan 2013 16:43:27 GMT
Connection: keep-alive
Server: thin 1.5.0 codename Knife

<Collection xmlns="http://schemas.dmtf.org/cimi/1"
          resourceURI="http://schemas.dmtf.org/cimi/1/VolumeCollection">
  <id>http://localhost:3001/cimi/volumes</id>
  <count>3</count>
  <Volume>
    <id>http://localhost:3001/cimi/volumes/vol3</id>
    <name>vol3</name>
    <description>Description of Volume</description>
    <created>2009-07-30T14:35:11Z</created>
    <state>IN-USE</state>
    <type>http://schemas.dmtf.org/cimi/1/mapped</type>
    <capacity>1048576</capacity>
    <bootable>false</bootable>
    <operation rel="delete" href="http://localhost:3001/cimi/volumes/vol3" />
  </Volume>
  <Volume>
    <id>http://localhost:3001/cimi/volumes/vol2</id>
    <name>vol2</name>
    <description>Description of Volume</description>
    <created>2009-07-30T14:35:11Z</created>
    <state>AVAILABLE</state>
    <type>http://schemas.dmtf.org/cimi/1/mapped</type>
    <capacity>1048576</capacity>
    <bootable>false</bootable>
    <operation rel="delete" href="http://localhost:3001/cimi/volumes/vol2" />
  </Volume>
  <Volume>
    <id>http://localhost:3001/cimi/volumes/vol1</id>
    <name>vol1</name>
    <description>Description of Volume</description>
    <created>2009-07-30T14:35:11Z</created>
    <state>AVAILABLE</state>
    <type>http://schemas.dmtf.org/cimi/1/mapped</type>
    <capacity>1048576</capacity>
    <bootable>false</bootable>
    <operation rel="delete" href="http://localhost:3001/cimi/volumes/vol1" />
  </Volume>
  <operation rel="add" href="http://localhost:3001/cimi/volumes" />
</Collection>

Retrieve a single Volume

Example request:

GET /cimi/volumes/vol1 HTTP/1.1
Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
User-Agent: curl/7.24.0 (i686-redhat-linux-gnu)
Host: localhost:3001
Accept: application/xml

Server response:

HTTP/1.1 200 OK
Content-Type: application/xml
CIMI-Specification-Version: 1.0.1
Content-Length: 490
ETag: a4be42f0743b1a6efbd2ed431667e7d4
Cache-Control: max-age=0, private, must-revalidate
Date: Mon, 07 Jan 2013 13:57:46 GMT
Connection: keep-alive
Server: thin 1.5.0 codename Knife

<Volume xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/Volume">
  <id>http://localhost:3001/cimi/volumes/vol1</id>
  <name>vol1</name>
  <description>Description of Volume</description>
  <created>2009-07-30T14:35:11Z</created>
  <state>AVAILABLE</state>
  <type>http://schemas.dmtf.org/cimi/1/mapped</type>
  <capacity>1048576</capacity>
  <bootable>false</bootable>
  <operation rel="delete" href="http://localhost:3001/cimi/volumes/vol1" />
</Volume>


Create a Volume

Using VolumeTemplate with VolumeConfiguration by reference - Example request:

POST //cimi/volumes HTTP/1.1
Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
User-Agent: curl/7.24.0 (i686-redhat-linux-gnu)
Host: localhost:3001
Content-Type:application/xml
Accept:application/xml
Content-Length: 224

<VolumeCreate>
  <name> marios_new_volume </name>
  <description> a new volume </description>
  <volumeTemplate>
    <volumeConfig
      href="http://localhost:3001/cimi/volume_configurations/2">
    </volumeConfig>
  </volumeTemplate>
</VolumeCreate>

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Location: http://localhost:3001/cimi/volumes/Volume1357567397
CIMI-Specification-Version: 1.0.1
Content-Length: 523
ETag: 56c05e34776373022cefda3c3c4467cb
Cache-Control: max-age=0, private, must-revalidate
Date: Mon, 07 Jan 2013 14:03:17 GMT
Connection: keep-alive
Server: thin 1.5.0 codename Knife

<Volume xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/Volume">
  <id>http://localhost:3001/cimi/volumes/Volume1357567397</id>
  <name>marios_new_volume</name>
  <description>a new volume</description>
  <created>2013-01-07T16:03:17+02:00</created>
  <state>AVAILABLE</state>
  <type>http://schemas.dmtf.org/cimi/1/mapped</type>
  <capacity>2097152</capacity>
  <bootable>false</bootable>
  <operation rel="delete" href="http://localhost:3001/cimi/volumes/Volume1357567397" />
</Volume>

Using VolumeTemplate with VolumeConfiguration by value - Example request:

POST /cimi/volumes HTTP/1.1
Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.5.0 zlib/1.2.5 libidn/1.24 libssh2/1.4.1
Host: localhost:3001
Accept:application/xml
Content-Type: application/xml
Content-Length: 239

<VolumeCreate>
  <name> marios_volume </name>
  <description> a new volume </description>
  <volumeTemplate>
    <volumeConfig>
      <type>http://schemas.dmtf.org/cimi/1/mapped</type>
      <capacity> 1024 </capacity>
    </volumeConfig>
  </volumeTemplate>
</VolumeCreate>

Server response:

HTTP/1.1 201 Created
Content-Type: application/xml
Location: http://localhost:3001/cimi/volumes/Volume1357567628
CIMI-Specification-Version: 1.0.1
Content-Length: 516
ETag: d82624fda83c895cbeaebb08fff005c6
Cache-Control: max-age=0, private, must-revalidate
Date: Mon, 07 Jan 2013 14:07:08 GMT
Connection: keep-alive
Server: thin 1.5.0 codename Knife

<Volume xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/Volume">
  <id>http://localhost:3001/cimi/volumes/Volume1357567628</id>
  <name>marios_volume</name>
  <description>a new volume</description>
  <created>2013-01-07T16:07:08+02:00</created>
  <state>AVAILABLE</state>
  <type>http://schemas.dmtf.org/cimi/1/mapped</type>
  <capacity>1024</capacity>
  <bootable>false</bootable>
  <operation rel="delete" href="http://localhost:3001/cimi/volumes/Volume1357567628" />
</Volume>

Retrieve the Volume Collection

Example request:

DELETE /cimi/volumes/Volume1357567628 HTTP/1.1
Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
User-Agent: curl/7.24.0 (i686-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.5.0 zlib/1.2.5 libidn/1.24 libssh2/1.4.1
Host: localhost:3001
Accept: application/xml

Server response:

HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: text/html;charset=utf-8
CIMI-Specification-Version: 1.0.1
Content-Length: 0
Date: Mon, 07 Jan 2013 14:16:21 GMT
Connection: keep-alive
Server: thin 1.5.0 codename Knife