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 common request headers. For more information, see the topic about 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 type of scaling rule. You can leave this parameter empty. Valid values:

  • SCALE_IN: scale-in rules
  • SCALE_OUT: scale-out rules

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: regular Docker cluster
  • 1: Swarm cluster (deprecated)
  • 2: Elastic Compute Service (ECS) cluster
  • 3: self-managed Kubernetes cluster in 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 relationship among the conditions that trigger the scaling rule.

  • OR: one of the conditions
  • AND: all conditions
Cpu Integer 1

The minimum CPU utilization that triggers the scaling rule.

CreateTime Long 1574251601801

The time when the scaling rule was created.

Duration Integer 1574251601

The duration of the scaling rule.

Enable Boolean true

Indicates whether scale-ins or scale-outs are allowed.

  • true: Scale-ins or scale-outs are allowed.
  • false: Scale-ins or scale-outs are disallowed.
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 when a scale-out is performed, or the minimum number of instances in the group when a scale-in is performed.

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. Valid values:

  • NEW: Elastic 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

The ID of the specification.

Step Integer 1

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

TemplateId String lt-bp1xxxxn73pxxxxf83l

The ID of the launch template.

TemplateVersion Integer 1143542

The version of the launch template.

UpdateTime Long 1574251601785

The timestamp when the launch template was last modified.

VSwitchIds String vsw-mxxxxkxxxx4xxxxwbionj

The IDs of the vSwitches. The IDs of multiple vSwitches are separated by commas (,).

VpcId String vpc-wz9b246z******

The ID of the virtual private cloud (VPC).

UpdateTime Long 1574251601785

The timestamp when the configuration was last modified.

VpcId String vpc-wz9b246z******

The ID of the VPC.

Message String success

The returned message that indicates whether the call is successful.

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

The ID of the request.

UpdateTime Long 1574251601785

The timestamp when the scaling rule was last modified.

Examples

Sample requests

GET /pop/v5/app/scalingRules HTTP/1.1
Common request headers
{
"AppId": "33e39be9-3e5f-*********",
"GroupId": "d8bb9d60-9**************"
}

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.