Skip to Content
Private Network(UVPC)CreateSecGroupRule

Create Security Group Rule - CreateSecGroupRule

Overview

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateSecGroupRule.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See Region and Availability Zone ListYes
ProjectIdstringProject ID. Leave blank for the default project; sub-accounts must fill in. Please refer to the GetProjectList APINo
SecGroupIdstringSecurity group resource ID that needs to add rules.Yes
Rule.N.DirectionstringIngress/Egress, Inbound Rules/Outbound RulesYes
Rule.N.IPRangestringIP address information, comma-separated.Yes
Rule.N.PriorityintRule Priority. Range in [1,200]Yes
Rule.N.ProtocolTypestringProtocol Type. “TCP”, “UDP”, “ICMP”, “ICMPv6”, “ALLYes
Rule.N.DstPortstringDestination port. Comma separated, such as “80,443”, “443,2000-10000Yes
Rule.N.RuleActionstringAction of rule. “Accept” or “Drop”Yes
Rule.N.RemarkstringRemark of ruleYes

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
RuleIdarray[string]Rule IDYes

Example

Request Example

https://api.dezai.com/?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

Response Example

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