VM Related InterfacesKey Provider APIs

Create a KMS Key Provider

POST/zstack/v1/key-providers/kms

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "endpoint": "kms.example.com",
    "port": 5696,
    "kmipVersion": "1.2",
    "username": "user",
    "password": "password",
    "name": "kp-kms",
    "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":{"endpoint":"kms.example.com","port":5696,"kmipVersion":"1.2","username":"user","password":"password","name":"kp-kms","description":"example"}}' \
http://localhost:8080/zstack/v1/key-providers/kms

Parameter List

Name

Type

Location

Description

Optional Value

Since

endpoint

String

body (contained in params structure)

KMSEndpoint

 

5.0.0

port

Integer

body (contained in params structure)

Port

 

5.0.0

kmipVersion (optional)

String

body (contained in params structure)

KMIP protocol version

  • 1.0
  • 1.1
  • 1.2
  • 1.3
  • 1.4
  • 2.0
  • 2.1

5.0.0

username (optional)

String

body (contained in params structure)

Username

 

5.0.0

password (optional)

String

body (contained in params structure)

Password

 

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

CreateKmsAction action = new CreateKmsAction();
action.endpoint = "kms.example.com";
action.port = 5696;
action.kmipVersion = "1.2";
action.username = "user";
action.password = "password";
action.name = "kp-kms";
action.description = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateKmsAction.Result res = action.call();

Python SDK

action = CreateKmsAction()
action.endpoint = "kms.example.com"
action.port = 5696
action.kmipVersion = "1.2"
action.username = "user"
action.password = "password"
action.name = "kp-kms"
action.description = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()