Skip to Content
私有网络 UVPC创建安全组规则 - CreateSecGroupRule

创建安全组规则 - CreateSecGroupRule

简介

定义

公共参数

参数名类型描述信息必填
Actionstring对应的 API 指令名称,当前 API 为 CreateSecGroupRuleYes
PublicKeystring用户公钥,可从 控制台 获取Yes
Signaturestring根据公钥及 API 指令生成的用户签名,参见 签名算法Yes

请求参数

参数名类型描述信息必填
Regionstring地域。 参见 地域和可用区列表Yes
ProjectIdstring项目ID。不填写为默认项目,子帐号必须填写。 请参考GetProjectList接口No
SecGroupIdstring需要添加规则的安全组资源ID。Yes
Rule.N.Directionstring”Ingress/Egress”,入站规则/出站规则Yes
Rule.N.IPRangestringIP 地址信息,逗号分隔。Yes
Rule.N.Priorityint规则优先级。范围为 1~200Yes
Rule.N.ProtocolTypestring协议类型。“TCP”,“UDP”,“ICMP”,“ICMPv6”,“ALL”Yes
Rule.N.DstPortstring目的端口。逗号分隔,如 “80,443”、“443,2000-10000”Yes
Rule.N.RuleActionstring规则行为。“Accept” 或 “Drop”Yes
Rule.N.Remarkstring规则备注Yes

响应字段

字段名类型描述信息必填
RetCodeint返回状态码,为 0 则为成功返回,非 0 为失败Yes
Actionstring操作指令名称Yes
Messagestring返回错误消息,当 RetCode 非 0 时提供详细的描述信息No
RuleIdarray[string]规则 IDYes

示例

请求示例

https://api.netlake.cn/?Action=CreateSecGroupRule &Region=cn-zj &ProjectId=ALLXrNsN &SecGroupId=sTCHnCkb &Rule.n=qJSdTFWU &Rule.n.IPRange=hfqrGIBI &Rule.n.Priority=8 &Rule.n.ProtocolType=VrzyUOTd &Rule.n.DstPort=ziuMdiRW &Rule.n.RuleAction=HMYwyODF &Rule.n.Remark=QPIwNwmO

响应示例

{ "Action": "CreateSecGroupRuleResponse", "RetCode": 0, "RuleId": [ "HTZtyZHF" ] }