硅云帮助文档中心
搜索文档
热门搜索词:
产品简介
产品定价
入门指南
经典案例
快照
常见问题
知识拓展
名词解释
API参考
创建安全组规则
/ncs-server/api/v1/security/groupRule
POST
| 字段 | 类型 | 最大长度 | 参数位置 | 默认选填 | 描述 |
| groupId | string | 32 | RequestBody | 安全组id | |
| ipInfo | string | 32 | RequestBody | ipv4Cidr | |
| direction | string | 16 | RequestBody | 方向,ingress egress出口 | |
| ethertype | string | 16 | RequestBody | 目前固定传IPv4 | |
| protocol | string | 16 | RequestBody | 协议,tcp,udp,icmp,gre | |
| minPort | int | 10 | RequestBody | 选填 | 0 到65535,minPort应该小于等于maxPort,根据协议判断是否需要填 ,tcp udp需要填,gre,icmp不需要 |
| macPort | int | 10 | RequestBody | 选填 | 0 到65535,根据协议判断是否需要填,tcp udp需要填,gre,icmp不需要 |
POST /ncs-server/api/v1/security/groupRule HTTP/1.1
Content-Type: application/json
request_id: 2942183558593ffc9d75fb8e16793ff
api_key: 1706006863049654272
signature: 3b289b8f32e3e0b99720ad556ae3d67e74dd5b29888ebb332bb315e279cdd3ef
Content-Type: application/json
{
"groupId": "sg-3h63zui26a222",
"ipInfo": "192.168.0.0/16",
"direction": "ingress",
"ethertype": "IPv4",
"protocol": "tcp",
"minPort": 80,
"maxPort": 80
}{
"status": 2000,
"message": "success",
"data": {
"userAccount": "z8z87878",
"remoteId": "df1d74c1-8ab2-40f3-837f-58287b10958f",
"groupId": "sg-3h63zui26a222",
"remoteGroupeId": "6f6013bf-989c-4a8c-b7a5-c50a01d6849e",
"ruleType": "self",
"ipInfo": "192.168.0.0/16",
"direction": "ingress",
"ethertype": "IPv4",
"protocol": "tcp",
"minPort": 80,
"maxPort": 80,
"id": "1706469912063246336"
}
}实例数据结构:
| 字段 | 类型 | 描述 |
| id | string | 安全组规则id |
| userAccount | string | 用户名 |
| groupId | string | 安全组id |
| ipInfo | string | ip cidr |
| direction | string | 协议方向 |
| ethertyp | string | 以太网类型 IPv4 |
| protocol | string | 协议 |
| minPort | int | 端口左区间,没有不返回 |
| maxPort | int | 端口右区间,没有不返回 |
| createTime | long | 创建时间时间戳,精确到毫秒 |
您对该文档有什么建议?
本文导航