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:

Machine Datastores Resource

This resource allows you to manage datastores from physical machines in the cloud infrastructure.

Main URI of the Resource

This class operates mainly over the Resource URI: /admin/datacenters/{datacenter}/racks/{rack}/machines/{machine}/datastores

Exposed Methods

List datastores of a machine

Returns all datastores from a machine.

Synopsis: GET http://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/machines/{machine}/datastores
Roles Required: PHYS_DC_RETRIEVE_DETAILS
Request Headers: Accept: application/vnd.abiquo.datastores+json; version=4.4; application/vnd.abiquo.datastores+xml; version=4.4;  Content-type: ;

Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

GET_adm_dcs_X_rks_X_ms_X_dstrs_AC_dstrs_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/datacenters/5353/racks/1610/machines/1746/datastores \ 
	 -H 'Accept:application/vnd.abiquo.datastores+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": [
    {
      "name": "datastoreName", 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/datacenters/5353/racks/1610/machines/1746/datastores/1468", 
          "type": "application/vnd.abiquo.datastore+json", 
          "rel": "edit", 
          "title": "datastoreName"
        }, 
        {
          "href": "http://localhost:9009/api/admin/datacenters/5353/racks/1610/machines/1746/datastores/1468/disks", 
          "type": "application/vnd.abiquo.harddisks+json", 
          "rel": "disks", 
          "title": "datastore disks"
        }, 
        {
          "href": "http://localhost:9009/api/admin/datacenters/5353/racks/1610/machines/1746", 
          "type": "application/vnd.abiquo.machine+json", 
          "rel": "machine", 
          "title": "machine_test"
        }, 
        {
          "href": "http://localhost:9009/api/admin/datacenters/5353/datastoretiers/1385", 
          "type": "application/vnd.abiquo.datastoretier+json", 
          "rel": "datastoretier", 
          "title": "Default datastore tier"
        }
      ], 
      "datastoreUUID": "d18dcf95-5a6d-4104-9a78-e34a164eb5be", 
      "usedSize": 0, 
      "enabled": true, 
      "rootPath": "/", 
      "directory": "var/lib/virt", 
      "id": 1468, 
      "size": 0
    }
  ]
}

Refresh the list of datastores of a machine

Refreshes the list of datastores of the current physical machine.

Synopsis: GET http://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/machines/{machine}/datastores/action/refresh
Roles Required: PHYS_DC_ALLOW_MODIFY_SERVERS
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

GET_adm_dcs_X_rks_X_ms_X_dstrs_act_rf.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/datacenters/5467/racks/1663/machines/1801/datastores/action/refresh \ 
	 -H 'Accept:application/xml' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

 

Get a datastore

Returns a datastore from a machine.

Synopsis: GET http://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/machines/{machine}/datastores/{datastore}
Roles Required: PHYS_DC_RETRIEVE_DETAILS
Request Headers: Accept: application/vnd.abiquo.datastore+json; version=4.4; application/vnd.abiquo.datastore+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

GET_adm_dcs_X_rks_X_ms_X_dstrs_X_AC_ds_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/datacenters/212/racks/104/machines/109/datastores/101 \ 
	 -H 'Accept:application/vnd.abiquo.datastore+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "name": "14", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/212/racks/104/machines/109/datastores/101", 
      "type": "application/vnd.abiquo.datastore+json", 
      "rel": "edit", 
      "title": "14"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/212/racks/104/machines/109/datastores/101/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "disks", 
      "title": "datastore disks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/212/racks/104/machines/109", 
      "type": "application/vnd.abiquo.machine+json", 
      "rel": "machine", 
      "title": "10"
    }
  ], 
  "datastoreUUID": "cef3b7cb-d95a-4700-9b80-fc2bf4a4f372", 
  "usedSize": 0, 
  "enabled": true, 
  "rootPath": "12", 
  "directory": "13", 
  "id": 101, 
  "size": 241013719040
}

Update a datastore

Modifies a datastore.

Synopsis: PUT http://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/machines/{machine}/datastores/{datastore}
Roles Required: PHYS_DC_ALLOW_MODIFY_SERVERS
Request Headers: Accept: application/vnd.abiquo.datastore+json; version=4.4; application/vnd.abiquo.datastore+xml; version=4.4;  Content-type:  application/vnd.abiquo.datastore+json; version=4.4; application/vnd.abiquo.datastore+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

