Update CCS Certificate State for Account

POST/zstack/v1/crypto/ccs-certificate/update-state/{accountUuid}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "state": "enable"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding example, the systemTags and userTags fields are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"state":"enable"}}' \
http://localhost:8080/zstack/v1/crypto/ccs-certificate/update-state/c418d26244b43e31bfe400652695f62a

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

accountUuid

String

url

Account UUID

 

4.10.0

state

String

body (enclosed in the params structure)

State. Specifies whether to enable certificate verification on the next login.

  • enable
  • disable

4.10.0

system Tags (Optional)

List

body

System tags

 

4.10.0

userTags (Optional)

List

body

User tags

 

4.10.0

API Response

Response Example

{
  "inventory": {
    "uuid": "4e1cab9a3a0f4a1eb6a919510814d8f8",
    "algorithm": "SM2",
    "format": "CER",
    "issuerDN": "C=cn,O=infosec,OU=system,CN=ca62_sm2",
    "subjectDN": "C=CN,O=ZStack,OU=ZStack,CN=ZStackTest2",
    "serNumber": "13055887750776402041",
    "effectiveTime": "Oct 15, 2021 10:50:09 AM",
    "expirationTime": "Oct 15, 2024 10:50:09 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.10.0
inventoryCCSCertificateInventoryFor details, see inventory4.10.0
errorErrorCodeError code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error4.10.0

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID. Uniquely identifies the resource.4.3.12
algorithmStringCertificate type4.3.12
formatStringCertificate format. CER for Chinese national cryptographic standards. Other formats include CRT, DER, JKS, etc.4.3.12
issuerDNStringIssuer DN (issuer-DN-distinguished name), for example, CN=sm2,O=test,C=cn4.3.12
subjectDNStringSubject DN4.3.12
serNumberLongCertificate serial number. Combined with subjectDN as a composite key, it is globally unique.4.3.12
effectiveTimeTimestampEffective date4.3.12
expirationTimeTimestampExpiration date4.3.12
createDateTimestampCreation time4.3.12
lastOpDateTimestampLast modification time4.3.12
userCertificateRefsListFor details, see userCertificateRefs4.3.12

userCertificateRefs

NameTypeDescriptionStarting Version
userUuidStringUser UUID4.3.12
certificateUuidStringCCS certificate UUID4.3.12
createDateTimestampCreation time4.3.12
lastOpDateTimestampLast modification time4.3.12
stateCCSCertificateUserStateFor details, see state4.3.12

state

NameTypeDescriptionStarting Version
EnabledCCSCertificateUserStateVerification required4.3.12
DisabledCCSCertificateUserStateVerification not required4.3.12

error

NameTypeDescriptionStarting Version
codeStringError code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001.0.6
descriptionStringBrief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null.0.6
opaqueLinkedHashMapReserved field. Default is null.0.6
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists.0.6

SDK Examples

Java SDK

UpdateCCSCertificateAccountStateAction action = new UpdateCCSCertificateAccountStateAction();
action.accountUuid = "c418d26244b43e31bfe400652695f62a";
action.state = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateCCSCertificateAccountStateAction.Result res = action.call();

Python SDK

UpdateCCSCertificateAccountStateAction action = UpdateCCSCertificateAccountStateAction()
action.accountUuid = "c418d26244b43e31bfe400652695f62a"
action.state = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateCCSCertificateAccountStateAction.Result res = action.call()