Queries the firewall rules of a simple application server.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListFirewallRules

The operation that you want to perform. Set the value to ListFirewallRules.

RegionId String Yes cn-hangzhou

The region ID of the simple application server.

InstanceId String Yes ace0706b2ac4454d984295a94213****

The ID of the simple application server.

PageSize Integer No 10

The number of entries to return on each page.

Maximum value: 100.

Default value: 10.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1.

Default value: 1.

Response parameters

Parameter Type Example Description
FirewallRules Array of FirewallRule

Details about the firewall rules.

Port String 3306

The port range.

Remark String test-default port of the MySQL server

The remarks of the firewall rule.

RuleId String eeea34d9867b4d55a4ff8d5fcfbd****

The ID of the firewall rule.

RuleProtocol String TCP

The transport layer protocol. Valid values:

  • TCP
  • UDP
  • TCP+UDP
PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String 20758A-585D-4A41-A9B2-28DA8F4F534F

The ID of the request.

TotalCount Integer 4

The total number of firewall rules.

Examples

Sample requests

https://swas.cn-hangzhou.aliyuncs.com/?Action=ListFirewallRules
&InstanceId=ace0706b2ac4454d984295a94213****
&<Common request parameters>

Sample success responses

XML format

<ListFirewallRulesResponse>
      <TotalCount>4</TotalCount>
      <RequestId>20758A-585D-4A41-A9B2-28DA8F4F534F</RequestId>
      <PageSize>10</PageSize>
      <PageNumber>1</PageNumber>
      <FirewallRules>
            <RuleId>d7e1b0a8e93a4f6db07528c4f4f7****</RuleId>
            <Port>80</Port>
            <RuleProtocol>TCP</RuleProtocol>
      </FirewallRules>
      <FirewallRules>
            <RuleId>8e351c1efcbe4265918ea0098061****</RuleId>
            <Port>443</Port>
            <RuleProtocol>TCP</RuleProtocol>
      </FirewallRules>
      <FirewallRules>
            <RuleId>fe2459c7060b4adc90bd996bad9a****</RuleId>
            <Port>22</Port>
            <RuleProtocol>TCP</RuleProtocol>
      </FirewallRules>
      <FirewallRules>
            <RuleId>eeea34d9867b4d55a4ff8d5fcfbd****</RuleId>
            <Port>3306</Port>
            <RuleProtocol>TCP</RuleProtocol>
            <Remark>test-default port of the MySQL server</Remark>
      </FirewallRules>
</ListFirewallRulesResponse>

JSON format

{
  "TotalCount": 4,
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F534F",
  "PageSize": 10,
  "PageNumber": 1,
  "FirewallRules": [
    {
      "RuleId": "d7e1b0a8e93a4f6db07528c4f4f7****",
      "Port": "80",
      "RuleProtocol": "TCP"
    },
    {
      "RuleId": "8e351c1efcbe4265918ea0098061****",
      "Port": "443",
      "RuleProtocol": "TCP"
    },
    {
      "RuleId": "fe2459c7060b4adc90bd996bad9a****",
      "Port": "22",
      "RuleProtocol": "TCP"
    },
    {
      "RuleId": "eeea34d9867b4d55a4ff8d5fcfbd****",
      "Port": "3306",
      "RuleProtocol": "TCP",
      "Remark": "test-default port of the MySQL server"
    }
  ]
}

Error codes

HTTP status code Error code Error message Description
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The error message returned because the specified InstanceId parameter does not exist.
500 InternalError An error occurred while processing your request. The error message returned because an internal error has occurred. Try again later. If the error persists, submit a ticket.
403 InvalidParam The specified parameter value is invalid. The error message returned because a specified parameter is invalid.

For a list of error codes, visit the API Error Center.