Docs
api
Basic Network(UNet)
CreateFirewall

Create Firewall - CreateFirewall

Overview

Create Firewall

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is CreateFirewall.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegionYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in.No
Rule.NstringFirewall rules, for example: TCP|22|192.168.1.1/22|DROP|LOW|Disable port 22, the first parameter represents the protocol, the second parameter represents the port number, the third parameter is the IP, the fourth parameter is ACCEPT (accept) and DROP (reject), the fifth parameter is the priority: HIGH (high), MEDIUM (medium), LOW (low), the sixth parameter is the custom note for this rule, bj1 does not support adding notes, the maximum length of the note is 64Yes
NamestringFirewall NameYes
TagstringFirewall Business Group, default is DefaultNo
RemarkstringFirewall description, default is emptyNo

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
FWIdstringFirewall IDNo

Example

Request Example

https://api.ucloud-global.com/?Action=CreateFirewall
&ProjectId=org-XXXX
&Region=cn-north
&Name=NewFirewall
&Tag=Default
&Rule.0=UDP|53|0.0.0.0/0|ACCEPT|HIGH|Notes
&Rule.1=TCP|0-56636|0.0.0.0/0|ACCEPT|HIGH|Notes
&Rule.2=TCP|3306|0.0.0.0/0|DROP|HIGH|Notes

Response Example

{
  "Action": "CreateFirewallResponse",
  "FWId": "dzPBwJgP",
  "RetCode": 0
}