Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 2.6


Skip to end of metadata
Go to start of metadata

Layers Resource

Exposed Resources Hierarchy
Layers Resource

Contents:

Abiquo has added a layer concept in order to offer anti-affinity host allocation for virtual machines. This means that a virtual appliance can have different layers, and a virtual machine can belong to a layer (it is not mandatory). Virtual machines with the same layer will deploy on different hosts to assure the stability of the virtual appliance.

Main URI of the Resource

This class operates mainly over the Resource URI: /cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers

Exposed Methods

Get a list of layers with their virtual machines

Retrieve a list of layers with their virtual machines.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers
Roles Required: ROLE_VDC_ENUMERATE,ROLE_VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layers+xml; version=2.6; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
Get a list of layers with their virtual machines example
$ curl -X GET http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/layers\
	 -H 'Accept: application/vnd.abiquo.layers+xml; version=2.6'	\
	 -u user:password --verbose


GET http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/layers HTTP/1.1
Accept: application/vnd.abiquo.layers+xml;version=2.6


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/vnd.abiquo.layers+xml;version=2.6
Content-Length: 889

<?xml version="1.0" encoding="UTF-8"?>
<layers>
  <layer>
    <link
      href="http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/layers/layer1" rel="edit"/>
    <link
      href="http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/3"
      rel="virtualmachine" title="ABQ_2197af2d-1b52-4aee-97ae-cb96bb99d5be"/>
    <link
      href="http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/4"
      rel="virtualmachine" title="ABQ_6c4c3d19-99b5-4703-90c1-110d972312af"/>
    <name>layer1</name>
  </layer>
  <layer>
    <link
      href="http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/layers/layer2" rel="edit"/>
    <link
      href="http://10.60.20.60:80/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/5"
      rel="virtualmachine" title="ABQ_6380c704-d949-4028-87a7-ed32c8651be6"/>
    <name>layer2</name>
  </layer>
</layers>


Define new layer

Creates a new layer given a name and a single virtual machine (in any state)

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers
Roles Required: ROLE_VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layer+xml; version=2.6 ; Content-type: application/vnd.abiquo.layer+xml; version=2.6 ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
Defines a new layer example
$ curl -X POST http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/16/layers\
     -H 'Accept: application/vnd.abiquo.layer+xml; version=2.6 \
     -H 'Content-Type: application/vnd.abiquo.layer+xml; version=2.6' \
     -d @layer.xml \
     -u user:password --verbose

HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
Set-Cookie: auth=YWRtaW46MTM2MzI5NTMxNTExMDplZmUzOTliN2ZhZmZjNzlhZmRiZTE5YmI2OWFlZGYxMDpBQklRVU8; Expires=Thu, 14-Mar-2013 21:08:35 GMT; Path=/api
Location: http://10.60.11.10:80/api/cloud/virtualdatacenters/1/virtualappliances/16/layers/layerA
Content-Type: application/vnd.abiquo.layer+xml;version=2.6

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<layer>
<link title="ABQ_972c60fa-1121-45a6-b626-23262e43258e" rel="virtualmachine" href="http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/16/virtualmachines/270"/>
<link rel="edit" type="application/vnd.abiquo.layer+xml" href="http://example.com/api/cloud/virtualdatacenters/1/virtualappliances/16/layers/layerA"/>
<name>layerA</name>
</layer> 

Download a template

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

Get the list of virtual machines of a given layer

Retrieve the list of virtual machines of a given layer.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers/{layer}
Roles Required: ROLE_VDC_ENUMERATE,ROLE_VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layer+xml; version=2.6; Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
Get the list of virtual machines of a given layer example
curl -X GET http://localhost:80/api/cloud/virtualdatacenters/39/virtualappliances/38/layers/layerA\
     -H 'Accept: application/vnd.abiquo.layer+xml;version=2.6'    \
     -u user:password --verbose

  
HTTP/1.1 200 OK
Date: Mon, 22 Oct 2012 08:33:52 GMT
Set-Cookie: JSESSIONID=27CFCBCDEE5E3593A439CD027FDF0A5C; Path=/api
Set-Cookie:
   
auth=YWRtaW46MTM1MDg5NjYzMjU4OTplMDFmMzcwMzQ3ZDE1NmRkYTJkYzc1ZGQwOWFmODVmNjpBQklRVU8;
 Expires=Mon, 22-Oct-2012 09:03:52 GMT; Path=/api
Server: Apache-Coyote/1.1
Content-Type: application/vnd.abiquo.layers+xml;version=2.6
Content-Length: 748
  
<?xml version="1.0" encoding="UTF-8"?>
<layer>
    <link rel="edit" href="http://localhost:80/api/cloud/virtualdatacenters/39/virtualappliances/38/layers/layerA"/>
    <link rel="virtualmachine" href="http://localhost:80/api/cloud/virtualdatacenters/39/virtualappliances/38/virtualmachines/240"/>
    <link rel="virtualmachine" href="http://localhost:80/api/cloud/virtualdatacenters/39/virtualappliances/38/virtualmachines/241"/>
    <name>layerA</name>
</layer>

Delete layer

The layer should be empty, with a single virtual machine in any state.

Synopsis: DELETE http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers/{layer}
Roles Required: ROLE_VAPP_MANAGE_LAYERS
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
Deletes a layer example
curl -X DELETE http://localhost:80/api/cloud/virtualdatacenters/39/virtualappliances/38/layers/layerA\
     -u user:password --verbose
 
 
DELETE http://example.com/api/cloud/virtualdatacenters/39/virtualappliances/38/layers/layerA HTTP/1.1
 
HTTP/1.1 204 No Content
Date: Wed, 16 Jan 2013 14:11:25 GMT
Server: Apache-Coyote/1.1


Change layer name and virtual machines

Modify the name of a layer and its virtual machines.

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers/{layer}
Roles Required: ROLE_VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layer+xml; version=2.6; Content-type: application/vnd.abiquo.layer+xml; version=2.6;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example
Change layer name and virtual machines example
curl -X PUT -u  'http://example.com/api/cloud/virtualdatacenters/39/virtualappliances/38/layers/layerA'\
-H 'Accept: application/vnd.abiquo.layer+xml; version=2.6'\
-H 'Content-Type: application/vnd.abiquo.layer+xml; version=2.6'\
-d@putlayer.xml \
user:password 

<layer>
    <link rel="edit" href="http://localhost:80/api/cloud/virtualdatacenters/40/virtualappliances/39/layers/modifiedLayer"/>
    <link rel="virtualmachine" href="http://localhost:80/api/cloud/virtualdatacenters/40/virtualappliances/39/virtualmachines/240"/>
    <link rel="virtualmachine" href="http://localhost:80/api/cloud/virtualdatacenters/40/virtualappliances/39/virtualmachines/241"/>
    <name>modifiedLayer</name>
</layer>

Download a template

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