查询卷备份记录(QueryVolumeBackup)

API请求

URLs
GET zstack/v1/volume-backups
GET zstack/v1/volume-backups/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/volume-backups?q=uuid=12d9162338f637c2855f58b63a7f19d5
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/volume-backups/09de4206bb143d75aad644c88cdbb364

可查询字段

运行zstack-cli命令行工具,输入QuerySharedBlock并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
  "inventories": [
    {
      "uuid": "aaf2564bbbed3eab97b7ecff370d8ff1",
      "volumeUuid": "92dcb8125f7b3187887e2abc8532b749",
      "name": "backup-2",
      "description": "my backup",
      "size": 1310720.0
    }
  ]
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 2.6.0
inventories List 详情参考inventories 2.6.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 2.6.0
description String 错误的概要描述 2.6.0
details String 错误的详细信息 2.6.0
elaboration String 保留字段,默认为null 2.6.0
opaque LinkedHashMap 保留字段,默认为null 2.6.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 2.6.0
#inventories
名字 类型 描述 起始版本
uuid String 卷备份的UUID,唯一标示该资源 2.6.0
volumeUuid String 云盘UUID 2.6.0
name String 备份名称 2.6.0
description String 备份的详细描述 2.6.0
type String 卷的类型 2.6.0
state String 卷备份的启用状态 2.6.0
status String 卷备份的状态 2.6.0
size Long 当前卷备份的大小 2.6.0
metadata String 卷备份相关元数据 2.6.0
createDate Timestamp 创建时间 2.6.0
lastOpDate Timestamp 最后一次修改时间 2.6.0
backupStorageRefs List 详情参考backupStorageRefs 2.6.0
#backupStorageRefs
名字 类型 描述 起始版本
volumeBackupUuid String 卷备份的uuid 2.6.0
backupStorageUuid String 镜像存储UUID 2.6.0
installPath String 卷备份的数据路径 2.6.0
status String 卷备份在镜像存储的状态 2.6.0
createDate Timestamp 创建时间 2.6.0
lastOpDate Timestamp 最后一次修改时间 2.6.0

SDK示例

Java SDK
QueryVolumeBackupAction action = new QueryVolumeBackupAction();
action.conditions = asList("uuid=031d210f004e31529b7ae7beb73c8bb9");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVolumeBackupAction.Result res = action.call();
Python SDK
QueryVolumeBackupAction action = QueryVolumeBackupAction()
action.conditions = ["uuid=4ec7c280156635b1a8164d6c9e455b41"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVolumeBackupAction.Result res = action.call()