PUT_adm_dcs_X_rks_X_ms_X_dstrs_X_CT_ds_j_AC_ds_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/admin/datacenters/213/racks/105/machines/110/datastores/102 \ 
	 -H 'Accept:application/vnd.abiquo.datastore+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.datastore+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "name": "updatedDatastoreName", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/racks/105/machines/110/datastores/102", 
      "type": "application/vnd.abiquo.datastore+json", 
      "rel": "edit", 
      "title": "29"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/racks/105/machines/110/datastores/102/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "disks", 
      "title": "datastore disks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/racks/105/machines/110", 
      "type": "application/vnd.abiquo.machine+json", 
      "rel": "machine", 
      "title": "25"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/datastoretiers/117", 
      "rel": "datastoretier"
    }
  ], 
  "datastoreUUID": "b5f876f6-7316-4f04-a6f4-ce60b45ec384", 
  "usedSize": 0, 
  "enabled": true, 
  "rootPath": "27", 
  "directory": "28", 
  "id": 102, 
  "size": 241013719040
}

Response payload:

{
  "name": "updatedDatastoreName", 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/racks/105/machines/110/datastores/102", 
      "type": "application/vnd.abiquo.datastore+json", 
      "rel": "edit", 
      "title": "updatedDatastoreName"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/racks/105/machines/110/datastores/102/disks", 
      "type": "application/vnd.abiquo.harddisks+json", 
      "rel": "disks", 
      "title": "datastore disks"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/racks/105/machines/110", 
      "type": "application/vnd.abiquo.machine+json", 
      "rel": "machine", 
      "title": "25"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/213/datastoretiers/117", 
      "type": "application/vnd.abiquo.datastoretier+json", 
      "rel": "datastoretier", 
      "title": "30"
    }
  ], 
  "datastoreUUID": "b5f876f6-7316-4f04-a6f4-ce60b45ec384", 
  "usedSize": 0, 
  "enabled": true, 
  "rootPath": "27", 
  "directory": "28", 
  "id": 102, 
  "size": 241013719040
}

 

List disks on a datastore of a machine

Returns all the disks on a datastore of a machine.

Paging Method

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

Synopsis: GET http://example.com/api/admin/datacenters/{datacenter}/racks/{rack}/machines/{machine}/datastores
Roles Required: PHYS_DC_RETRIEVE_DETAILS
Request Headers: Accept:  application/vnd.abiquo.harddisks+json; version=4.4; application/vnd.abiquo.harddisks+xml; version=4.4;  Content-type: ;

Request Parameters:


Parameter

Required

Default Value

Description

startwith

false

0

first element to retrieve

by

false

name

parameter for ordering

has

false

 

name to filter the results

limit

false

25

total number of elements in the result set

asc

false

true

true/false for ascending/descending order

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

 Click here to show or hide the request example

