VM Related InterfacesKey Provider APIs

Upload a Signed KMS Client Certificate

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "uploadKmsClientSignedCert": {
    "signedClientCertPem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
  },
  "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 '{"uploadKmsClientSignedCert":{"signedClientCertPem":"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"}}' \
http://localhost:8080/zstack/v1/key-providers/kms/ff0a9250e11b3fe5a553d61be176d300/actions

Parameter List

NameTypeLocationDescriptionOptional ValueSince
signedClientCertPemStringbody (contained in uploadKmsClientSignedCert structure)Signed client certificate 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

UploadKmsClientSignedCertAction action = new UploadKmsClientSignedCertAction();
action.uuid = "ff0a9250e11b3fe5a553d61be176d300";
action.signedClientCertPem = "-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UploadKmsClientSignedCertAction.Result res = action.call();

Python SDK

action = UploadKmsClientSignedCertAction()
action.uuid = "ff0a9250e11b3fe5a553d61be176d300"
action.signedClientCertPem = "-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()