You need to enable JavaScript to run this app.
导航

UploadCertificate

最近更新时间2024.03.22 08:27:45

首次发布时间2021.08.31 10:37:28

调用 UploadCertificate 接口上传一张服务器证书。

使用说明

  • 一个账号下每个区域最多可上传100个证书。
  • Tags.N.a类型的请求参数中,“N”表示标签信息的序号,需按照数字顺序从1开始填写,取值范围为1~50。多个标签之间使用&分隔。

调试

请求参数

名称类型是否必填示例值
描述
ActionStringUploadCertificate要执行的操作,取值为UploadCertificate。
VersionString2020-04-01API版本信息,当前版本为:2020-04-01。

CertificateName

String

mycert1

证书的名称。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点号(.)、下划线(_)和中划线(-)。
  • 长度限制为1 ~ 128个字符。
  • 不传入该参数或该参数不传入数值时,默认为证书ID。
PublicKeyStringpubkeycontent证书的公钥内容。
PrivateKeyStringprivatekeycontent证书的私钥内容。

Description

String

mycert

证书的描述,默认值为空字符串。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、中划线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。
ProjectNameStringdefault证书所属项目的名称。
不传入该参数或该参数不传入数值时,默认为default。

Tags.N.Key

String

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

用户标签的标签键。

  • 长度限制为1~128个字符。
  • 大小写敏感,不能以volc:sys:的任意大小写组合开头。
  • 不能以空格开头或结尾。
  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。

同一资源的标签键不允许重复。如果传入的Tags.N.Key与已有标签的标签键重复,则后添加的标签会覆盖原有标签。

Tags.N.Value

String

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

用户标签的标签值。

  • 长度限制为1~256个字符。
  • 大小写敏感,不能以空格开头或结尾。
  • 允许包含各国语言文字、数字、空格()、下划线(_)、点号(.)、半角冒号(:)、斜杠(/)、等号(=)、加号(+)、减号(-)和@。

如果传入该参数,则必须先传入Tags.N.Key

返回参数

字段类型示例值描述
RequestIdString20210811152539010225146063030****请求ID。
CertificateIdStringcert-3tjuxoukkq3vj0ww****证书ID。

请求示例

GET /?Action=UploadCertificate&Version=2020-04-01&CertificateName=mycert1&PublicKey=***&PrivateKey=*** HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: clb

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20210811152539010225146063030****",
        "Action": "UploadCertificate",
        "Version": "2020-04-01",
        "Service": "clb",
        "Region": "cn-beijing"
     },
    "Result": {
        "RequestId": "20210811152539010225146063030****",
        "CertificateId": "cert-3tjuxoukkq3vj0ww****"
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

HttpCode错误码错误信息描述

400

MissingParameter

The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, the 'XXX'.

该请求缺少必要参数。请确保发起请求已提供全部必要参数,比如XXX

说明

其中,XXX表示缺少的参数名称。

400InvalidCertificateDescription.MalformedThe specified CertificateDescription is malformed.指定的 CertificateDescription 参数格式不合法。
400InvalidCertificateLength.MalformedThe specified CertificateLength is malformed.指定的 CertificateLength 参数格式不合法。
400InvalidCertificateName.MalformedThe specified CertificateName is malformed.指定的 CertificateName 参数格式不合法。
400InvalidPrivateKey.MalformedThe specified PrivateKey is malformed.指定的 PrivateKey 参数格式不合法。
400InvalidPublicKey.MalformedThe specified PublicKey is malformed.指定的 PublicKey 参数格式不合法。
400InvalidIncorrectOrder.MalformedThe specified index order is malformed.指定的索引顺序参数格式不合法。
400InvalidTagKey.MalformedThe specified TagKey is malformed.指定的 TagKey 参数格式不合法。
400InvalidTagValue.MalformedThe specified TagValue is malformed.指定的 TagValue 参数格式不合法。
400LimitExceeded.ServiceManagedTagYou've reached the limit on the number of service managed tags that you can create.已达到单次可创建受管资源标签键值数量的上限。
400LimitExceeded.TagOperationYou've reached the limit on the number of tags that you can operate at a time.已达到单次可操作的标签条目数量上限。
400QuotaExceed.CertificateNumberYou've reached the limit on the number of Certificate that you can create.已达到可创建证书的数量的配额上限。
400InvalidPublicKey.PrivateKeyMismatchThe PublicKey and PrivateKey are not matched.指定的公钥与私钥不匹配。
400InvalidProject.MalformedThe specified Project is malformed.指定的 Project 参数格式不合法。
403ForbiddenYou are not authorized to perform operations on the service managed tag.无权限对指定资源打上受管标签。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。