Queries details about one or more simple application servers in a specified region.

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 ListInstances

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

RegionId String Yes cn-hangzhou

The region ID of the simple application server.

InstanceIds String No ["2ad1ae67295445f598017499dc****", "2ad1ae67295445f598017123dc****"]

The IDs of simple application servers. The value can be a JSON array that consists of up to 100 simple application server IDs. Separate the IDs with commas (,).

Note If you specify both InstanceIds and PublicIpAddresses, make sure that the specified IDs and the specified public IP addresses belong to the same simple application servers. Otherwise, an empty result is returned.
ChargeType String No PrePaid

The billing method of the simple application server. Set the value to PrePaid, which indicates the subscription billing method. Only the subscription billing method is supported.

Default value: PrePaid.

PublicIpAddresses String No ["42.1.**.**", "42.2.**.**"]

The public IP addresses of simple application servers. The value can be a JSON array that consists of up to 100 IP addresses. Separate the IP addresses with commas (,).

Note If you specify both InstanceIds and PublicIpAddresses, make sure that the specified IDs and the specified public IP addresses belong to the same simple application servers. Otherwise, an empty result is returned.
PageNumber Integer No 1

The number of the page to return.

Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Maximum value: 100.

Default value: 10.

Response parameters

Parameter Type Example Description
Instances Array of Instance

Details about the simple application servers.

BusinessStatus String Normal

The billing status of the simple application server. Valid values:

  • Normal: The billing status of the simple application server is normal.
  • Expired: The simple application server expires.
  • Overdue: A payment is overdue for the simple application server.
ChargeType String PrePaid

The billing method of the simple application server.

CreationTime String 2021-03-08T05:31:06Z

The time when the simple application server was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

DdosStatus String Normal

The DDoS protection status. Valid values:

  • Normal: Normal
  • BlackHole: Blackholing
  • Defense: Cleaning
ExpiredTime String 2021-05-08T16:00:00Z

The time when the simple application server expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

ImageId String fe9c66133a9d4688872869726b52****

The ID of the image.

InnerIpAddress String 172.26.**.**

The internal IP address of the simple application server.

InstanceId String 2ad1ae67295445f598017499dc****

The ID of the simple application server.

InstanceName String test-InstanceName

The name of the simple application server.

PlanId String swas.s2.c2m2s50b4t08

The ID of the plan.

PublicIpAddress String 42.1.**.**

The public IP address of the simple application server.

RegionId String cn-hangzhou

The region ID of the simple application server.

Status String Running

The status of the simple application server.

  • Pending: The server is being prepared.
  • Starting: The server is starting.
  • Running: The server is running.
  • Stopping: The server is being stopped.
  • Stopped: The server is stopped.
  • Resetting: The server is being reset.
  • Upgrading: The server is being upgraded.
  • Disabled: The server is unavailable.
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 1

The total number of simple application servers returned.

Examples

Sample requests

https://swas.cn-hangzhou.aliyuncs.com/?Action=ListInstances
&ChargeType=PrePaid
&<Common request parameters>

Sample success responses

XML format

<ListInstancesResponse>
      <Instances>
            <Status>Running</Status>
            <InstanceId>2ad1ae67295445f598017499dc****</InstanceId>
            <PlanId>swas.s2.c2m2s50b4t08</PlanId>
            <DdosStatus>Normal</DdosStatus>
            <BusinessStatus>Normal</BusinessStatus>
            <InstanceName>test-InstanceName</InstanceName>
            <PublicIpAddress>42.1.**.**</PublicIpAddress>
            <InnerIpAddress>172.26.**.**</InnerIpAddress>
            <ChargeType>PrePaid</ChargeType>
            <ExpiredTime>2021-05-08T16:00:00Z</ExpiredTime>
            <CreationTime>2021-03-08T05:31:06Z</CreationTime>
            <ImageId>fe9c66133a9d4688872869726b52****</ImageId>
            <RegionId>cn-hangzhou</RegionId>
      </Instances>
      <TotalCount>1</TotalCount>
      <RequestId>20758A-585D-4A41-A9B2-28DA8F4F534F</RequestId>
      <PageSize>5</PageSize>
      <PageNumber>1</PageNumber>
</ListInstancesResponse>

JSON format

{
  "Instances": [
    {
      "Status": "Running",
      "InstanceId": "2ad1ae67295445f598017499dc****",
      "PlanId": "swas.s2.c2m2s50b4t08",
      "DdosStatus": "Normal",
      "BusinessStatus": "Normal",
      "InstanceName": "test-InstanceName",
      "PublicIpAddress": "42.1.**.**",
      "InnerIpAddress": "172.26.**.**",
      "ChargeType": "PrePaid",
      "ExpiredTime": "2021-05-08T16:00:00Z",
      "CreationTime": "2021-03-08T05:31:06Z",
      "ImageId": "fe9c66133a9d4688872869726b52****",
      "RegionId": "cn-hangzhou"
    }
  ],
  "TotalCount": 1,
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F534F",
  "PageSize": 5,
  "PageNumber": 1
}

Error codes

HTTP status code Error code Error message Description
400 InvalidChargeType.ValueNotSupported The specified parameter ChargeType is invalid. The error message returned because the specified ChargeType parameter is invalid.
400 InvalidPublicIpAddresses.ValueNotSupported The specified parameter PublicIpAddresses is invalid. The error message returned because the specified PublicIpAddresses parameter is invalid.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The error message returned because the specified InstanceIds 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.

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