Continuous Data Protection (CDP)

持续数据保护(CDP)服务以单独的功能模块形式提供,需提前购买持续数据保护(CDP)模块许可证,且需在购买云平台许可证基础上使用,不可单独使用。

CDP Operations

CreateCdpPolicy

API Request

URLs
POST zstack/v1/cdp-backup-storage/policy
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "MyCdpPolicyName",
    "description": "MyCdpDescription",
    "hourlyRpSinceDay": 3.0,
    "dailyRpSinceDay": 7.0,
    "expireTimeInDay": 30.0,
    "fullBackupIntervalInDay": 2.0,
    "recoveryPointPerSecond": 5.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"MyCdpPolicyName","description":"MyCdpDescription","hourlyRpSinceDay":3.0,"dailyRpSinceDay":7.0,"expireTimeInDay":30.0,"fullBackupIntervalInDay":2.0,"recoveryPointPerSecond":5.0}}' http://localhost:8080/zstack/v1/cdp-backup-storage/policy
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The name of the resource. 4.5.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.5.0
retentionTimePerDay Integer body (contained in the params structure) The retention time of the recovery points. 4.5.0
recoveryPointPerSecond Integer body (contained in the params structure) The retention interval of the recovery points. 4.5.0
hourlyRpSinceDay Integer body (contained in the params structure) The day from which to keep a recovery point hourly. 4.5.0
dailyRpSinceDay Integer body (contained in the params structure) The day from which to keep a recovery point per day. 4.5.0
expireTimeInDay Integer body (contained in the params structure) The valid time of the backup data. 4.5.0
fullBackupIntervalInDay Integer body (contained in the params structure) The interval of the full backup. 4.5.0
resourceUuid String body (contained in the params structure) Optional. The UUID of the resource. 4.5.0
tagUuids List body (contained in the params structure) Optional. The UUID list of the tags. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "inventory": {
    "name": "MyCdpPolicyName",
    "description": "MyCdpDescription",
    "retentionTimePerDay": 7.0,
    "recoveryPointPerSecond": 5.0
  }
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory CdpPolicyInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the CDP policy. 4.5.0
name String The name of the CDP policy. 4.5.0
description String The detailed description of the CDP policy. 4.5.0
retentionTimePerDay Integer The retention time for the recovery points. 4.5.0
recoveryPointPerSecond Integer The retention interval of the recovery points. 4.5.0
createDate Timestamp The time when the CDP policy is created. 4.5.0
lastOpDate Timestamp The time when the CDP policy is last modified. 4.5.0
state CdpPolicyState See state. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpPolicyState The CDP policy is enabled. 4.5.0
Disabled CdpPolicyState The CDP policy is disabled. 4.5.0

SDK Sample

Java SDK
CreateCdpPolicyAction action = new CreateCdpPolicyAction();
action.name = "MyCdpPolicyName";
action.description = "MyCdpDescription";
action.hourlyRpSinceDay = 3.0;
action.dailyRpSinceDay = 7.0;
action.expireTimeInDay = 30.0;
action.fullBackupIntervalInDay = 2.0;
action.recoveryPointPerSecond = 5.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateCdpPolicyAction.Result res = action.call();
Python SDK
CreateCdpPolicyAction action = CreateCdpPolicyAction()
action.name = "MyCdpPolicyName"
action.description = "MyCdpDescription"
action.hourlyRpSinceDay = 3.0
action.dailyRpSinceDay = 7.0
action.expireTimeInDay = 30.0
action.fullBackupIntervalInDay = 2.0
action.recoveryPointPerSecond = 5.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateCdpPolicyAction.Result res = action.call()

DeleteCdpPolicy

API Request

URLs
DELETE zstack/v1/cdp-backup-storage/policy/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/cdp-backup-storage/policy/6429f8a631993740b1c96e24bb64eca6
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
deleteMode String body Optional. The delete mode.
  • Permissive
  • Enforcing
  • Permissive
4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
DeleteCdpPolicyAction action = new DeleteCdpPolicyAction();
action.uuid = "6429f8a631993740b1c96e24bb64eca6";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteCdpPolicyAction.Result res = action.call();
Python SDK
DeleteCdpPolicyAction action = DeleteCdpPolicyAction()
action.uuid = "6429f8a631993740b1c96e24bb64eca6"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteCdpPolicyAction.Result res = action.call()

QueryCdpPolicy

API Request

URLs
GET zstack/v1/cdp-backup-storage/policy
GET zstack/v1/cdp-backup-storage/policy/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cdp-backup-storage/policy?q=uuid=c58c597901553c81bc469ebdc0324340
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cdp-backup-storage/policy/3cb711db1fbc3d80954ff45590fe11fc

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryVolumeBackup, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "name": "MyCdpPolicyName",
      "description": "MyCdpDescription",
      "retentionTimePerDay": 7.0,
      "recoveryPointPerSecond": 5.0
    }
  ]
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventories List See inventories. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventories
Name Type Description Starting Version
uuid String The UUID of the CDP policy. 4.5.0
name String The name of the CDP policy. 4.5.0
description String The detailed description of the CDP policy. 4.5.0
retentionTimePerDay Integer The retention time of the recovery points. 4.5.0
recoveryPointPerSecond Integer The retention interval of the recovery points. 4.5.0
createDate Timestamp The time when the CDP policy is created. 4.5.0
lastOpDate Timestamp The time when the CDP policy was last modified. 4.5.0
state CdpPolicyState See state. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpPolicyState The CDP policy is enabled. 4.5.0
Disabled CdpPolicyState The CDP policy is disabled. 4.5.0

SDK Sample

