Create Firewall - CreateFirewall
Overview
Create Firewall
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is CreateFirewall . | Yes |
PublicKey | string | The user’s public key can be obtained from Console | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region | Yes |
ProjectId | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. | No |
Rule.N | string | Firewall 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 64 | Yes |
Name | string | Firewall Name | Yes |
Tag | string | Firewall Business Group, default is Default | No |
Remark | string | Firewall description, default is empty | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
FWId | string | Firewall ID | No |
Example
Request Example
https://api.dezai.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
}