Updated on 2022-08-09 GMT+08:00

Modifying a Certificate

Function

This API is used to change the name or description of a certificate.

URI

  • URI format

    PUT /v2/{project_id}/scm/cert/{cert_id}

  • Parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID.

    cert_id

    Yes

    String

    Certificate ID.

Request

Request parameters

Parameter

Mandatory

Type

Description

modify_key

Yes

String

Change key. The value can be CERT_NAME or DESCRIPTION.

  • CERT_NAME: indicates the name of a certificate to be modified.
  • DESCRIPTION: indicates the description of a certificate to be modified.

modify_value

Yes

String

Modification details.

  • If the change key is CERT_NAME, the value can contain only digits, letters, and hyphens (-). The value is a string of 0 to 63 characters and cannot be null.
  • When the change key is DESCRIPTION, the value is a string of 0 to 255 characters and can be null.

Response

Response parameters

Parameter

Mandatory

Type

Description

response_info

Yes

String

Request result.

Examples

The following describes how to change the certificate name to sssaaaa.

  • Example request
    {
    "modify_key":"CERT_NAME",
    "modify_value": "sssaaaa"
    }
  • Example response
    { 
    "response_info":"success" 
    }

    or

    { 
       "error_code": "SCM.XXXX",  
       "error_msg": "XXXX"   
     }

Status Codes

Table 1 lists the normal status code returned by the API.
Table 1 Status Code

Status Code

Status

Description

200

OK

Request processed successfully.

For details about error code, see Error Codes