Java SDK
QueryCdpPolicyAction action = new QueryCdpPolicyAction();
action.conditions = asList("uuid=1cd7a1588ee73b4bb4ced0524e397b5e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCdpPolicyAction.Result res = action.call();
Python SDK
QueryCdpPolicyAction action = QueryCdpPolicyAction()
action.conditions = ["uuid=e7b6b0ad3c903889b3de90408450120a"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryCdpPolicyAction.Result res = action.call()

UpdateCdpPolicy

API Request

URLs
PUT zstack/v1/cdp-backup-storage/policy/{uuid}/actions    
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateCdpPolicy": {
    "name": "MyCdpPolicyName",
    "description": "MyCdpDescription",
    "retentionTimePerDay": 7.0,
    "hourlyRpSinceDay": 3.0,
    "dailyRpSinceDay": 7.0,
    "expireTimeInDay": 30.0,
    "fullBackupIntervalInDay": 2.0,
    "recoveryPointPerSecond": 5.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateCdpPolicy":{"name":"MyCdpPolicyName","description":"MyCdpDescription","retentionTimePerDay":7.0,"recoveryPointPerSecond":5.0}}' http://localhost:8080/zstack/v1/cdp-backup-storage/policy/e8e4ea26310e31fc9ee73329ebd5f180/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
name String body (contained in the params structure) Optional. The name of the resource. 4.5.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.5.0
retentionTimePerDay Integer body (contained in the params structure) Optional. The retention time of the recovery points. 4.5.0
recoveryPointPerSecond Integer body (contained in the params structure) Optional. The retention interval of the recovery points. 4.5.0
hourlyRpSinceDay Integer body (contained in the params structure) The day from which to keep a recovery point hourly. 4.5.0
dailyRpSinceDay Integer body (contained in the params structure) The day from which to keep a recovery point per day. 4.5.0
expireTimeInDay Integer body (contained in the params structure) The expiration time of the backup data. 4.5.0
fullBackupIntervalInDay Integer body (contained in the params structure) The interval of the full backup. 4.5.0
resourceUuid String body (contained in the params structure) Optional. The UUID of the resource. 4.5.0
tagUuids List body (contained in the params structure) Optional. The UUID list of the tags. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "inventory": {
    "name": "MyCdpPolicyName",
    "description": "MyCdpDescription",
    "retentionTimePerDay": 7.0,
    "recoveryPointPerSecond": 5.0
  }
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory CdpPolicyInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
retentionTimePerDay Integer The retention time of the recovery points. 4.5.0
recoveryPointPerSecond Integer The retention interval of the recovery points. 4.5.0
createDate Timestamp The time when the CDP policy is created. 4.5.0
lastOpDate Timestamp The time when the CDP policy was last modified. 4.5.0
backupStorageRefs List See state. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpPolicyState The CDP policy is enabled. 4.5.0
Disabled CdpPolicyState The CDP policy is disabled. 4.5.0

SDK Sample

Java SDK
UpdateCdpPolicyAction action = new UpdateCdpPolicyAction();
action.uuid = "e8e4ea26310e31fc9ee73329ebd5f180";
action.name = "MyCdpPolicyName";
action.description = "MyCdpDescription";
action.retentionTimePerDay = 7.0;
action.recoveryPointPerSecond = 5.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateCdpPolicyAction.Result res = action.call();
Python SDK
UpdateCdpPolicyAction action = UpdateCdpPolicyAction()
action.uuid = "e8e4ea26310e31fc9ee73329ebd5f180"
action.name = "MyCdpPolicyName"
action.description = "MyCdpDescription"
action.retentionTimePerDay = 7.0
action.recoveryPointPerSecond = 5.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateCdpPolicyAction.Result res = action.call()

CreateCdpTask

API Request

URLs
POST zstack/v1/cdp-backup-storage/task
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "My CDP Task",
    "taskType": "VM",
    "policyUuid": "0a96fd4b7556333f858842dc1c2a8172",
    "backupStorageUuid": "56e28fa35b7c381e8b62315b9de20bb4",
    "resourceUuids": [
      "672119ce84b137d58a70885c7e9f6218"
    ],
    "backupBandwidth": 1.048576E8,
    "maxCapacity": 1.073741824E11,
    "maxLatency": 1.073741824E11
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"My CDP Task","taskType":"VM","policyUuid":"0a96fd4b7556333f858842dc1c2a8172","backupStorageUuid":"56e28fa35b7c381e8b62315b9de20bb4","resourceUuids":["672119ce84b137d58a70885c7e9f6218"],"backupBandwidth":1.048576E8,"maxCapacity":1.073741824E11,"maxLatency":1.073741824E11}}' http://localhost:8080/zstack/v1/cdp-backup-storage/task
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The name of the resource. 4.5.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.5.0
taskType String body (contained in the params structure) The type of the CDP task. 4.5.0
policyUuid String body (contained in the params structure) The UUID of permission policy. 4.5.0
backupStorageUuid String body (contained in the params structure) The UUID of backup storage. 4.5.0
resourceUuids List body (contained in the params structure) The backup resource list. 4.5.0
backupBandwidth long body (contained in the params structure) Optional. The backup rate of a single volume. 4.5.0
maxCapacity long body (contained in the params structure) Optional. The planning capacity of the CDP task. 4.5.0
maxLatency long body (contained in the params structure) Optional. The RPO maximum latency of the CDP task. 4.5.0
resourceUuid String body (contained in the params structure) Optional. The UUID of the resource. 4.5.0
tagUuids List body (contained in the params structure) Optional. The UUID list of the tags. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "613a2bba58f03c4ba98ec089674cefaa",
    "name": "My Task",
    "policyUuid": "ba5ccc11257b396089abd5f00e9bac50",
    "backupStorageUuid": "64a1daa72c9d3f578646517ba22e8988",
    "status": "Created",
    "state": "Enabled",
    "taskType": "VM",
    "backupBandwidth": 1.048576E8,
    "maxCapacity": 1.073741824E11,
    "usedCapacity": 0.0,
    "maxLatency": 1.048576E8,
    "currentLatency": 0.0
  }
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory CdpTaskInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the CDP task. 4.5.0
name String The name of the CDP task. 4.5.0
description String The detailed description of the CDP task. 4.5.0
policyUuid String The UUID of permission policy. 4.5.0
backupStorageUuid String The UUID of backup storage. 4.5.0
backupBandwidth long The backup rate of a single volume. 4.5.0
maxCapacity long The planning capacity of the CDP task. 4.5.0
usedCapacity long The used capacity of the CDP task. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0
status CdpTaskStatus See status. 4.5.0
state CdpTaskState See state. 4.5.0
taskType CdpTaskType See taskType. 4.5.0
resourceRefs List See resourceRefs. 4.5.0
#status
Name Type Description Starting Version
Created CdpTaskStatus The CDP task is created. 4.5.0
Starting CdpTaskStatus The CDP task is starting. 4.5.0
Running CdpTaskStatus The CDP task is running. 4.5.0
Stopped CdpTaskStatus The CDP task stopped. 4.5.0
Unknown CdpTaskStatus The state of the CDP task is unknown. 4.5.0
Failed CdpTaskStatus The CDP task failed. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpTaskState The CDP task is enabled. 4.5.0
Disabled CdpTaskState The CDP task is disabled. 4.5.0
#taskType
Name Type Description Starting Version
VM CdpTaskType The VM instance corresponding to the CDP task. 4.5.0
#resourceRefs
Name Type Description Starting Version
taskUuid String The UUID of the CDP task. 4.5.0
resourceUuid String The UUID of the resource. 4.5.0
resourceType String The task resource list. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0

SDK Sample

