VM Related InterfacesKey Provider APIs

Back Up a Native Key Provider

PUT/zstack/v1/key-providers/nkp/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "backupNkp": {
    "password": "password"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding example, the systemTags and userTags fields can be omitted. They are listed to indicate that the body can include these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"backupNkp":{"password":"password"}}' \
http://localhost:8080/zstack/v1/key-providers/nkp/ff0415ff372f33b5b6b757d3b99ad900/actions

Parameter List

NameTypeLocationDescriptionOptional ValueSince
uuidStringurlResource UUID, which uniquely identifies the resource 5.0.0
password (optional)Stringbody (contained in backupNkp structure)Backup protection password 5.0.0
systemTags (optional)ListbodySystem tags 5.0.0
userTags (optional)ListbodyUser tags 5.0.0

API Response

Response Example

{
  "content": "BASE64_ENCODED_NKP_BACKUP"
}
NameTypeDescriptionSince
successboolean 5.0.0
contentStringBackup content (Base64-encoded)5.0.0
errorErrorCodeFor details, see error5.0.0

error

NameTypeDescriptionSince
codeStringError code, which is the globally unique identifier of the error, for example, SYS.1000 or HOST.10010.6
descriptionStringSummary description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. The default value is null.0.6
opaqueLinkedHashMapReserved field. The default value is null.0.6
causeErrorCodeRoot error that caused the current error. If no root error exists, this field is null.0.6

SDK Example

Java SDK

BackupNkpAction action = new BackupNkpAction();
action.uuid = "ff0415ff372f33b5b6b757d3b99ad900";
action.password = "password";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
BackupNkpAction.Result res = action.call();

Python SDK

action = BackupNkpAction()
action.uuid = "ff0415ff372f33b5b6b757d3b99ad900"
action.password = "password"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()