Configures whether to enable certificates and update certificate information for a website.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| esa:SetCertificate | none | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| SiteId | long | Yes | The website ID, which can be obtained by calling the ListSites operation. | 1234567890123 |
| Name | string | No | The certificate name. | yourCertName |
| CasId | long | No | The certificate ID on Certificate Management Service. | 30000478 |
| Type | string | Yes | The certificate type. Valid values:
| cas |
| Certificate | string | No | The certificate content. | -----BEGIN CERTIFICATE----- |
| PrivateKey | string | No | The private key of the certificate. | -----BEGIN PRIVATE KEY----- |
| Region | string | No | The region. | cn-hangzhou |
| Id | string | No | The certificate ID on ESA. | 30001303 |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "A666D44F-19D6-490E-97CF-1A64AB962C57",
"Id": "babaffe176ae44e2ad16d3e309b9e506"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | Certificate.StatusError | The status of the certificate is invalid. | The specified certificate status is invalid. |
| 400 | Certificate.Duplicated | The certificate name already exists. | The certificate is duplicated. |
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InvalidCertificate.NotFound | The specified certificate does not match the website. Check the validity of the certificate and try again. | The specified certificate does not match the website. Check the validity of the certificate and try again. |
| 400 | InvalidSSLPub | The specified Certificate is invalid. | The value specified for the Certificate parameter is invalid. |
| 400 | InvalidSSLPri | The specified PrivateKey is invalid. | The value specified for the PrivateKey parameter is invalid. |
| 400 | CasId.MissingParameter | The CasId parameter is required. | The CasId parameter is missing. |
| 400 | PrivateKey.MissingParameter | The PrivateKey parameter is required. | Missing PrivateKey parameter. |
| 400 | Certificate.MissingParameter | The Certificate parameter is required. | Missing Certificate parameter. |
| 400 | InvalidParameter.SiteId | Failed to query the website based on the SiteID you specified. Check parameter SiteId and try again. | Failed to query the website based on the SiteID you specified. Check parameter SiteId and try again. |
| 400 | InternalException | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
| 400 | UpdateFreeCertificate.NotSupport | The free certificate does not support the update operation. | The free certificate does not support the update operation. |
| 400 | CertificateDomainNotMatchSite | The domain name in the specified certificate does not match the site. | The domain name in the certificate does not match the current site. |
| 400 | CertificateNotMatchPrivateKey | The specified certificate does not match the private key. | The specified certificate and private key do not match. |
| 400 | CertQuotaCheckFailed | The custom certificate quota verification failed. The number of uploaded certificates exceeds the upper limit allowed for the plan. | The custom certificate quota verification failed. The number of uploaded certificates exceeds the upper limit allowed for the plan. |
| 404 | Certificate.NotFound | The specified certificate does not exist. | The specified certificate does not exist. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-02-13 | The Error code has changed. The request parameters of the API has changed | View Change Details |
| 2025-01-09 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2024-12-12 | The Error code has changed | View Change Details |
| 2024-10-15 | The Error code has changed | View Change Details |
| 2024-10-03 | The Error code has changed | View Change Details |
| 2024-09-18 | The Error code has changed | View Change Details |
| 2024-09-06 | The Error code has changed | View Change Details |
