URLs
DELETE zstack/v1/primary-storage/{uuid}?deleteMode={deleteMode} Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth af6279db8d5d4434afe789fdb214fe86" \ -X DELETE http://localhost:8080/zstack/v1/primary-storage/84ecb184e2f649ac9300f804dfd9f43e?deleteMode=Permissive 参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 数据存储的UUID,唯一标示该资源 | 0.6 | |
| deleteMode (可选) | String | body | 删除模式(Permissive 或者 Enforcing, 默认 Permissive) | 0.6 | |
| systemTags (可选) | List | body | 系统标签 | 0.6 | |
| userTags (可选) | List | body | 用户标签 | 0.6 |
该API成功时返回一个空的JSON结构{},出错时返回的JSON结构包含一个error字段,例如:
{ "error": { "code": "SYS.1001", "description": "A message or a operation timeout", "details": "Create VM on KVM timeout after 300s" } } DeletePrimaryStorageAction action = new DeletePrimaryStorageAction(); action.uuid = "c471a57db90945129303e69cf731fee3"; action.deleteMode = "Permissive"; action.sessionId = "34041f0d587e4ce1827dd88f34a0a94b"; DeletePrimaryStorageAction.Result res = action.call();Python SDK
DeletePrimaryStorageAction action = DeletePrimaryStorageAction() action.uuid = "309a9da1c0884e679dd7f96502130ce3" action.deleteMode = "Permissive" action.sessionId = "0aa8b461719c45eea867c0be49565489" DeletePrimaryStorageAction.Result res = action.call() GET zstack/v1/primary-storageAuthorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth f889c6a0220c4b34b3007f72bd04e839" \ -X GET http://localhost:8080/zstack/v1/primary-storage?q=uuid=2160b1e46b0a422fbc9ce6e4a7de1023 可查询字段
运行CLI命令行工具,输入QueryPrimaryStorage并按Tab键查看所有可查询字段以及可跨表查询的资源名。
{ "inventories": [ { "name": "PS1", "url": "/Cloud_ps", "type": "LocalStorage", "state": "Enabled", "status": "Connected", "attachedClusterUuids": [ "efbdb96e4f9c457eacf11dcb19923af9" ] } ] }| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
| inventories | List | 详情参考inventories | 0.6 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| zoneUuid | String | 数据中心UUID | 0.6 |
| name | String | 资源名称 | 0.6 |
| url | String | 0.6 | |
| description | String | 资源的详细描述 | 0.6 |
| totalCapacity | Long | 0.6 | |
| availableCapacity | Long | 0.6 | |
| totalPhysicalCapacity | Long | 0.6 | |
| availablePhysicalCapacity | Long | 0.6 | |
| systemUsedCapacity | Long | 0.6 | |
| type | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| mountPath | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| attachedClusterUuids | List | 0.6 |
QueryPrimaryStorageAction action = new QueryPrimaryStorageAction(); action.conditions = asList("uuid=56235f6bf5c24513bce99d4ec824c63f"); action.sessionId = "16f5568fa9aa48e79b3a3ed579787fd0"; QueryPrimaryStorageAction.Result res = action.call();QueryPrimaryStorageAction action = QueryPrimaryStorageAction() action.conditions = ["uuid=52f2459af9ce4c35a0c7de9c98aaebb0"] action.sessionId = "ade5be353d114f948f976ae43d397815" QueryPrimaryStorageAction.Result res = action.call()POST zstack/v1/clusters/{clusterUuid}/primary-storage/{primaryStorageUuid}Authorization: OAuth the-session-uuid{ "params": {}, "systemTags": [], "userTags": [] } curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/clusters/06fa0d99fd9733409ea9dcb29e070fcf/primary-storage/e6df72f4eaaa324fb650cb7165bff218| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| clusterUuid | String | url | 集群UUID | 0.6 | |
| primaryStorageUuid | String | url | 数据存储UUID | 0.6 | |
| systemTags (可选) | List | body | 系统标签 | 0.6 | |
| userTags (可选) | List | body | 用户标签 | 0.6 |
{ "inventory": { "name": "PS1", "url": "/Cloud_ps", "type": "LocalStorage", "state": "Enabled", "status": "Connected", "attachedClusterUuids": [ "f0262ff5aeb54cd19e0a33bfaa61f5a4" ] } }| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 4.7.0 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
| inventory | PrimaryStorageInventory | 详情参考inventory | 0.6 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| zoneUuid | String | 数据中心UUID | 0.6 |
| name | String | 资源名称 | 0.6 |
| url | String | 0.6 | |
| description | String | 资源的详细描述 | 0.6 |
| totalCapacity | Long | 0.6 | |
| availableCapacity | Long | 0.6 | |
| totalPhysicalCapacity | Long | 0.6 | |
| availablePhysicalCapacity | Long | 0.6 | |
| systemUsedCapacity | Long | 0.6 | |
| type | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| mountPath | String | 0.6 | |
| createDate | Timestamp | 创建时间 | 0.6 |
| lastOpDate | Timestamp | 最后一次修改时间 | 0.6 |
| attachedClusterUuids | List | 0.6 |
AttachPrimaryStorageToClusterAction action = new AttachPrimaryStorageToClusterAction(); action.clusterUuid = "473e453a99844ea2a3b65aa637d33841"; action.primaryStorageUuid = "ffd9b14c1c3442f2bde3209cbe9cc195"; action.sessionId = "97c7848a46b44ba89f348f434b5f2288"; AttachPrimaryStorageToClusterAction.Result res = action.call();AttachPrimaryStorageToClusterAction action = AttachPrimaryStorageToClusterAction() action.clusterUuid = "cfae196b0d514f9fbc6ecd5360cb6ccf" action.primaryStorageUuid = "c122244cd9ab48fa80f61e781e98bb03" action.sessionId = "c5b2cc8440fc4a6299c5f96a37d38a7f" AttachPrimaryStorageToClusterAction.Result res = action.call()学习路径
ZStack Cloud 产品学习路径
快速梳理文档,点击相应文本链接,快速跳转到相应文档的页面,学习 ZStack Cloud 产品。
业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1ZStack学院:
training@zstack.io业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2其他(漏洞提交、投诉举报等)
400-962-2212 转 3业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io业务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io下载链接已发送至您的邮箱。
如未收到,请查看您的垃圾邮件、订阅邮件、广告邮件。 当您收到电子邮件后,请点击 URL 链接,以完成下载。感谢您使用 ZStack 产品和服务。
成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。
信息提交成功。
我们将安排工作人员尽快与您取得联系,请保持电话畅通。感谢您使用 ZStack 产品和服务。
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。