更新KMS密钥提供程序

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateKms": {
    "endpoint": "kms.example.com",
    "port": 5696,
    "kmipVersion": "1.2",
    "username": "user",
    "password": "password",
    "description": "example"
  },
  "systemTags": [],
  "userTags": []
}

上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateKms":{"endpoint":"kms.example.com","port":5696,"kmipVersion":"1.2","username":"user","password":"password","description":"example"}}' \
http://localhost:8080/zstack/v1/key-providers/kms/ff0a9250e11b3fe5a553d61be176d300/actions

参数列表

名字

类型

位置

描述

可选值

起始版本

endpoint (可选)

String

body(包含在updateKms结构中)

地址

 

5.0.0

port (可选)

Integer

body(包含在updateKms结构中)

端口

 

5.0.0

kmipVersion (可选)

String

body(包含在updateKms结构中)

KMIP协议版本

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

5.0.0

username (可选)

String

body(包含在updateKms结构中)

用户名

 

5.0.0

password (可选)

String

body(包含在updateKms结构中)

密码

 

5.0.0

uuid

String

url

资源的UUID,唯一标示该资源

 

5.0.0

description (可选)

String

body(包含在updateKms结构中)

资源的详细描述

 

5.0.0

systemTags (可选)

List

body

系统标签

 

5.0.0

userTags (可选)

List

body

用户标签

 

5.0.0

SDK示例

Java SDK

UpdateKmsAction action = new UpdateKmsAction();
action.endpoint = "kms.example.com";
action.port = 5696;
action.kmipVersion = "1.2";
action.username = "user";
action.password = "password";
action.uuid = "ff0a9250e11b3fe5a553d61be176d300";
action.description = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateKmsAction.Result res = action.call();

Python SDK

action = UpdateKmsAction()
action.endpoint = "kms.example.com"
action.port = 5696
action.kmipVersion = "1.2"
action.username = "user"
action.password = "password"
action.uuid = "ff0a9250e11b3fe5a553d61be176d300"
action.description = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()