3.2. 示例:列出数据中心集合
Red Hat Virtualization Manager 在安装时会创建一个
Default
数据中心。这个示例使用 Default
数据中心作为我们虚拟环境的基础。
以下请求检索数据中心集合的表示:
例 3.2. 列出数据中心集合
request:
GET /ovirt-engine/api/datacenters HTTP/1.1 Accept: application/xml
curl 命令:
# curl -X GET -H "Accept: application/xml" -u [USER:PASS] \ --cacert [CERT] \ https://[RHEVM Host]:443/ovirt-engine/api/datacenters
结果:
HTTP/1.1 200 OK Content-Type: application/xml <data_centers> <data_center href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab" id="00000002-0002-0002-0002-0000000003ab"> <name>Default</name> <description>The default Data Center</description> <link rel="storagedomains"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/storagedomains" <link rel="clusters"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/clusters" <link rel="networks"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/networks" <link rel="permissions"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/permissions" <link rel="quotas"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/quotas" <link rel="iscsibonds"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/iscsibonds" <link rel="qoss"/> href="/ovirt-engine/api/datacenters/00000002-0002-0002-0002-0000000003ab/qoss" <local>false</local> <storage_format>v3</storage_format> <version major="4" minor="0"/> <supported_versions> <version major="4" minor="0"/> </supported_versions> <status> <state>up</state> </status> </data_center> </data_centers>
请注意
Default
数据中心的 id
代码。此代码标识了此数据中心与虚拟环境的其他资源相关。
数据中心还包含指向
storagedomains
子集合的链接。数据中心使用此子集合从 storagedomains
主集合中附加存储域,本例将在以后介绍。