全部产品
Search
文档中心

边缘节点服务ENS:JoinSecurityGroup - 加入安全组

更新时间:Aug 27, 2026

调用JoinSecurityGroup将一台ENS实例加入到指定的安全组。

接口说明

调用该接口时,您需要注意:加入安全组之前,实例必须处于已停止(Stopped)或者运行中(Running)状态。

调试

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

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ens:JoinSecurityGroup

update

*全部资源

*

无 无

请求参数

名称

类型

必填

描述

示例值

SecurityGroupId

string

是

安全组 ID。

sg-bp67acfmxazb4ph***

InstanceId

string

否

实例 ID。

i-bp67acfmxazb4ph***

NetworkInterfaceId

string

否

弹性网卡 ID。

eni-58z57orgmt6d1****

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

示例

正常返回示例

JSON格式

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

错误码

HTTP status code

错误码

错误信息

描述

400 MissingParameter The input parameter that is mandatory for processing this request is not supplied.
400 NoPermission Permission denied.
400 CallInterface Call Interface Happen Error. 接口调用出错。
400 InvalidParameter.%s The specified field %s invalid. Please check it again.
400 InvalidParameter The errorMessage is %s. Please check it again.
400 InvalidSecurityGroupId.NotFound The specified SecurityGroupId does not exist. 指定的安全组ID不存在。
400 SecurityGroupRuleConflict.Duplicated The SecurityGroup rule already exists. 安全组规则重复。
400 AuthorizationLimitExceed The limit of authorization records in the security group reaches. 安全组规则数量超出限额。
400 SecurityGroupRule.NotFound The input security group rule does not exist.
400 IncorrectInstanceStatus The current status of the resource does not support this operation. 当前操作不被支持,磁盘正在重置中。
400 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定实例不存在
400 ens.interface.error An error occurred while calling the API.
400 RegionNotSupport The specified InstanceId of regionId does not support SecurityGroup
400 InstanceAlreadyBound The instance is already bound to a SecurityGroup.

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

变更历史

更多信息,参考变更详情。