文档

AssociateVpnGatewayWithCertificate - 将VPN网关与证书关联

更新时间:

调用AssociateVpnGatewayWithCertificate接口为VPN网关绑定证书。

接口说明

在将 VPN 网关和 SSL 证书进行绑定前,请先了解以下信息:

  • 仅国密型 VPN 网关支持绑定 SSL 证书,您需要为国密型 VPN 网关绑定 2 个 SSL 证书,一个作为加密证书,一个作为签名证书。

  • SSL 证书需使用国密算法。

  • 在同一个 VPN 网关实例下,不支持将同一个 SSL 证书同时指定为加密证书和签名证书。

  • 首次绑定 VPN 网关和 SSL 证书时,系统会自动创建一个名称为 AliyunServiceRoleForVPNCertificate 的服务关联角色,并且为该角色添加名称 AliyunServiceRolePolicyForVPNCertificate 的权限策略,授予 VPN 网关拥有访问其他云资源的权限。更多信息,请参见 AliyunServiceRoleForVPNCertificate

  • AssociateVpnGatewayWithCertificate 接口属于异步接口,即系统先返回一个请求 ID,但该 VPN 网关尚未成功绑定 SSL 证书,系统后台的绑定任务仍在进行。您可以调用 DescribeVpnGateway 接口查询 SSL 证书的绑定状态:

    • 当 VPN 网关处于 updating 状态时,表示 SSL 证书正在绑定中。
    • 当 VPN 网关处于 active 状态时,表示 SSL 证书绑定成功。
  • AssociateVpnGatewayWithCertificate 接口不支持为同一个 VPN 网关并发绑定 SSL 证书。

前提条件

请确保您已经在阿里云数字证书管理服务控制台拥有 2 个使用国密算法的 SSL 证书。关于 SSL 证书的更多信息,请参见什么是数字证书管理服务

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
RegionIdstring

VPN 网关所在的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou
VpnGatewayIdstring

VPN 网关实例 ID。

说明 仅国密型 VPN 网关支持绑定证书。
vpn-bp1q8bgx4xnkm2ogj****
CertificateTypestring

证书类型。取值:

  • Encryption:表示指定 SSL 证书为加密证书。
  • Signature:表示指定 SSL 证书为签名证书。
Signature
CertificateIdstring

证书 ID。

6bfe4218-ea1d****
ClientTokenstring

客户端 Token,用于保证请求的幂等性。

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。

说明 若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。
0c593ea1-3bea****
DryRunboolean

是否只预检此次请求。取值:

  • true:表示只预检此次请求合法性,不会进行绑定操作。检查项包括是否填写了必需参数、请求格式、实例状态等。如果检查不通过,则返回对应错误;如果检查通过,则返回对应请求 ID。

  • false(默认值):表示发送正常请求,通过检查后直接将 VPN 网关和证书进行绑定。

false

返回参数

名称类型描述示例值
object

返回数据结构体。

RequestIdstring

请求 ID。

4EC47282-1B74-4534-BD0E-403F3EE64CAF

示例

正常返回示例

JSON格式

{
  "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF"
}

错误码

HTTP status code错误码错误信息描述
400IllegalParam.CertificateTypeThe specified certificate type (%s) is invalid.-
400OperationFailed.NotNationalStandardThe VPN gateway is not national standard.-
400VpnGateway.ConfiguringThe specified service is configuring.服务正在配置中,请您稍后再试。
400OperationFailed.NoRamPermissionVPN service has no permission to operate your KMS instances.-
400OperationFailed.AssociationExistThe association already exists.由于当前资源处于绑定中操作失败
400OperationFailed.AnotherAssociationExistThe VPN gateway has associated with %s.当前vpn实例已与同类证书绑定。
400SystemBusyThe system is busy. Please try again later.当前系统繁忙,请稍后重试。
400OperationFailed.InvalidCertificateThe specified certificate is invalid.-
403ForbiddenUser not authorized to operate on the specified resource.您没有权限操作指定资源,请申请权限后再操作。
403Forbidden.NoSlrPermissionUser not authorized to create service linked role.-
404InvalidVpnGatewayInstanceId.NotFoundThe specified vpn gateway instance id does not exist.指定的 VPN 网关不存在,请您检查 VPN 网关是否正确。
404InvalidCertificateId.NotFoundThe specified certificate ID (%s) does not exist.-
409OperationConflictThe operation against this instance is too frequent, please try again later.对该实例的操作过于频繁,请稍后重试。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2024-02-22OpenAPI 描述信息更新、OpenAPI 错误码发生变更看变更集
变更项变更内容
API 描述OpenAPI 描述信息更新
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:403
    删除错误码:404
    删除错误码:409
  • 本页导读 (1)
文档反馈