Queries the information about simple application servers in a region.
Operation description
You can call this operation to query the details of simple application servers in a specified region, including the names, public IP addresses, internal IP addresses, creation time, and expiration time of the servers.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
swas-open:ListInstances | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the simple application servers. | cn-hangzhou |
InstanceIds | string | No | The IDs of the simple application servers. The value can be a JSON array that consists of up to 100 simple application server IDs. Separate multiple server 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.
| ["2ad1ae67295445f598017499dc****", "2ad1ae67295445f598017123dc****"] |
ChargeType | string | No | The billing method of the simple application servers. Set the value to PrePaid, which indicates the subscription billing method. Default value: PrePaid. | PrePaid |
PublicIpAddresses | string | No | The public IP addresses of the simple application servers. The value can be a JSON array that consists of up to 100 IP addresses. Separate multiple 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.
| ["42.1.**.**", "42.2.**.**"] |
PageNumber | integer | No | The page number. Default value: 1. | 1 |
PageSize | integer | No | The number of entries per page. Maximum value: 100. Default value: 10. | 10 |
Status | string | No | The status of the simple application servers. Valid values:
| Running |
Tag | array<object> | No | The tags that are added to the simple application servers. | |
object | No | The tag to add to the resource. | ||
Key | string | No | The tag key of the simple application servers. A tag key can be 1 to 64 characters in length. Valid values of N: 1 to 20. | test |
Value | string | No | The tag value of the simple application servers. A tag value can be 1 to 64 characters in length. Valid values of N: 1 to 20. | 01 |
ResourceGroupId | string | No | The ID of the resource group to which the simple application servers belong. | rg-aek2bti7cf7**** |
InstanceName | string | No | The name of the simple application server. Fuzzy search with the asterisk (*) wildcard is supported. | test |
Response parameters
Examples
Sample success responses
JSON
format
{
"Instances": [
{
"Status": "Running",
"CreationTime": "2021-03-08T05:31:06Z",
"InnerIpAddress": "172.26.XX.XX",
"ChargeType": "PrePaid",
"InstanceId": "2ad1ae67295445f598017499dc****",
"PlanId": "swas.s2.c2m2s50b4t08",
"PublicIpAddress": "42.1.XX.XX",
"RegionId": "cn-hangzhou",
"ExpiredTime": "2021-05-08T16:00:00Z",
"InstanceName": "test-InstanceName",
"BusinessStatus": "Normal",
"DdosStatus": "Normal",
"ImageId": "fe9c66133a9d4688872869726b52****",
"DisableReason": "EXPIRED",
"Combination": false,
"CombinationInstanceId": "com-f6c9a22****45b5b8de68ad608af1ba",
"Uuid": "41f30524-5df7-49c9-9c6e-32****489001",
"ResourceSpec": {
"DiskCategory": "cloud_efficiency",
"Cpu": 2,
"Bandwidth": 5,
"DiskSize": 60,
"Memory": 2,
"Flow": 818
},
"Image": {
"OsType": "windows",
"ImageName": "test-custom-1686536882356",
"ImageVersion": "V3.5",
"ImageType": "system",
"ImageIconUrl": "https://img.alicdn.com/imgextra/i3/O****1vdh9651ReKqWNMI2I_!!6000000002136****-24-24.svg",
"ImageContact": "https://selfs****e.console.aliyun.com/ticket/createIndex"
},
"Tags": [
{
"Key": "TestKey",
"Value": "TestValue"
}
],
"Disks": [
{
"CreationTime": "2023-02-24T02:20:10Z",
"Status": "In_use",
"Device": "/dev/xvda",
"Size": 50,
"DiskName": "SystemDisk",
"DiskChargeType": "PrePaid",
"DiskType": "System",
"Category": "ESSD",
"DiskId": "d-bp14wq0149cpp2x****",
"RegionId": "cn-hangzhou",
"Remark": "remark",
"DiskTags": [
{
"Key": "TestKey",
"Value": "TestValue"
}
],
"ResourceGroupId": "rg-aek2bti7cf7****\n"
}
],
"ResourceGroupId": "rg-aekz7jmhg5s****"
}
],
"TotalCount": 1,
"RequestId": "20758A-585D-4A41-A9B2-28DA8F4F****",
"PageSize": 10,
"PageNumber": 1
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidChargeType.ValueNotSupported | The specified parameter ChargeType is invalid. |
400 | InvalidPublicIpAddresses.ValueNotSupported | The specified parameter PublicIpAddresses is invalid. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. |
500 | InternalError | An error occurred while processing your request. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-17 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-05-29 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2024-02-20 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-01-17 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-09-18 | API Description Update. The Error code has changed | View Change Details |
2023-07-19 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-05-25 | The Error code has changed. The response structure of the API has changed | View Change Details |