You need to enable JavaScript to run this app.
导航
ReplaceCACertificate
最近更新时间:2025.04.17 11:56:34首次发布时间:2023.03.22 11:33:29
我的收藏
有用
有用
无用
无用

请求说明

API 名称:ReplaceCACertificate。
API 域名:open.volcengineapi.com 。
API 描述:替换 CA 证书。

使用限制

节流限制:每秒最多提交 5 个 API 请求。

调试

URI 参数

在使用该部分 API 提交请求时必须包含以下 URI 参数。

除了 URI 参数,该 API 请求还需要包含签名参数。关于更多签名参数的信息,参见公共请求参数

名称类型是否必选格式说明
Action
string
[a-zA-Z]+
API 名称,如 ReplaceCACertificate。
VersionstringYYYY-MM-DDAPI 版本信息。该参数的取值是 2020-04-01 。
X-Expiresint900表示签名的有效时间,单位是秒,默认值是900。

请求参数

在使用该 API 提交请求时,请求参数中可以包含的参数如下。

参数类型是否必选参数说明示例值
OldCACertificateId
String
需要被替换的CA证书的ID。
cert-123***765

UpdateMode

String

替换证书的模式,支持:

  • new:上传新证书替换

  • stock:使用已有证书替换。

new

CACertificateIdString新CA证书 ID。选择已有证书替换时,即UpdateMode为stock,本参数必填且生效。cert-123***765
CACertificateNameString证书的名称。test
DescriptionString证书的描述。test

CACertificate

String

证书内容,当UpdateMode为new时,该字段必填,格式如下:
-----BEGIN CERTIFICATE-----
客户端 CA 公钥证书(BASE64编码)
-----END CERTIFICATE-----

public

ProjectNameString证书所属项目。当UpdateMode为new时,该字段生效。test
TagsArray证书关联的标签,具体参见下表 Tags-

Tags

参数

类型

是否必选

参数说明

示例

Tags.N.Key

String

用户标签的标签键。具体规则如下:

  • 长度限制为1~128个字符。

  • 大小写敏感。

  • 不能以volc:和sys:的任意大小写组合开头。

  • 不能以空格开头或结尾。

  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。

  • 同一资源的标签键不允许重复。

Tags.1.Key=k1&Tags.2.Key=k2

Tags.N.Value

String

用户标签的标签值。如果传入该参数,则必须先传入Tags.N.Key。具体规则如下:

  • 长度限制为0~256个字符。

  • 大小写敏感。

  • 不能以空格开头或结尾。

  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。

Tags.1.Value=v1&Tags.2.Value=v2

返回参数

参数类型参数说明示例值
RequestId
String
请求ID。
20210816110638****2514606306AF947C
CACertificateIdString新CA证书ID。cert-*****

示例

请求示例

GET /?Action=ReplaceCACertificate&OldCACertificateId=cert-2jqh****hsx&CACertificate=***&CACertificateName=test&Version=2020-04-01 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
ServiceName: alb

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210816110638****2514606306AF947C",
        "Action": "ReplaceCACertificate",
        "Version": "2020-04-01",
        "Service": "alb",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "202108161106****22514606306AF947C",
        "CACertificateId": "cert-****"
    }
}

错误码

如果响应正文包含 Error 字段,则表示 API 请求失败。此处仅展示当前 API 的错误码,更多错误码请参见公共错误码

HTTP Code错误码错误信息错误描述

400

InvalidOldCACertificate.InvalidStatus

The specified Old CA Certificate is not in the correct status for the request.

指定的旧 CA 证书所处状态无法响应该请求。

400InvalidCertificateType.FunctionMismatchThe specified Certificate's type and Function do not match.指定的证书的类型与预期功能不匹配。
400OperationDenied.NoListenerBoundThe 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.

因该旧证书绑定的监听器数量超过上限,对于该证书的操作请求被拒绝。

400InvalidCACertificateName.MalformedThe specified CACertificateName is malformed.指定的 CACertificateName 参数格式不合法。
400InvalidDescription.MalformedThe specified Description is malformed.指定的 Description 参数格式不合法。
400InvalidCACertificate.MalformedThe specified CACertificate is malformed. The specified ca certificate's length is too long.指定的 CACertificate 参数格式不合法。其中 CA 证书内容长度太长。
400InvalidCACertificate.MalformedThe specified CACertificate is malformed. The specified ca certificate's format is malformed.指定的 CACertificate 参数格式不合法。其中 CA 证书格式不合法。
400InvalidCACertificate.MalformedThe specified CACertificate is malformed. The specified ca certificate's content is malformed.指定的 CACertificate 参数格式不合法。其中 CA 证书内容不合法。

400

OperationFailed.QueryProject

The request on the specified resource failed due to the query on project failed.

因查询项目失败,对于该资源的操作请求失败。

400

InvalidCertificate.Duplicated

The specified Certificate is duplicated. The specified new certificate is not allowed to be similar to the old certificate.

指定的证书重复。新证书不能与旧证书相同。

400

InvalidCACertificate.InvalidStatus

The specified CA Certificate is not in the correct status for the request.

指定的 CA 证书所处状态无法响应该请求。

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.

指定的新证书类型和旧证书类型不匹配。指定的新证书必须与旧证书的类型相同。

400InvalidUpdateMode.MalformedThe specified UpdateMode is malformed.指定的 UpdateMode 参数格式不合法。
400QuotaExceed.CACertPerRegionYou've reached the limit on the number of CA certificates the current region you can create in, usage xx/xx.已达到当前地域可创建的 CA 证书的数量上限。目前已使用xxx,配额为xxx。
400OperationFailed.AddIntoProjectFailedThe request on the specified resource failed due to adding it into the project failed.因将资源加入至项目中失败,对于该资源的操作请求失败。
400InvalidCertificate.InvalidStatusThe specified Certificate is not in the correct status for the request.指定的证书所处状态无法响应该请求。

400

InvalidLoadBalancer.InvalidStatus

The related LoadBalancer is not in the correct status for the request.

关联的 ALB 实例所处状态无法响应该请求。

404InvalidOldCACertificate.NotFoundThe specified Old CA Certificate does not exist.指定的旧 CA 证书不存在。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
404InvalidCACertificate.NotFoundThe specified CA Certificate does not exist.指定的 CA 证书不存在。
400InvalidTags.Key.MalformedThe specified Tags.Key is malformed.指定的 Tags.Key 参数格式不合法。
400InvalidTags.Value.MalformedThe specified Tags.Value is malformed.指定的 Tags.Value 参数格式不合法。
400InvalidTags.Key.DuplicatedThe specified Tags.Key is duplicated.指定的 Tags.Key 重复。