Java SDK
CreateCdpTaskAction action = new CreateCdpTaskAction();
action.name = "My CDP Task";
action.taskType = "VM";
action.policyUuid = "0a96fd4b7556333f858842dc1c2a8172";
action.backupStorageUuid = "56e28fa35b7c381e8b62315b9de20bb4";
action.resourceUuids = asList("672119ce84b137d58a70885c7e9f6218");
action.backupBandwidth = 1.048576E8;
action.maxCapacity = 1.073741824E11;
action.maxLatency = 1.073741824E11;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateCdpTaskAction.Result res = action.call();
Python SDK
CreateCdpTaskAction action = CreateCdpTaskAction()
action.name = "My CDP Task"
action.taskType = "VM"
action.policyUuid = "0a96fd4b7556333f858842dc1c2a8172"
action.backupStorageUuid = "56e28fa35b7c381e8b62315b9de20bb4"
action.resourceUuids = [672119ce84b137d58a70885c7e9f6218]
action.backupBandwidth = 1.048576E8
action.maxCapacity = 1.073741824E11
action.maxLatency = 1.073741824E11
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateCdpTaskAction.Result res = action.call()

DeleteCdpTask

API Request

URLs
DELETE zstack/v1/cdp-task/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/cdp-task/1b6124362d023f0fb13f20923e2075d7
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
deleteMode String body Optional. The delete mode.
  • Permissive/Enforcing
  • Permissive
4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
DeleteCdpTaskAction action = new DeleteCdpTaskAction();
action.uuid = "1b6124362d023f0fb13f20923e2075d7";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteCdpTaskAction.Result res = action.call();
Python SDK
DeleteCdpTaskAction action = DeleteCdpTaskAction()
action.uuid = "1b6124362d023f0fb13f20923e2075d7"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteCdpTaskAction.Result res = action.call()

QueryCdpTask

API Request

URLs
GET zstack/v1/cdp-task
GET zstack/v1/cdp-task/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cdp-task?q=uuid=ba57edb98e983115804b74bc47e968e1
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cdp-task/8249deb879fa303b841560bf3cbd5113

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryVolumeBackup, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "cfcb3c865b2e363f96ec43615c9862d6",
      "name": "My Task",
      "policyUuid": "aa3ff8d5586b39c18b330f2b118e6936",
      "backupStorageUuid": "2ff526012ceb362ebfa903ba69d7a53a",
      "status": "Running",
      "state": "Enabled",
      "taskType": "VM",
      "backupBandwidth": 1.048576E8,
      "maxCapacity": 1.073741824E11,
      "usedCapacity": 2.395916E7
    }
  ]
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventories List See inventories. 4.5.0
#error
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
policyUuid String The UUID of permission policy. 4.5.0
backupStorageUuid String The UUID of backup storage. 4.5.0
backupBandwidth long The backup rate of a single volume. 4.5.0
maxCapacity long The planning capacity of the CDP task. 4.5.0
usedCapacity long The used capacity of the CDP task. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0
#inventories
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the scheduler job group. 4.5.0
description String The detailed description of the scheduler job group. 4.5.0
state String The state of the scheduler job group. 4.5.0
createDate Timestamp The time when the scheduler job group is created. 4.5.0
lastOpDate Timestamp The time of the scheduler job group is last modified. 4.5.0
jobData String The job data. 4.5.0
triggersUuid List The UUID of the triggers. 4.5.0
status CdpTaskStatus See status. 4.5.0
state CdpTaskState See state. 4.5.0
taskType CdpTaskType See taskType. 4.5.0
resourceRefs List See resourceRefs. 4.5.0
#status
Name Type Description Starting Version
Created CdpTaskStatus The CDP task is created. 4.5.0
Starting CdpTaskStatus The CDP task is starting. 4.5.0
Running CdpTaskStatus The CDP task is running. 4.5.0
Stopped CdpTaskStatus The CDP task stopped. 4.5.0
Unknown CdpTaskStatus The state of the CDP task is unknown. 4.5.0
Failed CdpTaskStatus The CDP task failed. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpTaskState The CDP task is enabled. 4.5.0
Disabled CdpTaskState The CDP task is disabled. 4.5.0
#taskType
Name Type Description Starting Version
VM CdpTaskType The VM instance corresponding to the CDP task. 4.5.0
#resourceRefs
Name Type Description Starting Version
taskUuid String The UUID of the CDP task. 4.5.0
resourceUuid String The UUID of the resource. 4.5.0
resourceType String The task resource list. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0

SDK Sample

Java SDK
QueryCdpTaskAction action = new QueryCdpTaskAction();
action.conditions = asList("uuid=b3096918b9c63955a8511653e969b911");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCdpTaskAction.Result res = action.call();
Python SDK
QueryCdpTaskAction action = QueryCdpTaskAction()
action.conditions = ["uuid=6c898e4b47b93d85addd6856b0ccce67"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryCdpTaskAction.Result res = action.call()

UpdateCdpTask

API Request

URLs
PUT zstack/v1/cdp-backup-storage/task/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateCdpTask": {
    "name": "My CDP Task",
    "backupBandwidth": 1.048576E8,
    "maxCapacity": 1.073741824E11,
    "maxLatency": 0.0
  },
  "systemTags": [],
  "userTags": []
}
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateCdpTask":{"name":"My CDP Task","backupBandwidth":1.048576E8,"maxCapacity":1.073741824E11,"maxLatency":0.0}}' http://localhost:8080/zstack/v1/cdp-backup-storage/task/aa0c3f89827f3317ac7e1a9b39c6278e/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.3.6
name String body (contained in the params structure) Optional. The name of the resource. 4.3.6
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.3.6
backupBandwidth long body (contained in the params structure) Optional. The backup rate of a single volume. 4.3.6
maxCapacity long body (contained in the params structure) Optional. The planning capacity of the CDP task. 4.3.6
maxLatency long body (contained in the params structure) Optional. The RPO maximum latency of the CDP task. 4.4.24
resourceUuid String body (contained in the params structure) Optional. The UUID of the resource. 4.3.6
tagUuids List body (contained in the params structure) Optional. The UUID list of the tags. 4.3.6
systemTags List body Optional. The system tags. 4.3.6
userTags List body Optional. The user tags. 4.3.6

API Response

