为网络型负载均衡实例绑定已创建的安全组。
接口说明
请确保您已创建安全组。创建安全组,请参见 CreateSecurityGroup 。
一个网络型负载均衡实例最多支持加入 4 个安全组。
您可以通过 GetLoadBalancerAttribute 接口查询实例绑定的安全组。
- LoadBalancerJoinSecurityGroup 属于异步接口,即系统返回一个请求 ID,但该网络型负载均衡实例绑定安全组尚未成功,系统后台的绑定任务仍在进行。您可以调用 GetJobStatus 查询安全组的绑定状态:
当任务状态处于 Succeeded 时,表示安全组绑定成功。
当任务状态处于 Processing 时,表示安全组正在绑定中,在该状态下,您只能执行查询操作,不能执行其他操作。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
nlb:LoadBalancerJoinSecurityGroup |
update |
*LoadBalancer
*SecurityGroup
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| SecurityGroupIds |
array |
是 |
安全组 ID。 |
|
|
string |
否 |
安全组 ID。 |
sg-bp1fg655nh68xyz9**** |
|
| LoadBalancerId |
string |
是 |
待绑定安全组的网络型负载均衡实例 ID。 |
nlb-83ckzc8d4xlp8o**** |
| DryRun |
boolean |
否 |
是否只预检此次请求。取值:
|
true |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
123e4567-e89b-12d3-a456-426655440000 |
| RegionId |
string |
否 |
网络型负载均衡实例所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-hangzhou |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
为 NLB 实例绑定已创建的安全组。 |
||
| RequestId |
string |
请求 ID。 |
CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
| JobId |
string |
异步任务 ID。 |
72dcd26b-f12d-4c27-b3af-18f6aed5**** |
示例
正常返回示例
JSON格式
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
"JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | SystemBusy | System is busy, please try again later. | 系统繁忙,请稍后重试 |
| 400 | QuotaExceeded.QuotaInsufficient | The quota of %s is exceeded, usage %s/%s. | 配额不足,已使用%s/%s。请在配额中心中修改配额大小。 |
| 400 | Conflict.SecurityGroup | The SecurityGroup [%s] is conflict. | 指定的资源当前存在锁冲突。 |
| 400 | Mismatch.%s | The %s is mismatched for %s and %s. | 对于资源对象%s和%s,参数%s缺失 |
| 400 | OperationDenied.%s | The operation is not allowed because of %s. | 因为%s,当前操作是不允许的 |
| 400 | TagInvokeError | listTagsByResourceIds: InvalidResourceId.NotFound : The specified ResourceIds are not found in our records. | 在资源标签中找不到资源定义,请检查RAM是否给NLB添加授权。 |
| 400 | Conflict.Lock | The Lock [%s] is conflict. | 指定的资源当前存在锁冲突。 |
| 400 | Mismatch.vpc | The Vpc is mismatched for %s and %s. | 资源%s和资源%s的VPC不匹配。请检查两种资源是否在同一个VPC下。 |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | dryRun请求验证已通过。 |
| 400 | ResourceInCreating.loadbalancer | The specified resource of loadbalancer is creating, please try again later. | 正在创建指定的负载均衡器资源,请稍后重试。 |
| 400 | ResourceInConfiguring.loadbalancer | The specified resource of loadbalancer is being configured, please try again later. | 正在配置指定的负载均衡资源,请稍后重试。 |
| 403 | Forbidden.NoPermission | Authentication is failed for NoPermission. | 因为账号没有权限,所以鉴权失败。 |
| 403 | Forbidden.SecurityGroup | Authentication is failed for SecurityGroup. | 因为安全组没有权限,所以鉴权失败。 |
| 404 | ResourceNotFound.loadBalancer | The specified resource of loadbalancer is not found. | 找不到指定的负载均衡器资源,请检查输入参数。 |
| 404 | ResourceNotFound.SecurityGroup | The specified resource of SecurityGroup is not found. | 找不到指定的安全组资源,请检查输入参数。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。