VM Related InterfacesKey Provider APIs

Upload a KMS Client CSR and Private Key

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "uploadKmsClientCsr": {
    "csrPem": "-----BEGIN CERTIFICATE REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----",
    "csrKeyPem": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
  },
  "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 '{"uploadKmsClientCsr":{"csrPem":"-----BEGIN CERTIFICATE REQUEST-----\n...\n-----END CERTIFICATE REQUEST-----","csrKeyPem":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"}}' \
http://localhost:8080/zstack/v1/key-providers/kms/ff0a9250e11b3fe5a553d61be176d300/actions

Parameter List

NameTypeLocationDescriptionOptional ValueSince
csrPemStringbody (contained in uploadKmsClientCsr structure)CSR 5.0.0
csrKeyPemStringbody (contained in uploadKmsClientCsr structure)CSR private key 5.0.0
uuidStringurlResource UUID, which uniquely identifies the resource 5.0.0
systemTags (optional)ListbodySystem tags 5.0.0
userTags (optional)ListbodyUser tags 5.0.0

API Response

Response Example

{
  "inventory": {
    "uuid": "ff0fe4c52fce34ff9ffca4d3a0fd4d00",
    "kmsUuid": "ff0a9250e11b3fe5a553d61be176d300",
    "identityType": "CSR",
    "clientCertPem": "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----",
    "csrPem": "-----BEGIN CERTIFICATE REQUEST-----\\n...\\n-----END CERTIFICATE REQUEST-----",
    "certExpiredDate": "Nov 14, 2017 2:20:57 PM",
    "createDate": "Nov 14, 2017 2:20:57 PM",
    "lastOpDate": "Nov 14, 2017 2:20:57 PM"
  }
}
NameTypeDescriptionSince
successboolean 5.0.0
inventoryKmsIdentityInventoryFor details, see inventory5.0.0
errorErrorCodeFor details, see error5.0.0

inventory

NameTypeDescriptionSince
uuidStringResource UUID, which uniquely identifies the resource5.0.0
kmsUuidStringKmsUUID5.0.0
identityTypeStringIdentity type5.0.0
clientCertPemStringKMSClient certificate5.0.0
csrPemStringCSR content5.0.0
certExpiredDateTimestampClient certificate expiration time5.0.0
createDateTimestampCreation time5.0.0
lastOpDateTimestampLast modification time5.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

UploadKmsClientCsrAction action = new UploadKmsClientCsrAction();
action.uuid = "ff0a9250e11b3fe5a553d61be176d300";
action.csrPem = "-----BEGIN CERTIFICATE REQUEST-----
...
-----END CERTIFICATE REQUEST-----";
action.csrKeyPem = "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UploadKmsClientCsrAction.Result res = action.call();

Python SDK

action = UploadKmsClientCsrAction()
action.uuid = "ff0a9250e11b3fe5a553d61be176d300"
action.csrPem = "-----BEGIN CERTIFICATE REQUEST-----
...
-----END CERTIFICATE REQUEST-----"
action.csrKeyPem = "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()