The
datacenters
collection provides information about the data centers in a Red Hat Enterprise Virtualization environment. An API user accesses this information through the
rel="datacenters"
link obtained from the entry point URI (see
Chapter 4, Entry Point).
The following table shows specific elements contained in a data center resource representation.
8.1. Storage Domains Sub-Collection
Each data center contains a sub-collection for attached storages domain. An API user interacts with this sub-collection using the standard REST methods as per
Chapter 7, Common Features.
An attached storage domain has a similar representation to a top-level storage domain, with the exception that it has a data center specific
status
and set of actions. States for the
status
element are listed in
storage_domain_states
under
capabilities
(See
Section 6.1.21, “Resource Status States”)
8.1.1. Attaching a Storage Domain
A data center is only ready for use when at least one storage domain is attached, which an API user POST
s to the data center's storage domains sub-collection.
When attaching a storage domain, its id
or name
must be supplied. An example of attaching a storage domain to a data center:
Example 8.5. Attach a storage domain to a data center
POST /api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/storagedomains HTTP/1.1
Accept: application/xml
Content-type: application/xml
<storage_domain id="fabe0451-701f-4235-8f7e-e20e458819ed"/>
HTTP/1.1 201 Created
Location: /datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/storagedomains/fabe0451-701f-4235-8f7e-e20e458819ed
Content-Type: application/xml
<storage_domain id="fabe0451-701f-4235-8f7e-e20e458819ed"
href="/api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/storagedomains/
fabe0451-701f-4235-8f7e-e20e458819ed">
<name>images0</name>
<type>data</type>
<status>
<state>inactive</state>
</status>
<master>true</master>
<storage>
<type>nfs</type>
<address>172.31.0.6</address>
<path>/exports/RHEVX/images/0</path>
</storage>
<data_center id="d70d5e2d-b8ad-494a-a4d2-c7a5631073c4"
href="/api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4"/>
<actions>
<link rel="activate"
href="/api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/
storagedomains/fabe0451-701f-4235-8f7e-e20e458819ed/activate"/>
<link rel="deactivate"
href="/api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/
storagedomains/fabe0451-701f-4235-8f7e-e20e458819ed/deactivate"/>
</actions>
</storage_domain>
There are two possible actions for attached storage domains: activate
and deactivate
.
An attached storage domain requires activation on a data center before use. The activate action does not take any action specific parameters.
Example 8.6. Action to active a storage domain on a datacenter
POST /api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/storagedomains/fabe0451-701f-4235-8f7e-e20e458819ed/activate HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
8.1.2.2. Deactivate Action
An attached storage domain is deactivated on a data center before removal. The deactivate action does not take any action specific parameters.
Example 8.7. Action to deactivate a storage domain on a datacenter
POST /api/datacenters/d70d5e2d-b8ad-494a-a4d2-c7a5631073c4/storagedomains/fabe0451-701f-4235-8f7e-e20e458819ed/deactivate HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>