Queries a list of applications.
Debugging
Request headers
This operation uses only common request headers and does not have operation-specific request headers. For more information, see Common request and response headers.
Request syntax
GET /pop/v1/sam/app/listApplications HTTP/1.1
Request parameters
Parameter |
Type |
Position |
Required |
Example |
Description |
CurrentPage | Integer | Query | No | 1 | The page number. |
PageSize | Integer | Query | No | 20 | The number of entries per page. Valid values: 0 to 10000. |
AppName | String | Query | No | demo-app | The name of the application. |
NamespaceId | String | Query | No | cn-beijing:demo | The namespace ID. |
Tags | String | Query | No | [{"key":"key","value":"value"}] | The key-value pair of the tag. Valid values:
Tag keys and tag values are case-sensitive. If you specify multiple tags, the system adds all the tags to the specified resources. Each tag key on a resource can have only one tag value. If you create a tag that has the same key as an existing tag, the value of the existing tag is overwritten. Tag keys and tag values cannot start with |
OrderBy | String | Query | No | runnings | Specifies how to sort the applications. Valid values:
|
Reverse | Boolean | Query | No | true | Specifies the order of applications that are sorted by the instance state. Applications with the same instance state are sorted by the instance ID. Valid values:
The following instance states are numbered: 1. Error: An error occurred during the instance startup. 2. CrashLoopBackOff: The container failed to be started. An error occurred during the startup process and the error persisted after the restart. 3. ErrImagePull: An error occurred while the container image was being pulled from the instance. 4. ImagePullBackOff: The container image failed to be obtained. 5. Pending: The instance is waiting to be scheduled. 6. Unknown: An unknown exception occurred. 7. Terminating: The instance is being terminated. 8. NotFound: The instance cannot be found. 9. PodInitializing: The instance is being initialized. 10. Init:0/1: The instance is initialized. 11. Running: The instance is running. |
FieldType | String | Query | No | appName | The dimension by which applications are filtered. Valid values:
|
FieldValue | String | Query | No | demo-app | The filter condition. You can search for applications by application name, application ID, IP address of the associated Server Load Balancer (SLB) instance, or IP address of the application instance. |
Response parameters
Parameter |
Type |
Example |
Description |
Message | String | success | The returned message. |
RequestId | String | B4D805CA-926D-41B1-8E63-7AD0C1ED**** | The request ID. |
Data | Object | The applications. |
|
CurrentPage | Integer | 1 | The page number. |
TotalSize | Integer | 2 | The total number of applications. |
PageSize | Integer | 20 | The number of entries per page. |
Applications | Array of Application | The applications. |
|
AppName | String | demo-app | The name of the application. |
NamespaceId | String | cn-beijing:demo | The namespace ID. |
AppDeletingStatus | Boolean | false | Indicates whether the application is being deleted. Valid values:
|
AppId | String | f7730764-d88f-4b9a-8d8e-cd8efbfe**** | The application ID. |
Tags | Array of Tags | The tags of the application. |
|
Key | String | key | The key of the tag. |
Value | String | value | The value of the tag. |
RunningInstances | Integer | 2 | The number of running instances. |
Instances | Integer | 2 | The number of application instances. |
RegionId | String | cn-beijing | The region ID. |
AppDescription | String | description | The description of the application. |
Cpu | Integer | 1000 | The CPU specifications that are required for each instance. Unit: millicores. This parameter cannot be set to 0. Valid values:
|
Mem | Integer | 1024 | The size of memory that is required by each instance. Unit: MB. This parameter cannot be set to 0. The values of this parameter correspond to the values of the Cpu parameter:
|
ErrorCode | String | Null | The error code. Valid values:
|
Code | String | 200 | The HTTP status code. Valid values:
|
Success | Boolean | true | Indicates whether the applications were obtained. Valid values:
|
CurrentPage | Integer | 1 | The page number. |
TotalSize | Integer | 2 | The total number of applications. |
PageSize | Integer | 20 | The number of entries per page. |
Examples
Sample requests
GET /pop/v1/sam/app/listApplications?CurrentPage=1&PageSize=20&AppName=demo-app&NamespaceId=cn-beijing:demo&Tags=[{"key":"key","value":"value"}]&OrderBy=runnings&Reverse=true&FieldType=appName&FieldValue=demo-app HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListApplicationsResponse>
<Message>success</Message>
<RequestId>B4D805CA-926D-41B1-8E63-7AD0C1ED****</RequestId>
<Data>
<CurrentPage>1</CurrentPage>
<TotalSize>2</TotalSize>
<PageSize>20</PageSize>
<Applications>
<AppName>demo-app</AppName>
<NamespaceId>cn-beijing:demo</NamespaceId>
<AppDeletingStatus>false</AppDeletingStatus>
<AppId>f7730764-d88f-4b9a-8d8e-cd8efbfe****</AppId>
<Tags>
<Key>key</Key>
<Value>value</Value>
</Tags>
<RunningInstances>2</RunningInstances>
<Instances>2</Instances>
<RegionId>cn-beijing</RegionId>
<AppDescription>description</AppDescription>
<Cpu>1000</Cpu>
<Mem>1024</Mem>
</Applications>
</Data>
<Code>200</Code>
<Success>true</Success>
<CurrentPage>1</CurrentPage>
<TotalSize>2</TotalSize>
<PageSize>20</PageSize>
</ListApplicationsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "success",
"RequestId" : "B4D805CA-926D-41B1-8E63-7AD0C1ED****",
"Data" : {
"CurrentPage" : 1,
"TotalSize" : 2,
"PageSize" : 20,
"Applications" : [ {
"AppName" : "demo-app",
"NamespaceId" : "cn-beijing:demo",
"AppDeletingStatus" : false,
"AppId" : "f7730764-d88f-4b9a-8d8e-cd8efbfe****",
"Tags" : [ {
"Key" : "key",
"Value" : "value"
} ],
"RunningInstances" : 2,
"Instances" : 2,
"RegionId" : "cn-beijing",
"AppDescription" : "description",
"Cpu" : 1000,
"Mem" : 1024
} ]
},
"Code" : "200",
"Success" : true,
"CurrentPage" : 1,
"TotalSize" : 2,
"PageSize" : 20
}
Error codes
HttpCode |
Error code |
Error message |
Description |
400 | Illegal.argument | Illegal argument | One or more parameters are invalid. |
For a list of error codes, see Service error codes.