3.2. List Data Center Collection

Red Hat Enterprise Virtualization Manager creates a Default data center on installation. This example uses the Default data center as the basis for our virtual environment.
The following request retrieves a representation of the data center collection:

Example 3.2. List data center collection

GET /api/datacenters HTTP/1.1
Accept: application/xml
cURL command:
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHEVM Host]:8443/api/datacenters
The API returns the following representation:
HTTP/1.1 200 OK
Content-Type: application/xml

    <data_center id="01a45ff0-915a-11e0-8b87-5254004ac988"
        <description>The default Data Center</description>
        <link rel="storagedomains"
        <link rel="permissions"
        <version minor="0" major="3"/>
            <version minor="0" major="3"/>

Note the id code of your Default data center. This code identifies this data center in relation to other resources of your virtual environment.
The data center also contains a link to the storagedomains sub-collection. The data center uses this sub-collection to attach storage domains from the storagedomains main collection, which this example covers later.