最新活动 七周年庆典

产品

硅云帮助文档中心

搜索文档

热门搜索词:

创建安全组规则

更新时间:2020-05-21 16:36  版本:v1.0
分享到:
我要反馈 
收藏 我的收藏

简要描述:


创建安全组规则   


请求url:


/ncs-server/api/v1/security/groupRule


请求方式:


POST


请求参数:

   


字段
类型最大长度参数位置默认选填
描述
groupIdstring32RequestBody
安全组id
ipInfostring32RequestBody
ipv4Cidr
directionstring16RequestBody
方向,ingress egress出口   
ethertypestring16RequestBody
目前固定传IPv4
protocolstring16RequestBody
协议,tcp,udp,icmp,gre
minPortint10RequestBody选填0 到65535,minPort应该小于等于maxPort,根据协议判断是否需要填 ,tcp udp需要填,gre,icmp不需要
macPortint10RequestBody选填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"
    }
}


实例数据结构:


字段类型
描述
idstring安全组规则id
userAccount
string用户名
groupId
string安全组id
ipInfo
stringip cidr
direction
string协议方向
ethertyp
string以太网类型 IPv4
protocol
string协议
minPortint端口左区间,没有不返回
maxPortint端口右区间,没有不返回
createTimelong创建时间时间戳,精确到毫秒










您对该文档有什么建议?

您对该文档的评分:

本文导航

简要描述:

请求url:

请求方式:

请求参数:

请求示例:

返回示例:

搜索文档