All Products
Search
Document Center

Serverless App Engine:ListApplications

Last Updated:Sep 26, 2023

Queries a list of applications.

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 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:

  • key: the tag key. The key must be 1 to 128 characters in length.
  • value: the tag value. The value must be 1 to 128 characters in length.

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 aliyun or acs:, and cannot contain http:// or https://.

OrderBy String Query No runnings

Specifies how to sort the applications. Valid values:

  • runnings: sorts the applications by the current number of instances.
  • instances: sorts the applications by the expected number of instances.
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:

  • true: sorts the applications in ascending order. The sequence of applications is consistent with the procedure for starting an instance. In this procedure, the container is started first, the image is pulled, and then the instance is initialized. The instance enters the running state after the procedure is complete.
  • false: sorts the applications in descending order.

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:

  • appName: the application name.
  • appIds: the application ID.
  • slbIps: the IP address of the Server Load Balancer (SLB) instance associated with the application.
  • instanceIps: the IP address of the application instance.
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:

  • true: The application is being deleted.
  • false: The application is not being deleted.
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:

  • 500
  • 1000
  • 2000
  • 4000
  • 8000
  • 16000
  • 32000
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:

  • This parameter is set to 1024 if the Cpu parameter is set to 500 or 1000.
  • This parameter is set to 2048 if the Cpu parameter is set to 500, 1000, or 2000.
  • This parameter is set to 4096 if the Cpu parameter is set to 1000, 2000, or 4000.
  • This parameter is set to 8192 if the Cpu parameter is set to 2000, 4000, or 8000.
  • This parameter is set to 12288 if the Cpu parameter is set to 12000.
  • This parameter is set to 16384 if the Cpu parameter is set to 4000, 8000, or 16000.
  • This parameter is set to 24567 if the Cpu parameter is set to 12000.
  • This parameter is set to 32768 if the Cpu parameter is set to 16000.
  • This parameter is set to 65536 if the Cpu parameter is set to 8000, 16000, or 32000.
  • This parameter is set to 131072 if the Cpu parameter is set to 32000.
ErrorCode String Null

The error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.
  • If the call fails, the ErrorCode parameter is returned. For more information, see the Error codes section in this topic.
Code String 200

The HTTP status code. Valid values:

  • 2xx: The call was successful.
  • 3xx: The call was redirected.
  • 4xx: The call failed.
  • 5xx: A server error occurred.
Success Boolean true

Indicates whether the applications were obtained. Valid values:

  • true: The applications were obtained.
  • false: The applications failed to be obtained.
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.