3.9. 示例:将存储域连接到数据中心


以下示例将 data1iso1 存储域附加到 Default 数据中心。

例 3.9. 将 data1 存储域附加到 Default 数据中心

request:

POST /ovirt-engine/api/datacenters/01a45ff0-915a-11e0-8b87-5254004ac988/storagedomains HTTP/1.1
Accept: application/xml
Content-type: application/xml

<storage_domain>
  <name>data1</name>
</storage_domain>

curl 命令:

# curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" \
    -u [USER:PASS] --cacert [CERT] \
    -d "<storage_domain><name>data1</name></storage_domain>" \
    https://[RHEVM Host]:443/ovirt-engine/api/datacenters/01a45ff0-915a-11e0-8b87-5254004ac988/storagedomains

例 3.10. 将 iso1 存储域附加到 Default 数据中心

request:

POST /ovirt-engine/api/datacenters/01a45ff0-915a-11e0-8b87-5254004ac988/storagedomains HTTP/1.1
Accept: application/xml
Content-type: application/xml

<storage_domain>
  <name>iso1</name>
</storage_domain>

curl 命令:

# curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" \
    -u [USER:PASS] --cacert [CERT] \
    -d "<storage_domain><name>iso1</name></storage_domain>" \
    https://[RHEVM Host]:443/ovirt-engine/api/datacenters/01a45ff0-915a-11e0-8b87-5254004ac988/storagedomains

这些 POST 请求将两个新的 storage_domain 资源放在 Default 数据中心的 storagedomains 子集合中。这意味着 storagedomains 子集合包含数据中心的附加存储域。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.