用于设置某站点下是否启用证书功能及更新证书信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
esa:SetCertificate |
none |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| SiteId |
integer |
是 |
站点 ID。可通过 ListSites 接口获取。 |
1234567890123 |
| Name |
string |
否 |
证书名称,type 为 upload 类型时需要输入该参数。 |
yourCertName |
| CasId |
integer |
否 |
云证书 Id,type 为 cas 的情况下需要输入该参数。 |
30000478 |
| Type |
string |
是 |
证书类型。
|
cas |
| Certificate |
string |
否 |
证书内容,type 为 upload 类型时需要输入该参数。 |
-----BEGIN CERTIFICATE----- |
| PrivateKey |
string |
否 |
证书私钥,type 为 upload 类型时需要输入该参数。 |
-----BEGIN PRIVATE KEY----- |
| Region |
string |
否 |
地域,type 为 cas 的情况下需要输入该参数。
|
cn-hangzhou |
| Id |
string |
否 |
证书 Id,不支持 free 类型(通过接口 ApplyCertificate 创建)的证书 Id,可以支持 cas 和 upload 类型的证书 Id。 |
babae7c40fef412d887688b91c9e**** |
| KeyServerId |
string |
否 |
Keyless server ID,当 Type 为 keyless 时有效。 |
1233112**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
A666D44F-19D6-490E-97CF-1A64AB962C57 |
| Id |
string |
证书 Id |
babae7c40fef412d887688b91c9e**** |
示例
正常返回示例
JSON格式
{
"RequestId": "A666D44F-19D6-490E-97CF-1A64AB962C57",
"Id": "babae7c40fef412d887688b91c9e****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Certificate.StatusError | The status of the certificate is invalid. | 证书状态错误。 |
| 400 | Certificate.Duplicated | The certificate name already exists. | 证书重复。 |
| 400 | InvalidParameter | 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. | 您提供的证书与该站点不匹配,请确认证书的有效性并重新发起请求。 |
| 400 | InvalidSSLPub | The specified Certificate is invalid. | Certificate错误,请重新填写。 |
| 400 | InvalidSSLPri | The specified PrivateKey is invalid. | PrivateKey错误,请填写正确的PrivateKey。 |
| 400 | CasId.MissingParameter | The CasId parameter is required. | CasId参数缺失。 |
| 400 | PrivateKey.MissingParameter | The PrivateKey parameter is required. | PrivateKey参数缺失。 |
| 400 | Certificate.MissingParameter | The Certificate parameter is required. | Certificate参数缺失。 |
| 400 | InvalidParameter.SiteId | Failed to query the website based on the SiteID you specified. Check parameter SiteId and try again. | SiteId参数无效,无法通过指定的SiteId获取对应的站点名称,请确认SiteId后重试。 |
| 400 | InternalException | Failed to call the service. Try again later or contact technical support. | 调用服务失败,请稍后重试或联系客服咨询详情。 |
| 400 | UpdateFreeCertificate.NotSupport | The free certificate does not support the update operation. | 免费证书不支持更新操作。 |
| 400 | CertificateDomainNotMatchSite | The domain name in the specified certificate does not match the site. | 证书中的域名和当前站点不匹配。 |
| 400 | CertificateNotMatchPrivateKey | The specified certificate does not match the private key. | 指定的证书和私钥不匹配。 |
| 400 | CertQuotaCheckFailed | 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. | 指定的证书不存在。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。