VM Related InterfacesKey Provider APIs

Import a Native Key Provider

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

Headers

Authorization: OAuth the-session-uuid

Body

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

Parameter List

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

SDK Example

Java SDK

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

Python SDK

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