VM Related InterfacesKey Provider APIs

Create a Native Key Provider

POST/zstack/v1/key-providers/nkp

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "kdf": "HKDF-SHA256",
    "saltPolicy": "providerName",
    "name": "kp-nkp",
    "description": "example"
  },
  "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 POST -d '{"params":{"kdf":"HKDF-SHA256","saltPolicy":"providerName","name":"kp-nkp","description":"example"}}' \
http://localhost:8080/zstack/v1/key-providers/nkp

Parameter List

Name

Type

Location

Description

Optional Value

Since

kdf (optional)

String

body (contained in params structure)

Key derivation function

  • HKDF-SHA256

5.0.0

saltPolicy (optional)

String

body (contained in params structure)

Salt policy

  • providerName

5.0.0

name

String

body (contained in params structure)

Resource name

 

5.0.0

description (optional)

String

body (contained in params structure)

Detailed description of the resource

 

5.0.0

type (optional)

String

body (contained in params structure)

Key provider type

 

5.0.0

resourceUuid (optional)

String

body (contained in params structure)

Resource UUID

 

5.0.0

tagUuids (optional)

List

body (contained in params structure)

Tag UUID list

 

5.0.0

systemTags (optional)

List

body

System tags

 

5.0.0

userTags (optional)

List

body

User tags

 

5.0.0

SDK Example

Java SDK

CreateNkpAction action = new CreateNkpAction();
action.kdf = "HKDF-SHA256";
action.saltPolicy = "providerName";
action.name = "kp-nkp";
action.description = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateNkpAction.Result res = action.call();

Python SDK

action = CreateNkpAction()
action.kdf = "HKDF-SHA256"
action.saltPolicy = "providerName"
action.name = "kp-nkp"
action.description = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()