VM Related InterfacesKey Provider APIs

Parse Native Key Provider Import Content

PUT/zstack/v1/key-providers/nkp/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "parseNkpRestore": {
    "contentBase64": "BASE64_ENCODED_NKP_BACKUP",
    "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 '{"parseNkpRestore":{"contentBase64":"BASE64_ENCODED_NKP_BACKUP","password":"password"}}' \
http://localhost:8080/zstack/v1/key-providers/nkp/actions

Parameter List

NameTypeLocationDescriptionOptional ValueSince
contentBase64Stringbody (contained in parseNkpRestore structure)Import content (Base64-encoded) 5.0.0
password (optional)Stringbody (contained in parseNkpRestore structure)Import protection password 5.0.0
systemTags (optional)ListbodySystem tags 5.0.0
userTags (optional)ListbodyUser tags 5.0.0

API Response

Response Example

{
  "restoreInfo": {
    "uuid": "ff0415ff372f33b5b6b757d3b99ad900",
    "name": "nkp-1",
    "description": "example",
    "kdf": "HKDF-SHA256",
    "saltPolicy": "providerName",
    "currentVersion": 1,
    "backupTime": 1700000000000
  },
  "code": "KP.1000"
}
NameTypeDescriptionSince
codeStringParse result code5.0.0
reasonStringReason for parse failure5.0.0
successboolean 5.0.0
restoreInfoNkpRestoreInfoFor details, see restoreInfo5.0.0
errorErrorCodeFor details, see error5.0.0

restoreInfo

NameTypeDescriptionSince
uuidStringResource UUID, which uniquely identifies the resource5.0.0
nameStringResource name5.0.0
descriptionStringDetailed description of the resource5.0.0
kdfStringKey derivation function5.0.0
saltPolicyStringSalt policy5.0.0
currentVersionIntegerCurrent version5.0.0
backupTimeLongBackup time (millisecond timestamp)5.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

ParseNkpRestoreAction action = new ParseNkpRestoreAction();
action.contentBase64 = "BASE64_ENCODED_NKP_BACKUP";
action.password = "password";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ParseNkpRestoreAction.Result res = action.call();

Python SDK

action = ParseNkpRestoreAction()
action.contentBase64 = "BASE64_ENCODED_NKP_BACKUP"
action.password = "password"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()