Sample Response
{
  "inventory": {
    "uuid": "2680ec1b4d0c3b69bc4c7a1813a8b3d0",
    "name": "My Task",
    "policyUuid": "aef28d43ccec3118bb597c237aa243ae",
    "backupStorageUuid": "06f62c4b65b237ee854dbcdf01798188",
    "status": "Created",
    "state": "Enabled",
    "taskType": "VM",
    "backupBandwidth": 1.048576E8,
    "maxCapacity": 1.073741824E11,
    "usedCapacity": 0.0,
    "maxLatency": 0.0,
    "currentLatency": 0.0
  }
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory CdpTaskInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
policyUuid String The UUID of permission policy. 4.5.0
backupStorageUuid String The UUID of backup storage. 4.5.0
backupBandwidth long The backup rate of a single volume. 4.5.0
maxCapacity long The planning capacity of the CDP task. 4.5.0
usedCapacity long The used capacity of the CDP task. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0
status CdpTaskStatus See status. 4.5.0
state CdpTaskState See state. 4.5.0
taskType CdpTaskType See taskType. 4.5.0
resourceRefs List See resourceRefs. 4.5.0
#status
Name Type Description Starting Version
Created CdpTaskStatus The CDP task is created. 4.5.0
Starting CdpTaskStatus The CDP task is starting. 4.5.0
Running CdpTaskStatus The CDP task is running. 4.5.0
Stopped CdpTaskStatus The CDP task stopped. 4.5.0
Unknown CdpTaskStatus The state of the CDP task is unknown. 4.5.0
Failed CdpTaskStatus The CDP task failed. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpTaskState The CDP task is enabled. 4.5.0
Disabled CdpTaskState The CDP task is disabled. 4.5.0
#taskType
Name Type Description Starting Version
VM CdpTaskType The VM instance corresponding to the CDP task. 4.5.0
#resourceRefs
Name Type Description Starting Version
taskUuid String The UUID of the CDP task. 4.5.0
resourceUuid String The UUID of the resource. 4.5.0
resourceType String The task resource list. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0

SDK Sample

Java SDK
UpdateCdpTaskAction action = new UpdateCdpTaskAction();
action.uuid = "aa0c3f89827f3317ac7e1a9b39c6278e";
action.name = "My CDP Task";
action.backupBandwidth = 1.048576E8;
action.maxCapacity = 1.073741824E11;
action.maxLatency = 0.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateCdpTaskAction.Result res = action.call();
Python SDK
UpdateCdpTaskAction action = UpdateCdpTaskAction()
action.uuid = "aa0c3f89827f3317ac7e1a9b39c6278e"
action.name = "My CDP Task"
action.backupBandwidth = 1.048576E8
action.maxCapacity = 1.073741824E11
action.maxLatency = 0.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateCdpTaskAction.Result res = action.call()

EnableCdpTask

API Request

URLs
POST zstack/v1/cdp-task/enable/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/cdp-task/enable/579496f57aaf3450974972479474879e
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The name of the resource. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "0945746644d9379faddf2ac0b70147ba",
    "name": "My Task",
    "policyUuid": "1fdbac28c4f737db9d0579ae8859e57b",
    "backupStorageUuid": "cfb2e97be9ab320594ee46d3946c356e",
    "status": "Running",
    "state": "Enabled",
    "taskType": "VM",
    "backupBandwidth": 1.048576E8,
    "maxCapacity": 1.073741824E11,
    "usedCapacity": 2.395916E7
  }
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory CdpTaskInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
policyUuid String The UUID of permission policy. 4.5.0
backupStorageUuid String The UUID of backup storage. 4.5.0
backupBandwidth long The backup rate of a single volume. 4.5.0
maxCapacity long The planning capacity of the CDP task. 4.5.0
usedCapacity long The used capacity of the CDP task. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0
status CdpTaskStatus See status. 4.5.0
state CdpTaskState See state. 4.5.0
taskType CdpTaskType See taskType. 4.5.0
resourceRefs List See resourceRefs. 4.5.0
#status
Name Type Description Starting Version
Created CdpTaskStatus The CDP task is created. 4.5.0
Starting CdpTaskStatus The CDP task is starting. 4.5.0
Running CdpTaskStatus The CDP task is running. 4.5.0
Stopped CdpTaskStatus The CDP task stopped. 4.5.0
Unknown CdpTaskStatus The state of the CDP task is unknown. 4.5.0
Failed CdpTaskStatus The CDP task failed. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpTaskState The CDP task is enabled. 4.5.0
Disabled CdpTaskState The CDP task is disabled. 4.5.0
#taskType
Name Type Description Starting Version
VM CdpTaskType The VM instance corresponding to the CDP task. 4.5.0
#resourceRefs
Name Type Description Starting Version
taskUuid String The UUID of the CDP task. 4.5.0
resourceUuid String The UUID of the resource. 4.5.0
resourceType String The task resource list. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0

SDK Sample

Java SDK
EnableCdpTaskAction action = new EnableCdpTaskAction();
action.uuid = "579496f57aaf3450974972479474879e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
EnableCdpTaskAction.Result res = action.call();
Python SDK
EnableCdpTaskAction action = EnableCdpTaskAction()
action.uuid = "579496f57aaf3450974972479474879e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
EnableCdpTaskAction.Result res = action.call()

DisableCdpTask

API Request

URLs
POST zstack/v1/cdp-task/disable/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/cdp-task/disable/0f5f6a9280233fa0b5c910c27274da98
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "e43bfb102a783c01a19ce023adaaea19",
    "name": "My Task",
    "policyUuid": "6ebcb0afeca13b1b99267fa6235ad632",
    "backupStorageUuid": "19c774019dae3569a72b5502fddab153",
    "status": "Stopped",
    "state": "Disabled",
    "taskType": "VM",
    "backupBandwidth": 1.048576E8,
    "maxCapacity": 1.073741824E11,
    "usedCapacity": 2.3952346E8
  }
}
Name Type Description Starting Version
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory CdpTaskInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
policyUuid String The UUID of permission policy. 4.5.0
backupStorageUuid String The UUID of backup storage. 4.5.0
backupBandwidth long The backup rate of a single volume. 4.5.0
maxCapacity long The planning capacity of the CDP task. 4.5.0
usedCapacity long The used capacity of the CDP task. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0
status CdpTaskStatus See status. 4.5.0
state CdpTaskState See state. 4.5.0
taskType CdpTaskType See taskType. 4.5.0
resourceRefs List See resourceRefs. 4.5.0
#status
Name Type Description Starting Version
Created CdpTaskStatus The CDP task is created. 4.5.0
Starting CdpTaskStatus The CDP task is starting. 4.5.0
Running CdpTaskStatus The CDP task is running. 4.5.0
Stopped CdpTaskStatus The CDP task stopped. 4.5.0
Unknown CdpTaskStatus The state of the CDP task is unknown. 4.5.0
Failed CdpTaskStatus The CDP task failed. 4.5.0
#state
Name Type Description Starting Version
Enabled CdpTaskState The CDP task is enabled. 4.5.0
Disabled CdpTaskState The CDP task is disabled. 4.5.0
#taskType
Name Type Description Starting Version
VM CdpTaskType The VM instance corresponding to the CDP task. 4.5.0
#resourceRefs
Name Type Description Starting Version
taskUuid String The UUID of the CDP task. 4.5.0
resourceUuid String The UUID of the resource. 4.5.0
resourceType String The task resource list. 4.5.0
createDate Timestamp The time when the CDP task is created. 4.5.0
lastOpDate Timestamp The time when the CDP task is last modified. 4.5.0

SDK Sample

Java SDK
DisableCdpTaskAction action = new DisableCdpTaskAction();
action.uuid = "0f5f6a9280233fa0b5c910c27274da98";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DisableCdpTaskAction.Result res = action.call();
Python SDK
DisableCdpTaskAction action = DisableCdpTaskAction()
action.uuid = "0f5f6a9280233fa0b5c910c27274da98"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DisableCdpTaskAction.Result res = action.call()

