You need to enable JavaScript to run this app.
文档中心
负载均衡

负载均衡

复制全文
下载 pdf
证书
ReplaceCertificate - 替换服务器证书
复制全文
下载 pdf
ReplaceCertificate - 替换服务器证书
调用 ReplaceCertificate 接口,替换服务器证书。​
使用说明​
每秒最多提交 5 个 API 请求。​
请求说明​
  • 请求方式:GET​
  • 请求地址:/?Action=ReplaceCertificate&Version=2020-04-01​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ReplaceCertificate​
要执行的操作,取值:ReplaceCertificate。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
OldCertificateId string 必选 示例值:cert-123***765​
需要被替换的服务器证书的ID。​
​
CertificateId string 可选 示例值:cert-123***765​
来自ALB上传的新证书 ID。​
选择已有证书替换时,即UpdateMode为stock,并且CertificateSource为alb时,本参数必填且生效。​
​
ProjectName string 可选 示例值:test​
证书所属项目。当UpdateMode为new时,本字段生效。​
​
CertificateName string 可选 示例值:test​
证书的名称。​
  • 不能以http://或https://开头。​
  • 必须以字母或中文开头,可包含数字、点号(.)、下划线(_)和短横线(-)。​
  • 长度限制为1 ~ 128个字符。​
  • 不填默认为证书ID。​
​
CertificateSource string 可选 示例值:cert_center​
新服务器证书的来源。取值如下:​
  • alb:表示通过 ALB上传的证书。​
  • cert_center:表示通过火山证书中心上传的证书。​
说明​
当替换模式为使用已有证书替换,即UpdateMode取值为 stock 时本参数必填且生效。不填时,默认值为 alb​
​
Description string 可选 示例值:test​
证书的描述。​
​
CertCenterCertificateId string 可选 示例值:cert-123***765​
来自证书中心的新证书 ID。​
选择已有证书替换时,即UpdateMode为stock,并且CertificateSource为cert_center,本参数必填且生效。​
​
PrivateKey string 可选 示例值:private​
证书私钥。​
当UpdateMode为new时,本字段必填且生效,格式如下:​
  • 格式1:​
-----BEGIN RSA PRIVATE KEY-----​
证书私钥(BASE64编码)​
-----END RSA PRIVATE KEY-----​
  • 格式2:​
-----BEGIN EC PARAMETERS-----​
证书私钥(BASE64编码)​
-----END EC PARAMETERS-----​
-----BEGIN EC PRIVATE KEY-----​
证书私钥(BASE64编码)​
-----END EC PRIVATE KEY-----​
​
PublicKey string 可选 示例值:public​
证书公钥,当UpdateMode为new时,本字段必填且生效,格式如下:​
-----BEGIN CERTIFICATE-----​
服务器公钥证书(BASE64编码)​
-----END CERTIFICATE-----​
!!!中间不可有空行!!!​
-----BEGIN CERTIFICATE-----​
中级签发机构公钥证书(BASE64编码)​
-----END CERTIFICATE-----​
​
UpdateMode string 必选 示例值:new​
替换证书的模式。取值如下:​
  • new:上传新证书替换。​
  • stock:使用已有证书替换。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=v1&Tags.2.Value=v2​
用户标签的标签值。​
  • 如果传入该参数,则必须先传入Tags.N.Key。​
  • 具体规则如下:​
  • 长度限制为0~256个字符。​
  • 大小写敏感。​
  • 不能以空格开头或结尾。​
  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。​
​
Tags.N.Key string[] 可选 示例值:Tags.1.Key=k1&Tags.2.Key=k2​
用户标签的标签键。具体规则如下:​
  • 长度限制为1~128个字符。​
  • 大小写敏感。​
  • 不能以volc:和sys:的任意大小写组合开头。​
  • 不能以空格开头或结尾。​
  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。​
  • 同一资源的标签键不允许重复。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId string 示例值:20210816110638****2514606306AF947C​