GET_adm_dcs_X_rks_X_ms_X_dstrs_X_disks_AC_hds_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/datacenters/339/racks/140/machines/146/datastores/143/disks \ 
	 -H 'Accept:application/vnd.abiquo.harddisks+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 4, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/339/racks/140/machines/146/datastores/143/disks?limit=25&by=name&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/339/racks/140/machines/146/datastores/143/disks?startwith=0&limit=25&by=name&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "diskFormatType": "RAW", 
      "uuid": "1e2f27a1-37be-472a-8360-f5422ce8c93c", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "vdc1"
        }, 
        {
          "diskControllerType": "IDE", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/disks/891", 
          "type": "application/vnd.abiquo.harddisk+json", 
          "diskLabel": "154", 
          "rel": "edit"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/virtualappliances/137/virtualmachines/139", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "vm1"
        }
      ], 
      "sequence": 0, 
      "bootable": true, 
      "label": "154", 
      "diskFileSize": 8674869248, 
      "sizeInMb": 8273, 
      "path": "153", 
      "id": 891, 
      "diskControllerType": "IDE"
    }, 
    {
      "diskFormatType": "RAW", 
      "uuid": "eabd7408-add8-4ada-8f59-f546d244df76", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "vdc1"
        }, 
        {
          "diskControllerType": "IDE", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/disks/895", 
          "type": "application/vnd.abiquo.harddisk+json", 
          "diskLabel": "162", 
          "rel": "edit"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/virtualappliances/137/virtualmachines/139", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "vm1"
        }
      ], 
      "sequence": 0, 
      "bootable": true, 
      "label": "162", 
      "diskFileSize": 5812256768, 
      "sizeInMb": 5543, 
      "path": "161", 
      "id": 895, 
      "diskControllerType": "IDE"
    }, 
    {
      "diskFormatType": "RAW", 
      "uuid": "1534ee72-c207-4083-b6b5-6a9b40ca051d", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/170", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "vdc2"
        }, 
        {
          "diskControllerType": "IDE", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/170/disks/892", 
          "type": "application/vnd.abiquo.harddisk+json", 
          "diskLabel": "156", 
          "rel": "edit"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/170/virtualappliances/138/virtualmachines/140", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "vm2"
        }
      ], 
      "sequence": 0, 
      "bootable": true, 
      "label": "156", 
      "diskFileSize": 2800746496, 
      "sizeInMb": 2671, 
      "path": "155", 
      "id": 892, 
      "diskControllerType": "IDE"
    }, 
    {
      "diskFormatType": "RAW", 
      "uuid": "9cb18899-5f92-4a36-b2ca-a29fa73e873f", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/170", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "vdc2"
        }, 
        {
          "diskControllerType": "IDE", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/170/disks/896", 
          "type": "application/vnd.abiquo.harddisk+json", 
          "diskLabel": "164", 
          "rel": "edit"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/170/virtualappliances/138/virtualmachines/140", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "vm2"
        }
      ], 
      "sequence": 0, 
      "bootable": true, 
      "label": "164", 
      "diskFileSize": 1601175552, 
      "sizeInMb": 1527, 
      "path": "163", 
      "id": 896, 
      "diskControllerType": "IDE"
    }
  ]
}

Example with request parameters

 Click here to show/hide the request example

GET_adm_dcs_X_rks_X_ms_X_dstrs_X_disks_AC_hds_j_lmt_startw_by_path_asc_T_has.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/datacenters/339/racks/140/machines/146/datastores/143/disks?limit=0&startwith=0&by=path&asc=true&has=vm1 \ 
	 -H 'Accept:application/vnd.abiquo.harddisks+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 2, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/datacenters/339/racks/140/machines/146/datastores/143/disks?limit=0&has=vm1&by=path&asc=true", 
      "rel": "first"
    }, 
    {
      "href": "http://localhost:9009/api/admin/datacenters/339/racks/140/machines/146/datastores/143/disks?startwith=0&limit=0&has=vm1&by=path&asc=true", 
      "rel": "last"
    }
  ], 
  "collection": [
    {
      "diskFormatType": "RAW", 
      "uuid": "1e2f27a1-37be-472a-8360-f5422ce8c93c", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "vdc1"
        }, 
        {
          "diskControllerType": "IDE", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/disks/891", 
          "type": "application/vnd.abiquo.harddisk+json", 
          "diskLabel": "154", 
          "rel": "edit"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/virtualappliances/137/virtualmachines/139", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "vm1"
        }
      ], 
      "sequence": 0, 
      "bootable": true, 
      "label": "154", 
      "diskFileSize": 8674869248, 
      "sizeInMb": 8273, 
      "path": "153", 
      "id": 891, 
      "diskControllerType": "IDE"
    }, 
    {
      "diskFormatType": "RAW", 
      "uuid": "eabd7408-add8-4ada-8f59-f546d244df76", 
      "links": [
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169", 
          "type": "application/vnd.abiquo.virtualdatacenter+json", 
          "rel": "virtualdatacenter", 
          "title": "vdc1"
        }, 
        {
          "diskControllerType": "IDE", 
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/disks/895", 
          "type": "application/vnd.abiquo.harddisk+json", 
          "diskLabel": "162", 
          "rel": "edit"
        }, 
        {
          "href": "http://localhost:9009/api/cloud/virtualdatacenters/169/virtualappliances/137/virtualmachines/139", 
          "type": "application/vnd.abiquo.virtualmachine+json", 
          "rel": "virtualmachine", 
          "title": "vm1"
        }
      ], 
      "sequence": 0, 
      "bootable": true, 
      "label": "162", 
      "diskFileSize": 5812256768, 
      "sizeInMb": 5543, 
      "path": "161", 
      "id": 895, 
      "diskControllerType": "IDE"
    }
  ]
}