MergeDataOnBackupStorage

API Request

URLs
PUT zstack/v1/cdp-task/mergedata/{backupStorageUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "mergeDataOnBackupStorage": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"mergeDataOnBackupStorage":{}}' http://localhost:8080/zstack/v1/cdp-task/mergedata/0530283e6a5b3a66836d5965c0ee644e/actions
Parameters
Name Type Location Description Valid Values Starting Version
backupStorageUuid String url The backup storage UUID. 4.8.10
systemTags List body Optional. The system tags. 4.8.10
userTags List body Optional. The user tags. 4.8.10

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
MergeDataOnBackupStorageAction action = new MergeDataOnBackupStorageAction();
action.backupStorageUuid = "0530283e6a5b3a66836d5965c0ee644e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
MergeDataOnBackupStorageAction.Result res = action.call();
Python SDK
MergeDataOnBackupStorageAction action = MergeDataOnBackupStorageAction()
action.backupStorageUuid = "0530283e6a5b3a66836d5965c0ee644e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
MergeDataOnBackupStorageAction.Result res = action.call()

ProtectVmInstanceRecoveryPoint

API Request

URLs
PUT zstack/v1/vm-instances/{vmInstanceUuid}/protect-recovery-point
Headers
Authorization: OAuth the-session-uuid
Body
{
  "protectVmInstanceRecoveryPoint": {
    "groupId": 1.0,
    "description": "My Awesome RP"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"protectVmInstanceRecoveryPoint":{"groupId":1.0,"description":"My Awesome RP"}}' http://localhost:8080/zstack/v1/vm-instances/8242bb6842e73987a632354acfc239ec/protect-recovery-point
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String url The UUID of the VM instance. 4.5.0
groupId long body (contained in the params structure) The group ID of the recovery points. 4.5.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
ProtectVmInstanceRecoveryPointAction action = new ProtectVmInstanceRecoveryPointAction();
action.vmInstanceUuid = "8242bb6842e73987a632354acfc239ec";
action.groupId = 1.0;
action.description = "My Awesome RP";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ProtectVmInstanceRecoveryPointAction.Result res = action.call();
Python SDK
ProtectVmInstanceRecoveryPointAction action = ProtectVmInstanceRecoveryPointAction()
action.vmInstanceUuid = "8242bb6842e73987a632354acfc239ec"
action.groupId = 1.0
action.description = "My Awesome RP"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ProtectVmInstanceRecoveryPointAction.Result res = action.call()

GetVmInstanceProtectedRecoveryPoints

API Request

URLs
GET zstack/v1/vm-instances/{uuid}/protected-recovery-points
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/f71a2ffeec113d8e840a6808d09d1ca8/protected-recovery-points?limit=1000.0&start=0.0
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
limit Integer query Optional. The maximum number of returned records. 4.5.0
start Integer query Optional. The first record to query. 4.5.0
systemTags List query Optional. The system tags. 4.5.0
userTags List query Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "recoveryPoints": {
    "22d49432eaf23ef0996ac976e0b91185": [
      {
        "id": 1.0,
        "grpId": 1.0,
        "size": 851968.0,
        "volId": "22d49432eaf23ef0996ac976e0b91185",
        "ts": "2021-06-29T19:49:45+08:00"
      }
    ],
    "71423fb28eb135c994e566badfd8aece": [
      {
        "id": 2.0,
        "grpId": 0.0,
        "size": 196608.0,
        "volId": "71423fb28eb135c994e566badfd8aece",
        "ts": "2021-06-29T19:49:47+08:00"
      }
    ]
  }
}
Name Type Description Starting Version
recoveryPoints Map The list of the CDP recovery points. 4.5.0
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0

SDK Sample

Java SDK
GetVmInstanceProtectedRecoveryPointsAction action = new GetVmInstanceProtectedRecoveryPointsAction();
action.uuid = "f71a2ffeec113d8e840a6808d09d1ca8";
action.limit = 1000.0;
action.start = 0.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVmInstanceProtectedRecoveryPointsAction.Result res = action.call();
Python SDK
GetVmInstanceProtectedRecoveryPointsAction action = GetVmInstanceProtectedRecoveryPointsAction()
action.uuid = "f71a2ffeec113d8e840a6808d09d1ca8"
action.limit = 1000.0
action.start = 0.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVmInstanceProtectedRecoveryPointsAction.Result res = action.call()

UnprotectVmInstanceRecoveryPoint

API Request

