Docs
api
Basic Network(UNet)
UpdateFirewall

Update Firewall Rules - UpdateFirewall

Overview

Update Firewall Rules

ℹ️ When updating firewall rules, the new rules will overwrite the original rules. Therefore, if you need to change or add new rules, you need to submit all original rules together with the new rules.

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is UpdateFirewall.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 List of Regions and Availability ZonesYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
FWIdstringFirewall Resource IDYes
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, the maximum length of the note is 64.Yes

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.dezai.com/?Action=UpdateFirewall
&ProjectId=org-xxx
&Region=xxxx
&FWId=fw-xxxx
&Rule.1=UDP|53|0.0.0.0/0|ACCEPT|HIGH|Notes
&Rule.0=TCP|3306|0.0.0.0/0|DROP|HIGH|Notes

Response Example

{
  "Action": "UpdateFirewallResponse",
  "FWId": "firewall-xxx",
  "RetCode": 0
}