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 4.4

Skip to end of metadata
Go to start of metadata

Contents:

Layers Resource

Layers offer antiaffinity in the allocation of hosts to VMs. A virtual appliance can have several layers, and each VM  can belong to a layer. The platform will deploy VMs in the same layer on different hosts to assure the stability of the virtual appliance. Actions on VMs with layers must respect the antiaffinity rules. See also the UI documentation Manage Virtual Appliances#CreateVMswithhighavailability

Main URI of the Resource

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

Exposed Methods

List layers with virtual machines

Retrieve a list of layers with their VMs

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers
Roles Required: VDC_ENUMERATE,VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layers+json; version=4.4; application/vnd.abiquo.layers+xml; version=4.4;  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_cld_vdcs_X_vapps_X_lyrs_AC_lyrs_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/1591/virtualappliances/772/layers \ 
	 -H 'Accept:application/vnd.abiquo.layers+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "name": "layer1", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/1591/virtualappliances/772/virtualmachines/764", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "notDeployedVMName0.03581285266685552"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/1591/virtualappliances/772/layers/layer1", 
          "type": "application/vnd.abiquo.layer+json", 
          "rel": "edit", 
          "title": "layer1"
        }
      ]
    }, 
    {
      "name": "layer2", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/1591/virtualappliances/772/virtualmachines/765", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "notDeployedVMName0.29720551754988167"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/1591/virtualappliances/772/virtualmachines/766", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "notDeployedVMName0.09071310626071194"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/1591/virtualappliances/772/layers/layer2", 
          "type": "application/vnd.abiquo.layer+json", 
          "rel": "edit", 
          "title": "layer2"
        }
      ]
    }
  ]
}

Create a layer

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

Synopsis: POST http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers
Roles Required: VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layer+json; version=4.4; application/vnd.abiquo.layer+xml; version=4.4;  Content-type:  application/vnd.abiquo.layer+json; version=4.4; application/vnd.abiquo.layer+xml; version=4.4;
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

POST_cld_vdcs_X_vapps_X_lyrs_CT_lyr_j_AC_lyr_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/cloud/virtualdatacenters/1582/virtualappliances/763/layers \ 
	 -H 'Accept:application/vnd.abiquo.layer+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.layer+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "name": "newlayer", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1582/virtualappliances/763/virtualmachines/749", 
      "rel": "virtualmachine"
    }
  ]
}

Response payload:

{
  "name": "newlayer", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1582/virtualappliances/763/virtualmachines/749", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "notDeployedVMName0.2252815979345253"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1582/virtualappliances/763/layers/newlayer", 
      "type": "application/vnd.abiquo.layer+json", 
      "rel": "edit", 
      "title": "newlayer"
    }
  ]
}

 

List virtual machines in a layer

Retrieve the list of VMs in a given layer.

Synopsis: GET http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers/{layer}
Roles Required: VDC_ENUMERATE,VAPP_MANAGE_LAYERS
Request Headers: Accept: application/vnd.abiquo.layer+json; version=4.4; application/vnd.abiquo.layer+xml; version=4.4;  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_cld_vdcs_X_vapps_X_lyrs_lyr1_AC_lyr_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/virtualdatacenters/1588/virtualappliances/769/layers/layer1 \ 
	 -H 'Accept:application/vnd.abiquo.layer+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "name": "layer1", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1588/virtualappliances/769/virtualmachines/759", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "notDeployedVMName0.29574895436334603"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1588/virtualappliances/769/layers/layer1", 
      "type": "application/vnd.abiquo.layer+json", 
      "rel": "edit", 
      "title": "layer1"
    }
  ]
}

Delete a layer

To delete a layer, the layer should be empty, or have a single VM in any state.

Synopsis: DELETE http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers/{layer}
Roles Required: 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

DELETE_cld_vdcs_X_vapps_X_lyrs_la.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/cloud/virtualdatacenters/1586/virtualappliances/767/layers/la \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Update a layer

Modify the name of a layer and its VMs.

Synopsis: PUT http://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/virtualappliances/{virtualappliance}/layers/{layer}
Roles Required: VAPP_MANAGE_LAYER
Request Headers: Accept: application/vnd.abiquo.layer+json; version=4.4; application/vnd.abiquo.layer+xml; version=4.4;  Content-type:  application/vnd.abiquo.layer+json; version=4.4; application/vnd.abiquo.layer+xml; version=4.4;
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

PUT_cld_vdcs_X_vapps_X_lyrs_lyr1_CT_lyr_j_AC_lyr_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/virtualdatacenters/1597/virtualappliances/778/layers/layer1 \ 
	 -H 'Accept:application/vnd.abiquo.layer+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.layer+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "name": "updatedLayer", 
  "links": []
}

Response payload:

{
  "name": "updatedLayer", 
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1597/virtualappliances/778/virtualmachines/779", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "notDeployedVMName0.765378791694767"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1597/virtualappliances/778/virtualmachines/780", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "notDeployedVMName0.878267335609113"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1597/virtualappliances/778/virtualmachines/781", 
      "type": "application/vnd.abiquo.virtualmachine+json", 
      "rel": "virtualmachine", 
      "title": "notDeployedVMName0.4790917967992815"
    }, 
    {
      "href": "http://localhost:9009/api/cloud/virtualdatacenters/1597/virtualappliances/778/layers/updatedLayer", 
      "type": "application/vnd.abiquo.layer+json", 
      "rel": "edit", 
      "title": "updatedLayer"
    }
  ]
}