获取镜像仓库候选
获取创建镜像的镜像仓库候选。
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/images/candidate-backup-storage?volumeUuid=599c51abe51a320d842584f90984a6f4&volumeSnapshotUuid=2deb33e07a90373ea4fa7bd3a0352e0dcurl -H "Content-Type: application/json" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/images/volumes/599c51abe51a320d842584f90984a6f4/candidate-backup-storage?volumeUuid=599c51abe51a320d842584f90984a6f4&volumeSnapshotUuid=2deb33e07a90373ea4fa7bd3a0352e0dcurl -H "Content-Type: application/json" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/images/volume-snapshots/2deb33e07a90373ea4fa7bd3a0352e0d/candidate-backup-storage?volumeUuid=599c51abe51a320d842584f90984a6f4&volumeSnapshotUuid=2deb33e07a90373ea4fa7bd3a0352e0d参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| volumeUuid (可选) | String | query | 硬盘UUID,注意:volumeUuid 和 volumeSnapshotUuid 二选一 | 0.6 | |
| volumeSnapshotUuid (可选) | String | query | 硬盘快照UUID,注意:volumeUuid 和 volumeSnapshotUuid 二选一 | 0.6 | |
| systemTags (可选) | List | query | 系统标签 | 0.6 | |
| userTags (可选) | List | query | 用户标签 | 0.6 |
API返回
该API成功时返回一个空的JSON结构**{}**,出错时返回的JSON结构包含一个error字段,例如:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK示例
Java SDK
GetCandidateBackupStorageForCreatingImageAction action = new GetCandidateBackupStorageForCreatingImageAction();
action.volumeUuid = "77e77779b5f94617af0a8b08b4a50129";
action.volumeSnapshotUuid = "4a5220b5b1f044f8826520eb506d0f98";
action.sessionId = "45b0a87571c2476ba2fe6623daaa79cf";
GetCandidateBackupStorageForCreatingImageAction.Result res = action.call();Python SDK
GetCandidateBackupStorageForCreatingImageAction action = GetCandidateBackupStorageForCreatingImageAction()
action.volumeUuid = "83792660358b4e14b266c5d0920b8b21"
action.volumeSnapshotUuid = "3d562e4325cc42ce8bd3115b48f79ae4"
action.sessionId = "2ba3d333ac284a20adc782766f597330"
GetCandidateBackupStorageForCreatingImageAction.Result res = action.call()