URLs
PUT zstack/v1/vm-instances/{vmInstanceUuid}/unprotect-recovery-point
Headers
Authorization: OAuth the-session-uuid
Body
{
  "unprotectVmInstanceRecoveryPoint": {
    "groupId": 1.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"unprotectVmInstanceRecoveryPoint":{"groupId":1.0}}' http://localhost:8080/zstack/v1/vm-instances/05beea45590e3ea5ac08d81dba36f51f/unprotect-recovery-point
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String url The UUID of the VM instance. 4.5.0
groupId long body (contained in the params structure) The group ID of the recovery points. 4.5.0
systemTags (optional) List body The system tags. 4.5.0
userTags (optional) List body The user tags. 4.5.0

API Response

Sample Response
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
UnprotectVmInstanceRecoveryPointAction action = new UnprotectVmInstanceRecoveryPointAction();
action.vmInstanceUuid = "05beea45590e3ea5ac08d81dba36f51f";
action.groupId = 1.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UnprotectVmInstanceRecoveryPointAction.Result res = action.call();
Python SDK
UnprotectVmInstanceRecoveryPointAction action = UnprotectVmInstanceRecoveryPointAction()
action.vmInstanceUuid = "05beea45590e3ea5ac08d81dba36f51f"
action.groupId = 1.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UnprotectVmInstanceRecoveryPointAction.Result res = action.call()

CreateVmFromCdpBackup

API Request

URLs
PUT zstack/v1/cdp-backups/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "createVmFromCdpBackup": {
    "name": "vm1",
    "groupId": 224.0,
    "cdpTaskUuid": "d2cb3e8626e1357aa022e05f86162987",
    "instanceOfferingUuid": "cc7000d5e89936d497c7ab12c653dae3",
    "l3NetworkUuids": [
      "e0961ef73a7336629a0710cf8a5c1c6b"
    ],
    "clusterUuid": "d57baa34a904394d86aa8336d8a6f9a9",
    "recoverBandwidth": 0.0,
    "description": "this is a vm"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"createVmFromCdpBackup":{"name":"vm1","groupId":224.0,"cdpTaskUuid":"d2cb3e8626e1357aa022e05f86162987","instanceOfferingUuid":"cc7000d5e89936d497c7ab12c653dae3","l3NetworkUuids":["e0961ef73a7336629a0710cf8a5c1c6b"],"clusterUuid":"d57baa34a904394d86aa8336d8a6f9a9","recoverBandwidth":0.0,"description":"this is a vm"}}' http://localhost:8080/zstack/v1/cdp-backups/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The name of the resource. 4.5.0
groupId long body (contained in the params structure) The ID of the recovery points. 4.5.0
cdpTaskUuid String body (contained in the params structure) The UUID of the CDP task. 4.5.0
instanceOfferingUuid String body (contained in the params structure) The UUID of the instance offering. 4.5.0
defaultL3NetworkUuid String body (contained in the params structure) Optional. The UUID of the default L3 network. 4.5.0
l3NetworkUuids List body (contained in the params structure) The UUID list of L3 network. 4.5.0
type String body (contained in the params structure) Optional. The type of the VM.
  • UserVm
  • ApplianceVm
4.5.0
zoneUuid String body (contained in the params structure) Optional. The UUID of the zone. 4.5.0
clusterUuid String body (contained in the params structure) Optional. The UUID of the cluster. 4.5.0
hostUuid String body (contained in the params structure) Optional. The UUID of the host. 4.5.0
primaryStorageUuidForRootVolume String body (contained in the params structure) Optional. The UUID of the primary storage for root volume. 4.5.0
primaryStorageUuidForDataVolume String body (contained in the params structure) Optional. The UUID of the primary storage for data volume. 4.5.0
recoverBandwidth long body (contained in the params structure) Optional. The recover bandwidth. 4.5.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.5.0
rootVolumeSystemTags List body (contained in the params structure) Optional. The system tags of the root volume. 4.5.0
dataVolumeSystemTags List body (contained in the params structure) Optional. The system tags of the data volume. 4.5.0
resourceUuid String body (contained in the params structure) Optional. The UUID of the resource. 4.5.0
tagUuids List body (contained in the params structure) Optional. The UUID list of the tags. 4.5.0
systemTags List body Optional. The system tags of the VM. 4.5.0
userTags List body Optional. The user tags of the VM. 4.5.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "ecadf3712d373abebb48671015a49e2c",
    "name": "Test-VM",
    "description": "web server VM",
    "zoneUuid": "5274961ea09834f6bdc757ec9b1d205f",
    "clusterUuid": "6c00cd0c676e3b5397f9e635a1357336",
    "imageUuid": "e9316bbaf94a37dea9a41b8a42e30b3d",
    "hostUuid": "7f2a8fe14f863e43b95b4e204d2b6073",
    "lastHostUuid": "804827a4304e309a85efb214e32edd80",
    "instanceOfferingUuid": "7f8ece5779ef31bab691585ffc693b91",
    "rootVolumeUuid": "a2b37cf28a9834da826e14e5fd7a97c6",
    "platform": "Linux",
    "defaultL3NetworkUuid": "68bca6897c4f300881985f028e61ca92",
    "type": "UserVm",
    "hypervisorType": "KVM",
    "memorySize": 8.589934592E9,
    "cpuNum": 1.0,
    "allocatorStrategy": "LastHostPreferredAllocatorStrategy",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM",
    "state": "Running",
    "vmNics": [
      {
        "uuid": "645496bd84373644a52a1e62229cbb07",
        "vmInstanceUuid": "ecadf3712d373abebb48671015a49e2c",
        "usedIpUuid": "b89e21d52dbb3037a3ee585b253396f2",
        "l3NetworkUuid": "68bca6897c4f300881985f028e61ca92",
        "ip": "192.168.1.10",
        "mac": "00:0c:29:bd:99:fc",
        "netmask": "255.255.255.0",
        "gateway": "192.168.1.1",
        "deviceId": 0.0,
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "allVolumes": [
      {
        "uuid": "a2b37cf28a9834da826e14e5fd7a97c6",
        "name": "Root-Volume-For-VM-ecadf3712d373abebb48671015a49e2c",
        "primaryStorageUuid": "3626202657933f2cb13df025773d9aa9",
        "vmInstanceUuid": "ecadf3712d373abebb48671015a49e2c",
        "rootImageUuid": "e9316bbaf94a37dea9a41b8a42e30b3d",
        "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-a2b37cf28a9834da826e14e5fd7a97c6/a2b37cf28a9834da826e14e5fd7a97c6.qcow2",
        "type": "Root",
        "format": "qcow2",
        "size": 1.073741824E11,
        "actualSize": 2.147483648E10,
        "deviceId": 0.0,
        "state": "Enabled",
        "status": "Ready",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ]
  }
}
Name Type Description Starting Version
success boolean 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
inventory VmInstanceInventory See inventory. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
zoneUuid String The UUID of the zone. 4.5.0
clusterUuid String The UUID of the cluster. 4.5.0
imageUuid String The UUID of the image. 4.5.0
hostUuid String The UUID of the host. 4.5.0
lastHostUuid String 4.5.0
instanceOfferingUuid String The UUID of the instance offering. 4.5.0
rootVolumeUuid String The UUID of the root volume. 4.5.0
platform String 4.5.0
architecture String 4.5.0
defaultL3NetworkUuid String 4.5.0
type String 4.5.0
hypervisorType String 4.5.0
memorySize Long 4.5.0
cpuNum Integer 4.5.0
cpuSpeed Long 4.5.0
allocatorStrategy String 4.5.0
createDate Timestamp The time when the resource is created. 4.5.0
lastOpDate Timestamp The time when the resource is last modified. 4.5.0
state String 4.5.0
guestOsType String 4.5.0
vmNics List See vmNics. 4.5.0
allVolumes List See allVolumes. 4.5.0
vmCdRoms List See vmCdRoms. 4.5.0
#vmNics
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
vmInstanceUuid String The UUID of the VM instance. 4.5.0
l3NetworkUuid String The UUID of the L3 network. 4.5.0
ip String 4.5.0
mac String 4.5.0
hypervisorType String 4.5.0
netmask String 4.5.0
gateway String 4.5.0
metaData String 4.5.0
ipVersion Integer 4.5.0
driverType String 4.5.0
internalName String 4.5.0
deviceId Integer 4.5.0
type String 4.5.0
createDate Timestamp The time when the resource is created. 4.5.0
lastOpDate Timestamp The time when the resource is last modified. 4.5.0
usedIps List See usedIps. 4.5.0
#usedIps
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
ipRangeUuid String The UUID of the IP range. 4.5.0
l3NetworkUuid String The UUID of the L3 network. 4.5.0
ipVersion Integer 4.5.0
ip String 4.5.0
netmask String 4.5.0
gateway String 4.5.0
usedFor String 4.5.0
ipInLong long 4.5.0
vmNicUuid String The UUID of the VM NIC. 4.5.0
createDate Timestamp The time when the resource is created. 4.5.0
lastOpDate Timestamp The time when the resource is last modified. 4.5.0
#allVolumes
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
primaryStorageUuid String The UUID of the primary storage. 4.5.0
vmInstanceUuid String The UUID of the VM instance. 4.5.0
diskOfferingUuid String The UUID of the disk offering. 4.5.0
rootImageUuid String 4.5.0
installPath String 4.5.0
type String 4.5.0
format String 4.5.0
size Long 4.5.0
actualSize Long 4.5.0
deviceId Integer 4.5.0
state String 4.5.0
status String 4.5.0
createDate Timestamp The time when the resource is created. 4.5.0
lastOpDate Timestamp The time when the resource is last modified. 4.5.0
isShareable Boolean 4.5.0
volumeQos String 4.5.0
lastDetachDate Timestamp 4.5.0
lastVmInstanceUuid String 4.5.0
#vmCdRoms
Name Type Description Starting Version
uuid String The UUID of the resource. 4.5.0
vmInstanceUuid String The UUID of theVM instance. 4.5.0
deviceId Integer 4.5.0
isoUuid String 4.5.0
isoInstallPath String 4.5.0
name String The name of the resource. 4.5.0
description String The detailed description of the resource. 4.5.0
createDate Timestamp The time when the resource is created. 4.5.0
lastOpDate Timestamp The time when the resource is last modified. 4.5.0

SDK Sample

Java SDK
CreateVmFromCdpBackupAction action = new CreateVmFromCdpBackupAction();
action.name = "vm1";
action.groupId = 224.0;
action.cdpTaskUuid = "d2cb3e8626e1357aa022e05f86162987";
action.instanceOfferingUuid = "cc7000d5e89936d497c7ab12c653dae3";
action.l3NetworkUuids = asList("e0961ef73a7336629a0710cf8a5c1c6b");
action.clusterUuid = "d57baa34a904394d86aa8336d8a6f9a9";
action.recoverBandwidth = 0.0;
action.description = "this is a vm";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVmFromCdpBackupAction.Result res = action.call();
Python SDK
CreateVmFromCdpBackupAction action = CreateVmFromCdpBackupAction()
action.name = "vm1"
action.groupId = 224.0
action.cdpTaskUuid = "d2cb3e8626e1357aa022e05f86162987"
action.instanceOfferingUuid = "cc7000d5e89936d497c7ab12c653dae3"
action.l3NetworkUuids = [e0961ef73a7336629a0710cf8a5c1c6b]
action.clusterUuid = "d57baa34a904394d86aa8336d8a6f9a9"
action.recoverBandwidth = 0.0
action.description = "this is a vm"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVmFromCdpBackupAction.Result res = action.call()

RevertVmFromCdpBackup

API Request

URLs
PUT zstack/v1/cdp-backups/{vmInstanceUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "revertVmFromCdpBackup": {
    "backupStorageUuid": "13680e129d053ee092513efebf1ce00a",
    "groupId": 1.0,
    "useExistingVolume": true,
    "recoverBandwidth": 0.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"revertVmFromCdpBackup":{"backupStorageUuid":"13680e129d053ee092513efebf1ce00a","groupId":1.0,"useExistingVolume":true,"recoverBandwidth":0.0}}' http://localhost:8080/zstack/v1/cdp-backups/faa5f80004b4393dbc59b91ab5a286b7/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String url The UUID of the VM instance. 4.5.0
backupStorageUuid String body (contained in the params structure) The UUID of the backup storage. 4.5.0
groupId long body (contained in the params structure) The group ID of the recovery points. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0
primaryStorageUuidForRootVolume String body (contained in the params structure) Optional. The UUID of the primary storage for new root volume. 4.5.0
primaryStorageUuidForDataVolume String body (contained in the params structure) Optional. The UUID of the primary storage for new data volume. 4.5.0
hostUuid String body (contained in the params structure) Optional. The UUID of the host. 4.5.0
useExistingVolume boolean body (contained in the params structure) Optional. Use the recover data to overwrite existing volume or not. 4.5.0
recoverBandwidth long body (contained in the params structure) Optional. The recover bandwidth. 4.5.0

API Response

Sample Response
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
RevertVmFromCdpBackupAction action = new RevertVmFromCdpBackupAction();
action.vmInstanceUuid = "faa5f80004b4393dbc59b91ab5a286b7";
action.backupStorageUuid = "13680e129d053ee092513efebf1ce00a";
action.groupId = 1.0;
action.useExistingVolume = true;
action.recoverBandwidth = 0.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RevertVmFromCdpBackupAction.Result res = action.call();
Python SDK
RevertVmFromCdpBackupAction action = RevertVmFromCdpBackupAction()
action.vmInstanceUuid = "faa5f80004b4393dbc59b91ab5a286b7"
action.backupStorageUuid = "13680e129d053ee092513efebf1ce00a"
action.groupId = 1.0
action.useExistingVolume = true
action.recoverBandwidth = 0.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RevertVmFromCdpBackupAction.Result res = action.call()

DeleteCdpTaskData

API Request

URLs
POST zstack/v1/cdp-task/{uuid}/data
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/cdp-task/06a058ba3bb43e91afe212bc710c559e/data
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
DeleteCdpTaskDataAction action = new DeleteCdpTaskDataAction();
action.uuid = "06a058ba3bb43e91afe212bc710c559e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteCdpTaskDataAction.Result res = action.call();
Python SDK
DeleteCdpTaskDataAction action = DeleteCdpTaskDataAction()
action.uuid = "06a058ba3bb43e91afe212bc710c559e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteCdpTaskDataAction.Result res = action.call()

GetVmInstanceRecoveryPoints

API Request

URLs
GET zstack/v1/vm-instances/{uuid}/recovery-points
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/e2e9f8f2184135378b883036673d1780/recovery-points?startTime=2021-06-25T15:36:16%2b08:00&limit=1000.0&start=0.0
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the resource. 4.5.0
startTime String query Optional. The start time to query. 4.5.0
endTime String query Optional. The end time to query. 4.5.0
scale String query Optional. The unit of time to query the recovery points.
  • minute
  • hour
  • day
4.5.0
limit Integer query Optional. The maximum number of returned records. 4.5.0
start Integer query Optional. The first record to query. 4.5.0
systemTags List query Optional. The system tags. 4.5.0
userTags List query Optional. The user tags. 4.5.0

API Response

Sample Response
{
  "recoveryPoints": {
    "db058d634c403ffd9b55d4af14090c4b": [
      {
        "id": 2.0,
        "grpId": 1.0,
        "size": 196608.0,
        "volId": "db058d634c403ffd9b55d4af14090c4b",
        "ts": "2021-06-29T19:49:47+08:00"
      }
    ],
    "9092ed3354fe39ea854f2e22e0346223": [
      {
        "id": 1.0,
        "grpId": 1.0,
        "size": 851968.0,
        "volId": "9092ed3354fe39ea854f2e22e0346223",
        "ts": "2021-06-29T19:49:45+08:00"
      }
    ]
  }
}
Name Type Description Starting Version
recoveryPoints Map The list of CDP recovery points. 4.5.0
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0

SDK Sample

Java SDK
GetVmInstanceRecoveryPointsAction action = new GetVmInstanceRecoveryPointsAction();
action.uuid = "e2e9f8f2184135378b883036673d1780";
action.startTime = "2021-06-25T15:36:16+08:00";
action.limit = 1000.0;
action.start = 0.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVmInstanceRecoveryPointsAction.Result res = action.call();
Python SDK
GetVmInstanceRecoveryPointsAction action = GetVmInstanceRecoveryPointsAction()
action.uuid = "e2e9f8f2184135378b883036673d1780"
action.startTime = "2021-06-25T15:36:16+08:00"
action.limit = 1000.0
action.start = 0.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVmInstanceRecoveryPointsAction.Result res = action.call()

MountVmInstanceRecoveryPoint

API Request

URLs
POST zstack/v1/cdp-backup-storage/mount-recovery-point
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "vmUuid": "b21d235bb4683fa88c9cd0ac660b1b45",
    "groupId": 1.0,
    "https": true
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"vmUuid":"b21d235bb4683fa88c9cd0ac660b1b45","groupId":1.0,"https":true}}' http://localhost:8080/zstack/v1/cdp-backup-storage/mount-recovery-point
Request Parameters
Name Type Location Description Optional Value Starting Version
vmUuid String body (contained in the params structure) The UUID of the VM instance. 4.5.0
groupId long body (contained in the params structure) The group ID of the recovery points. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0
https boolean body (contained in the params structure) Optional. Use https or not. 4.5.0

API Response

Sample Response
{
  "resourcePath": "http://cdp-storage-server/some-path"
}
Name Type Description Starting Version
resourcePath String The resource path where the recovery point was successfully mounted. 4.5.0
failedVolumes Map The list of volumes that failed to mount recovery points. 4.5.0
success boolean Succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0

SDK Sample

Java SDK
MountVmInstanceRecoveryPointAction action = new MountVmInstanceRecoveryPointAction();
action.vmUuid = "b21d235bb4683fa88c9cd0ac660b1b45";
action.groupId = 1.0;
action.https = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
MountVmInstanceRecoveryPointAction.Result res = action.call();
Python SDK
MountVmInstanceRecoveryPointAction action = MountVmInstanceRecoveryPointAction()
action.vmUuid = "b21d235bb4683fa88c9cd0ac660b1b45"
action.groupId = 1.0
action.https = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
MountVmInstanceRecoveryPointAction.Result res = action.call()

UnmountVmInstanceRecoveryPoint

API Request

URLs
POST zstack/v1/cdp-backup-storage/unmount-recovery-point
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "vmUuid": "1cd2fd6c1c6b39b3b7cb08a58cb448bc",
    "groupId": 1.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"vmUuid":"1cd2fd6c1c6b39b3b7cb08a58cb448bc","groupId":1.0}}' http://localhost:8080/zstack/v1/cdp-backup-storage/unmount-recovery-point
