All Products
Search
Document Center

Simple Application Server:CreateFirewallRules

Last Updated:Apr 17, 2024

Creates multiple firewall rules for a simple application server at a time.

Operation description

Firewalls serve to control network access to simple application servers and isolate security domains in the cloud. By default, SSH port 22, HTTP port 80, and HTTPS port 443 are enabled for simple application servers. Other ports are disabled. You can add firewall rules to enable more ports.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the simple application server.

ace0706b2ac4454d984295a94213****
RegionIdstringYes

The region ID of the simple application server. You can call the ListRegions operation to query the most recent region list.

cn-hangzhou
ClientTokenstringNo

The client token.

123e4567-e89b-12d3-a456-426655440000
FirewallRulesobject []No

The remarks of the firewall rule.

RuleProtocolstringNo

The transport layer protocol. Valid values:

  • TCP: the TCP protocol.
  • UDP: the UDP protocol
  • TCP+UDP: the TCP and UDP protocols
TCP
PortstringNo

The port range.

3306
SourceCidrIpstringNo

The IP address or CIDR block that is allowed by the firewall rule.

47.101.XX.XX
RemarkstringNo

The remarks of the firewall rule.

TEST
Tagobject []No

The tags of the firewall rule.

KeystringNo

The key of tag N to be added to the firewall rule. Valid values of N: 1 to 20.

TestKey
ValuestringNo

The value of tag N to be added to the firewall rule. Valid values of N: 1 to 20.

TestValue

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

20758A-585D-4A41-A9B2-28DA8F4F534F
FirewallRuleIdsarray

The ID of the firewall rule.

string

The ID of the firewall rule.

1a16263ab0f541288312a15fa64280de

Examples

Sample success responses

JSONformat

{
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F534F",
  "FirewallRuleIds": [
    "1a16263ab0f541288312a15fa64280de"
  ]
}

Error codes

HTTP status codeError codeError message
400InvalidProtocol.ValueNotSupportedThe specified parameter Protocol is invalid.
400InvalidPort.ValueNotSupportedThe specified parameter Port is invalid.
400RegionIdNotMatchHostThe parameter regionId does not match the endpoint host.
403FirewallRuleLimitExceedThe maximum number of firewall rules in an instance is exceeded.
403FirewallRuleAlreadyExistThe specified Rule already exist
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.
500InternalErrorAn error occurred while processing your request.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-02-20The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Tag
Output ParametersThe response structure of the API has changed.