Queries scaling rules.

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 the common request header. For more information, see Common request parameters.

Request syntax

GET /pop/v5/app/scalingRules HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
AppId String Query Yes 33e39be9-3e5f-*********

The ID of the application.

GroupId String Query Yes d8bb9d60-9**************

The ID of the instance group to which the application is deployed.

Mode String Query No SCALE_IN

The scaling rule. You can leave the parameter empty. Valid values:

  • SCALE_IN: a scale-in rule
  • SCALE_OUT: a scale-out rule

Response parameters

Parameter Type Example Description
Code Integer 200

The HTTP status code.

Data Struct

The data returned.

ClusterType Integer 2

The type of the cluster. Valid values:

  • 0: normal Docker cluster
  • 1: Swarm cluster
  • 2: Elastic Compute Service (ECS) cluster
  • 3: self-managed Kubernetes cluster in Enterprise Distributed Application Service (EDAS)
  • 4: cluster in which Pandora automatically registers applications
  • 5: Container Service for Kubernetes (ACK) cluster
OversoldFactor Integer 1

The overcommit ratio supported by a Docker cluster. Valid values:

  • 1: 1:1, which means that resources are not overcommitted.
  • 2: 1:2, which means that resources are overcommitted by 1:2.
  • 4: 1:4, which means that resources are overcommitted by 1:4.
  • 8: 1:8, which means that resources are overcommitted by 1:8.
RuleList Array of Rule

The scaling rules.

Rule
AppId String 33e39be9-3e5f-*********

The ID of the application.

Cond String OR

The condition that is required to trigger the scaling rule. Valid values:

  • OR: The scaling rule is triggered when a condition is met.
  • AND: The scaling rule is triggered when all conditions are met.
Cpu Integer 1

The minimum CPU utilization that triggers the scaling rule.

CreateTime Long 1574251601801

The time when the scaling rule was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Duration Integer 1574251601

The duration of the scaling rule. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Enable Boolean true

Scale-in or scale-out is enabled.

GroupId String d8bb9d60-91b5-4cdf-****-************

The ID of the instance group to which the application is deployed.

InstNum Integer 2

The maximum number of instances in the group for the scale-out operation, or the minimum number of instances in the group for the scale-in operation.

LoadNum Integer 1

The system load that triggers the scaling rule. The system load is evaluated based on the number of processes that are being executed by CPUs and the number processes that wait to be executed by CPUs.

MetricType String HSF

The type of the metric.

Mode String SCALE_OUT

The type of the scaling rule.

  • SCALE_IN: a scale-in rule
  • SCALE_OUT: a scale-out rule
MultiAzPolicy String PRIORITY

The policy of auto scaling across multiple zones. Valid values:

  • PRIORITY: The vSwitch that is first selected has the highest priority.
  • BALANCE: This policy evenly distributes instances across zones where the vSwitches reside.
ResourceFrom String AVAILABLE

The source of the instance to be added during a scale-out operation.

  • NEW: The new resources are used.
  • AVAILABLE: The existing resources are used.
  • AVAILABLE_FIRST The existing resources are used first.
Rt Integer 1

The service latency that triggers the scaling rule. Unit: milliseconds.

SpecId String 03f493c0-xxxx-xxxx-xxxx-12e85cadeb41

Spec ID

Step Integer 1

The number of instances that are added during each scale-out operation or removed during each scale-in operation.

TemplateId String lt-bp1xxxxn73pxxxxf83l

The ID of the launch template.

TemplateVersion Integer 1143542

The version of the launch template.

UpdateTime Long 1574251601785

The time when the launch template was modified.

VSwitchIds String vsw-mxxxxkxxxx4xxxxwbionj

The IDs of vSwitches. If more than one vSwitch is specified, separate the IDs with commas (,).

VpcId String vpc-wz9b246z******

VPC ID

UpdateTime Long 1574251601785

The time when the configuration was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

VpcId String vpc-wz9b246z******

VPC ID

Message String success

The returned message that indicates whether the request is successful.

RequestId String D16979DC-4D42-***********

The ID of the request.

UpdateTime Long 1574251601785

The time when the scaling rule was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

Examples

Sample requests

GET /pop/v5/app/scalingRules HTTP/1.1
Common request header
{
  "AppId": ""
  "GroupId": ""
}

Sample success responses

XML format

<Data>
    <RuleList>
        <Rule>
            <Step>1</Step>
            <SpecId/>
            <AppId>33e39be9-3e5f-4028-****-************</AppId>
            <MultiAzPolicy/>
            <UpdateTime>1574251601785</UpdateTime>
            <MetricType>HSF</MetricType>
            <Mode>SCALE_OUT</Mode>
            <GroupId>d8bb9d60-91b5-4cdf-****-************</GroupId>
            <VpcId/>
            <TemplateId/>
            <Rt>1</Rt>
            <ResourceFrom>AVAILABLE</ResourceFrom>
            <Cpu>1</Cpu>
            <VSwitchIds/>
            <Cond>OR</Cond>
            <InstNum>2</InstNum>
            <Enable>true</Enable>
            <CreateTime>1574251601801</CreateTime>
            <Duration>1</Duration>
            <LoadNum>1</LoadNum>
        </Rule>
    </RuleList>
    <OversoldFactor>1</OversoldFactor>
    <ClusterType>2</ClusterType>
    <VpcId>vpc-wz9b246z******</VpcId>
</Data>
<Message>success</Message>
<Code>200</Code>

JSON format

{
    "Data": {
        "RuleList": {
            "Rule": [
                {
    "Step": 1,
    "SpecId": "",
    "AppId": "33e39be9-3e5f-4028-****-************",
    "MultiAzPolicy": "",
    "UpdateTime": 1574251601785,
    "MetricType": "HSF",
    "Mode": "SCALE_OUT",
    "GroupId": "d8bb9d60-91b5-4cdf-****-************",
    "VpcId": "",
    "TemplateId": "",
    "Rt": 1,
    "ResourceFrom": "AVAILABLE",
    "Cpu": 1,
    "VSwitchIds": "",
    "Cond": "OR",
    "InstNum": 2,
    "Enable": true,
    "CreateTime": 1574251601801,
    "Duration": 1,
    "LoadNum": 1
}
            ]
        },
        "OversoldFactor": 1,
        "ClusterType": 2,
        "VpcId": "vpc-wz9b246z******"
    },
    "Message": "success",
    "Code": 200
}

Error codes

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