Request Parameters
Name Type Location Description Optional Value Starting Version
vmUuid String body (contained in the params structure) The UUID of the VM instance. 4.5.0
groupId long body (contained in the params structure) The group ID of the recovery points. 4.5.0
systemTags List body Optional. The system tags. 4.5.0
userTags List body Optional. The user tags. 4.5.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
UnmountVmInstanceRecoveryPointAction action = new UnmountVmInstanceRecoveryPointAction();
action.vmUuid = "1cd2fd6c1c6b39b3b7cb08a58cb448bc";
action.groupId = 1.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UnmountVmInstanceRecoveryPointAction.Result res = action.call();
Python SDK
UnmountVmInstanceRecoveryPointAction action = UnmountVmInstanceRecoveryPointAction()
action.vmUuid = "1cd2fd6c1c6b39b3b7cb08a58cb448bc"
action.groupId = 1.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UnmountVmInstanceRecoveryPointAction.Result res = action.call()

GetCdpBackupStorageRequirement

API Request

URLs
GET zstack/v1/cdp-backup-storage/{backupStorageUuid}/requirement
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cdp-backup-storage/ce44cb9ea12c354495fc6b4313fc90de/requirement?limit=1000&start=0
Parameters
Name Type Location Description Valid Values Starting Version
backupStorageUuid String url The backup storage UUID. 4.8.10
limit Integer query Optional. 4.8.10
start Integer query Optional. 4.8.10
systemTags List query Optional. The system tags. 4.8.10
userTags List query Optional. The user tags. 4.8.10

