All Products
Search
Document Center

Serverless App Engine:GetAvailabilityMetric

Last Updated:Sep 01, 2023

Queries the top N applications in which abnormal instances exist. The applications are sorted by the total number of abnormal instances.

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 does not have operation-specific request headers and uses only common request headers. For more information, see Common request and response headers.

Request syntax

GET /pop/v1/sam/getAvailabilityMetric HTTP/1.1

Request parameters

Parameter

Type

Position

Required

Example

Description

RegionId

String

Path

No

cn-hangzhou

The region ID.

Limit

Long

Path

Yes

10

The total number of entries to return. Valid values: 0 to 100.

Response parameters

Parameter

Type

Example

Description

Message

String

success

The returned message. Valid values:

  • success: If the call is successful, success is returned.

  • An error code: If the call fails, an error code is returned.

RequestId

String

3A92C4EA-4C53-5A1C-8AEB-F2DB11982D5F

The request ID.

Data

Array of AvailabilityMetricDto

The returned data.

AppId

String

017f39b8-dfa4-4e16-a84b-1dcee4b1****

The application ID.

Name

String

test

The application name.

RegionId

String

cn-hangzhou

The namespace ID.

Runnings

Long

1

The current number of instances.

Instances

Long

0

The expected number of instances.

ErrorInstances

Long

0

The number of abnormal instances.

EnableAutoscale

Long

0

Indicates whether an auto scaling policy is enabled. Valid values:

  • 1: An auto scaling policy is enabled.

  • 0: No auto scaling policy is enabled.

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.

Examples

Sample requests

GET /pop/v1/sam/getAvailabilityMetric 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

<GetAvailabilityMetricResponse>
    <Message>success</Message>
    <RequestId>3A92C4EA-4C53-5A1C-8AEB-F2DB11982D5F</RequestId>
    <Data>
        <AppId>017f39b8-dfa4-4e16-a84b-1dcee4b1****</AppId>
        <Name>test</Name>
        <RegionId>cn-hangzhou</RegionId>
        <Runnings>1</Runnings>
        <Instances>0</Instances>
        <ErrorInstances>0</ErrorInstances>
        <EnableAutoscale>0</EnableAutoscale>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</GetAvailabilityMetricResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "success",
  "RequestId" : "3A92C4EA-4C53-5A1C-8AEB-F2DB11982D5F",
  "Data" : [ {
    "AppId" : "017f39b8-dfa4-4e16-a84b-1dcee4b1****",
    "Name" : "test",
    "RegionId" : "cn-hangzhou",
    "Runnings" : 1,
    "Instances" : 0,
    "ErrorInstances" : 0,
    "EnableAutoscale" : 0
  } ],
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCode

Error code

Error message

Description

400

InvalidParameter.NotEmpty

You must specify the parameter %s.

The value of the %s parameter is invalid. This parameter cannot be left empty.

400

InvalidParameter.Obviously

The specified parameter is invalid {%s}.

The value of the {%s} parameter is invalid.

400

InvalidParameter.WithMessage

The parameter is invalid {%s}: %s

The value %s of the {%s} parameter is invalid.

For a list of error codes, see Service error codes.