Resource Center/Network Service/Network Service Operations/VPC Firewall Operations
POSTVPC Firewall OperationsSince 4.0.0SynchronousAuth Required
CreateFirewallRuleTemplate
CreateFirewallRuleTemplate
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
actionStringRequired动作名称。
protocolStringOptional.
nameStringRequiredThe name of the template.
destPortStringOptional.
sourcePortStringOptional.
sourceIpStringOptional.
destIpStringOptional.
allowStatesStringOptional.
tcpFlagStringOptional.
icmpTypeNameStringOptional.
ruleNumberIntegerRequired规则数量。
enableLogbooleanOptional.
stateStringOptional.
descriptionStringOptional. The detailed description of the template.
resourceUuidStringOptional. The UUID of the template.
tagUuidsListOptional. The user tags.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/vpcfirewalls/rules/template
/zstack/v1/vpcfirewalls/rules/template
Request Example
curl -X POST 'http://{host}/zstack/v1/vpcfirewalls/rules/template' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"action":"<action>","protocol":"<protocol>","name":"<name>","destPort":"<destPort>","sourcePort":"<sourcePort>","sourceIp":"<sourceIp>","destIp":"<destIp>","allowStates":"<allowStates>","tcpFlag":"<tcpFlag>","icmpTypeName":"<icmpTypeName>","ruleNumber":1,"enableLog":true,"state":"<state>","description":"<description>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "action": "accept", "protocol": "TCP", "destPort": "22", "sourcePort": "22", "sourceIp": "192.168.1.2", "destIp": "192.168.1.1", "allowStates": "invalid,new", "tcpFlag": "SYN", "icmpTypeName": "echo-reply", "ruleNumber": 1001.0, "enableLog": false, "state": "disable", "isDefault": false, "description": "example rule des" } }Change History
This API has no change history records yet.