API Response

{
  "nextStep": "None",
  "required": {
    "qemuVersion": "6.2.0"
  },
  "current": {
    "cdpVersion": "cdp"
  }
}
Name Type Description Starting Version
required Map The conditions required. 4.8.10
current Map The current conditions. 4.8.10
success boolean Successful or not. 4.8.10
nextStep String The next step. 4.8.10
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.8.10
#error
Name Type Description 起始版本
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.8.10
description String The brief description of the error. 4.8.10
details String The details about the error. 4.8.10
elaboration String The reserved field. Default value: null. 4.8.10
opaque LinkedHashMap The reserved field. Default value: null. 4.8.10
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.8.10

SDK Sample

Java SDK
GetCdpBackupStorageRequirementAction action = new GetCdpBackupStorageRequirementAction();
action.backupStorageUuid = "ce44cb9ea12c354495fc6b4313fc90de";
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCdpBackupStorageRequirementAction.Result res = action.call();
Python SDK
GetCdpBackupStorageRequirementAction action = GetCdpBackupStorageRequirementAction()
action.backupStorageUuid = "ce44cb9ea12c354495fc6b4313fc90de"
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCdpBackupStorageRequirementAction.Result res = action.call()

UpgradeBackupStorageCdpTasks

API Request

URLs
PUT zstack/v1/cdp-task/upgrade/{backupStorageUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "upgradeBackupStorageCdpTasks": {},
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"upgradeBackupStorageCdpTasks":{}}' http://localhost:8080/zstack/v1/cdp-task/upgrade/618da5c98de33bb0bc2434a80f0ab889/actions
Parameters
Name Type Location Description Valid Values Starting Version
backupStorageUuid String url The backup storage UUID. 4.8.10
systemTags List query Optional. The system tags. 4.8.10
userTags List query Optional. The user tags. 4.8.10

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
UpgradeBackupStorageCdpTasksAction action = new UpgradeBackupStorageCdpTasksAction();
action.backupStorageUuid = "618da5c98de33bb0bc2434a80f0ab889";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpgradeBackupStorageCdpTasksAction.Result res = action.call();
Python SDK
UpgradeBackupStorageCdpTasksAction action = UpgradeBackupStorageCdpTasksAction()
action.backupStorageUuid = "618da5c98de33bb0bc2434a80f0ab889"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpgradeBackupStorageCdpTasksAction.Result res = action.call()
API Reference | 4.8.38 | ZStack Cloud · ZCF | ZStack Resource Center