请求ID。​
​
CertificateId string 示例值:cert-*****​
新证书ID。​
​
​
​
请求示例​
​
GET /?Action=ReplaceCertificate&OldCertificateId=cert-2jqh****hsx&PublicKey=***&PrivateKey=***&CertificateName=test&Version=2020-04-01 HTTP/1.1​
Host: alb.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/alb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20210816110638****2514606306AF947C",​
"Action": "ReplaceCertificate",​
"Version": "2020-04-01",​
"Service": "alb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "202108161106****22514606306AF947C",​
"CertificateId": "cert-****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
Invalid%s.Malformed​
MismatchThe specified %s is malformed.​
指定的 %s 参数格式不合法。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, '%s'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: %s。​
400​
InvalidParameter​
Data unmarshal failed.​
请求解析失败。​
400​
InvalidCertificateType.FunctionMismatch​
The specified Certificate's type and Function do not match.​
指定的证书的类型与预期功能不匹配。​
400​
InvalidLoadBalancer.InvalidStatus​
The related LoadBalancer is not in the correct status for the request.​
关联的 ALB 实例所处状态无法响应该请求。​
400​
InvalidCertificate.InvalidStatus​
The specified Certificate is not in the correct status for the request.​
指定的证书所处状态无法响应该请求。​
400​
OperationFailed.AddIntoProjectFailed​
The request on the specified resource failed due to adding it into the project failed.​
因将资源加入至项目中失败,对于该资源的操作请求失败。​
400​
QuotaExceed.CertPerRegion​
You've reached the limit on the number of server certificates the current region you can create in, usage xx/xx.​
已达到当前地域可创建的服务器证书的数量上限。目前已使用xxx,配额为xxx。​
400​
InvalidUpdateMode.Malformed​
The specified UpdateMode is malformed.​
指定的 UpdateMode 参数格式不合法。​
400​
InvalidOldCertificateType.CertificateTypeMismatch​
The specified new certificate type and old certificate type do not match. The specified new certificate must be the same type as the old one.​
指定的新证书类型和旧证书类型不匹配。指定的新证书必须与旧证书的类型相同。​
400​
InvalidServerCertificate.InvalidStatus​
The specified Server Certificate is not in the correct status for the request.​
指定的服务器证书所处状态无法响应该请求。​
400​
OperationFailed.QueryProject​
The request on the specified resource failed due to the query on project failed.​
因查询项目失败,对于该资源的操作请求失败。​
400​
InvalidOldServerCertificate.InvalidStatus​
The specified Old Server Certificate is not in the correct status for the request.​
指定的旧服务器证书所处状态无法响应该请求。​
400​
OperationDenied.NoListenerBound​
The request on the specified certificate is denied due to no listener bound on the specified old certificate.​
因该旧证书未绑定任何监听器,对于该证书的操作请求被拒绝。​
400​
OperationDenied.ListenersBoundCountExceed​
The request on the specified certificate is denied due to the count of listeners bound on the specified old certificate exceeding limit.​
因该旧证书绑定的监听器数量超过上限,对于该证书的操作请求被拒绝。​
400​
InvalidCertificateName.Malformed​
The specified CertificateName is malformed.​
指定的 CertificateName 参数格式不合法。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的 Description 参数格式不合法。​
400​
InvalidCertificateType.Malformed​
The specified CertificateType is malformed.​
指定的 CertificateType 参数格式不合法。​
400​
InvalidPublicKey.Malformed​
The specified PublicKey is malformed.​
指定的 PublicKey 参数格式不合法。​
400​
InvalidPrivateKey.Malformed​
The specified PrivateKey is malformed.​
指定的 PrivateKey 参数格式不合法。​
400​
InvalidPublicKey.PrivateKeyMismatch​
The specified PublicKey and PrivateKey do not match.​
指定的公钥和私钥不匹配。​
400​
InvalidCertificate.Duplicated​
The specified Certificate is duplicated. The specified new certificate is not allowed to be similar to the old certificate.​
指定的证书重复。新证书不能与旧证书相同。​
400​
InvalidCertificateSource.Malformed​
The specified CertificateSource is malformed.​
指定的 CertificateSource 参数格式不合法。​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, 'CertificateId'.​
该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如: CertificateId。​
400​
InvalidCertificateServiceSSLCertificate.InvalidStatus​
The specified Certificate Service SSL Certificate is not in the correct status for the request. Please check if the certificate has been issued.​
指定的证书中心 SSL 证书所处状态无法响应该请求。请确认证书处于已签发状态。​
400​
OperationFailed.QueryIAM​
The request on the specified resource failed due to the query on IAM failed.​
因请求 IAM 失败,对于该资源的操作请求失败。​
400​
OperationFailed.QueryCertificateService​
The request on the specified resource failed due to the query on Certificate Service failed.​
因请求证书中心服务失败,对于该资源的操作请求失败。​
400​
InvalidCertificateId.Duplicated​
The specified CertificateId is duplicated. Certificates in one listener can not be same.​
指定的 CertificateId 重复。一个监听器下的证书不能重复。​
400​
InvalidTags.Key.Malformed​
The specified Tags.Key is malformed.​
指定的 Tags.Key 参数格式不合法。​
400​
InvalidTags.Value.Malformed​
The specified Tags.Value is malformed.​
指定的 Tags.Value 参数格式不合法。​
400​
InvalidTags.Key.Duplicated​
The specified Tags.Key is duplicated.​
指定的 Tags.Key 重复。​
400​
QuotaExceed.ListenerPerCert​
You've reached the limit on the number of listeners per server certificate you can associate with, resource xxx, usage xx/xx.​
已达到每个服务器证书可关联的监听器的数量上限。资源是xxx,目前已使用xxx,配额为xxx。​
404​
InvalidServerCertificate.NotFound​
The specified Server Certificate does not exist.​
指定的服务器证书不存在。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的项目不存在。​
404​
InvalidOldServerCertificate.NotFound​
The specified Old Server Certificate does not exist.​
指定的旧服务器证书不存在。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。请稍后重试或联系工程师进一步咨询。​
​
​
最近更新时间:2026.07.06 20:39:00
这个页面对您有帮助吗?
有用
有用
无用
无用