هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.
- What's New
- Function Overview
- Service Overview
- Getting Started
- User Guide
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
APIs
- AS Groups
- AS Configurations
- Instances
-
AS Policies
- Creating an AS Policy
- Creating an AS Policy (V2)
- Modifying an AS Policy
- Modifying an AS Policy (V2)
- Querying AS Policies Bound to an AS Group
- Querying AS Policies Bound to a Scaling Resource (V2)
- Querying AS Policies (V2)
- Querying an AS Policy
- Querying an AS Policy (V2)
- Executing, Enabling, or Disabling an AS Policy
- Deleting an AS Policy
- Batch Managing AS Policies
- AS Policy Execution Logs
- Scaling Action Logs
- Quotas
- Notifications
- Lifecycle Hooks
- Tags
- Planned Tasks
- API Version Query
- Application Examples
- Permissions and Supported Actions
- Appendix
- Change History
- SDK Reference
-
FAQ
-
General
- What Are Restrictions on Using AS?
- Must I Use AS Together With ELB and Cloud Eye?
- Is AS Billed?
- Will an Abrupt Change in Monitoring Metric Values Trigger an Unnecessary Scaling Action?
- How Many AS Policies and AS Configurations Can I Create and Use?
- Can AS Automatically Scale Up or Down vCPUs, Memory, and Bandwidth of ECSs?
- What Is an AS Quota?
- How Do I Fix the Error "The key pair does not exist" When I Connect to an Instance?
- What Types of EIP and Shared Bandwidths Can Be Adjusted by AS?
- What Types of ECS and HECS Instances Can Be Scaled by AS?
- If the OS of an ECS Instance in an AS Group Is Upgraded, Can AS Automatically Add Instances with the Newest OS During the Next Scale-out Action?
- Can AS Add Yearly/Monthly ECS Instances When It Scales Out an AS Group?
- Can AS Increase Bandwidths as Required?
- AS Group
-
AS Policy
- How Many AS Policies Can I Enable?
- What Are the Conditions to Trigger an Alarm-based AS Policy?
- What Is a Cooldown Period and Why Is It Required?
- Can AS Scale Capacity Based on Custom Monitoring by Cloud Eye?
- What Monitoring Metrics for an AS Group Will Be Affected If VM Tools Are Not Installed on the Instances in the Group?
- What Can I Do If an AS Policy Fails to Be Enabled?
- How Do I Install the Agent on Instances in an AS Group to Use Agent Monitoring Metrics?
-
Instance
- How Do I Prevent Instances Manually Added to an AS Group from Being Automatically Removed?
- When There Are Multiple Flavors Included in the AS Configuration of an AS Group, What Order Are the Flavors Selected in During Scale-out Events?
- When an Instance Is Removed from an AS Group and Deleted, Is the Application Data Saved?
- Can I Add Yearly/Monthly ECS Instances to an AS Group?
- Can the System Automatically Delete the Instances Added Based on an AS Policy When They Are Not Required?
- What Is the Expected Number of Instances?
- How Do I Delete an ECS Instance Created in a Scaling Action?
- Will a Yearly/Monthly ECS Instance Be Deleted If It Becomes Unhealthy?
- How Do I Handle Unhealthy Instances in an AS Group?
- Why Instances in an AS Group Keep Failing Health Checks and Getting Deleted and Recreated?
- How Do I Prevent Instances from Being Automatically Removed from an AS Group?
- Why Is an Instance that Was Removed from an AS Group and Deleted Still Displayed in the ECS List?
- Do I Need to Bind an EIP to an Instance Before I Manually Add the Instance to an AS Group?
- Can I Apply the Configurations of an Existing Instance in an AS Group to Instances to Be Added in the Future?
- Will the System Bind a New EIP or an Existing One a Newly Added ECS Instance?
-
Others
- How Can I Automatically Deploy My Application on an Instance?
- How Does Cloud-Init Affect the AS Service?
- Why Can't I Use a Key File to Log In to an ECS?
- Do I Need to Configure an EIP in an AS Configuration When a Load Balancer Has Been Enabled for an AS Group?
- How Do I Enable Automatic Initialization of EVS Disks on Instances that Have Been Added to an AS Group During Scaling Actions?
-
General
- Videos
- Glossary
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Best Practices
- Quick Start
- AS Management
-
FAQs
-
General
- What Are Restrictions on Using AS?
- Are ELB and Cloud Eye Mandatory for AS?
- Is AS Billed?
- Does an Abrupt Change on Monitoring Indicator Values Cause an Incorrect Scaling Action?
- How Many AS Policies and AS Configurations Can I Create and Use?
- Can AS Automatically Scale Up or Down vCPUs, Memory, and Bandwidth of ECSs?
- What Is the AS Quota?
- Why is a message displayed indicating that the key pair does not exist and the operation is discontinued when several users under the same account operate AS resources?
- AS Group
-
AS Policy
- How Many AS Policies Can Be Enabled?
- What Are the Conditions to Trigger an Alarm in the AS Policy?
- What Is a Cooldown Period? Why Is It Required?
- Can AS Scale Capacity Based on Custom Monitoring of Cloud Eye?
- What Will Monitoring Metrics for an AS Group Be Affected If VM Tools Are Not Installed on ECSs?
- What Can I Do If an AS Policy Fails to Be Enabled?
- How Can I Install the Agent Plug-in on the Instances in an AS Group to Use Agent Monitoring Metrics?
-
Instance
- How Do I Prevent Instances Manually Added to an AS Group from Being Removed Automatically?
- What Are the Sequence of Selecting Flavors in Multi-Flavor AS Configuration?
- Will the Application Data on an Instance Be Retained After the Instance Is Removed from an AS Group and Deleted?
- Can I Add ECSs Charged in Yearly/Monthly Mode?
- Can Instances That Have Been Added Based on an AS Policy Be Automatically Deleted When They Are Not Required?
- What Is the Expected Number of Instances?
- How Do I Delete an ECS Created in a Scaling Action?
- Will a Yearly/Monthly ECS Be Deleted When the ECS Becomes Faulty?
- How Should I Handle Abnormal Instances in an AS Group?
- What Can I Do If Instances in an AS Group Frequently Fail in Health Checks and Are Deleted and Then Created Repeatedly?
- How Do I Prevent ECSs from Being Removed from an AS Group Automatically?
- Why Is an Instance Removed and Deleted from an AS Group Still Displayed in the ECS List?
-
Others
- What Can I Do to Enable My Application to Be Automatically Deployed on an Instance?
- How Does Cloud-Init Affect the AS Service?
- How Can I Run Existing Services on an Instance Newly Added to an AS Group?
- Why Cannot I Use a Key File to Log In to an ECS?
- Do I Need to Configure an EIP in an AS Configuration When A Load Balancer Has Been Enabled in an AS Group?
- How Can I Enable Automatic Initialization of EVS Disks of Instances That Have Been Added in a Scaling Action to an AS Group?
-
General
- Change History
-
API Reference (ME-Abu Dhabi Region)
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
API
- AS Groups
- AS Configurations
- Instances in an AS Group
-
AS Policies
- Creating an AS Policy
- Creating an AS Policy (V2)
- Modifying an AS Policy
- Modifying an AS Policy (V2)
- Querying AS Policies
- Querying AS Policies (V2)
- Querying All AS Policies (V2)
- Querying AS Policy Details
- Querying Details of an AS Policy (V2)
- Executing, Enabling, or Disabling an AS Policy
- Deleting an AS Policy
- Performing Operations on AS Policies in Batches
- AS Policy Execution Logs
- Scaling Action Logs
- Quotas
- Notifications
- Lifecycle Hook
- Tag Management
- API Management
- Permissions Policies and Supported Actions
- Appendix
- Change History
-
User Guide (Paris Regions)
- Service Overview
- Best Practices
- Quick Start
- AS Management
-
FAQs
-
General
- What Are Restrictions on Using AS?
- Must I Use AS Together With ELB and Cloud Eye?
- Will an Abrupt Change in Monitoring Metric Values Trigger an Unnecessary Scaling Action?
- How Many AS Policies and AS Configurations Can I Create and Use?
- How Do I Fix the Error "The key pair does not exist" When I Connect to an Instance?
- AS Group
-
AS Policy
- How Many AS Policies Can I Enable?
- What Are the Conditions to Trigger an Alarm-based AS Policy?
- What Is a Cooldown Period and Why Is It Required?
- What Monitoring Metrics for an AS Group Will Be Affected If VM Tools Are Not Installed on the Instances in the Group?
- What Can I Do If an AS Policy Fails to Be Enabled?
-
Instance
- How Do I Prevent Instances Manually Added to an AS Group from Being Automatically Removed?
- When an Instance Is Removed from an AS Group and Deleted, Is the Application Data Saved?
- Can AS Automatically Delete Instances Added Based on an AS Policy When They Are Not Required?
- What Is the Expected Number of Instances?
- How Do I Delete an ECS Instance Created in a Scaling Action?
- How Do I Handle Unhealthy Instances in an AS Group?
- Why Instances in an AS Group Keep Failing Health Checks and Getting Deleted and Recreated?
- How Do I Prevent Instances from Being Automatically Removed from an AS Group?
- Why Is an Instance that Was Removed from an AS Group and Deleted Still Displayed in the ECS List?
-
Others
- How Can I Automatically Deploy My Application on an Instance?
- Why Can't I Use a Key File to Log In to an ECS?
- Do I Need to Configure an EIP in an AS Configuration When a Load Balancer Has Been Enabled for an AS Group?
- How Do I Enable Automatic Initialization of EVS Disks on Instances that Have Been Added to an AS Group During Scaling Actions?
-
General
- Change History
- API Reference (Paris Regions)
-
User Guide (Kuala Lumpur Region)
- Service Overview
- Best Practices
- Quick Start
- AS Management
-
FAQs
-
General
- What Are Restrictions on Using AS?
- Must I Use AS Together With ELB and Cloud Eye?
- Is AS Billed?
- Will an Abrupt Change in Monitoring Metric Values Trigger an Unnecessary Scaling Action?
- How Many AS Policies and AS Configurations Can I Create and Use?
- Can AS Automatically Scale Up or Down vCPUs, Memory, and Bandwidth of ECSs?
- What Is an AS Quota?
- How Do I Fix the Error "The key pair does not exist" When I Connect to an Instance?
- AS Group
-
AS Policy
- How Many AS Policies Can I Enable?
- What Are the Conditions to Trigger an Alarm-based AS Policy?
- What Is a Cooldown Period and Why Is It Required?
- Can AS Scale Capacity Based on Custom Monitoring by Cloud Eye?
- What Monitoring Metrics for an AS Group Will Be Affected If VM Tools Are Not Installed on the Instances in the Group?
- What Can I Do If an AS Policy Fails to Be Enabled?
- How Do I Install the Agent on Instances in an AS Group to Use Agent Monitoring Metrics?
-
Instance
- How Do I Prevent Instances Manually Added to an AS Group from Being Automatically Removed?
- When There Are Multiple Flavors Included in the AS Configuration of an AS Group, What Order Are the Flavors Selected in During Scale-out Events?
- When an Instance Is Removed from an AS Group and Deleted, Is the Application Data Saved?
- Can I Add Yearly/Monthly ECS Instances to an AS Group?
- Can the System Automatically Delete the Instances Added Based on an AS Policy When They Are Not Required?
- What Is the Expected Number of Instances?
- How Do I Delete an ECS Instance Created in a Scaling Action?
- Will a Yearly/Monthly ECS Instance Be Deleted If It Becomes Unhealthy?
- How Do I Handle Unhealthy Instances in an AS Group?
- Why Instances in an AS Group Keep Failing Health Checks and Getting Deleted and Recreated?
- How Do I Prevent Instances from Being Automatically Removed from an AS Group?
- Why Is an Instance that Was Removed from an AS Group and Deleted Still Displayed in the ECS List?
-
Others
- How Can I Automatically Deploy My Application on an Instance?
- How Does Cloud-Init Affect the AS Service?
- Why Can't I Use a Key File to Log In to an ECS?
- Do I Need to Configure an EIP in an AS Configuration When a Load Balancer Has Been Enabled for an AS Group?
- How Do I Enable Automatic Initialization of EVS Disks on Instances that Have Been Added to an AS Group During Scaling Actions?
-
General
- Change History
-
API Reference (Kuala Lumpur Region)
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
APIs
- AS Groups
- AS Configurations
- Instances in an AS Group
-
AS Policies
- Creating an AS Policy
- Creating an AS Policy (V2)
- Modifying an AS Policy
- Modifying an AS Policy (V2)
- Querying AS Policies
- Querying AS Policies (V2)
- Querying All AS Policies (V2)
- Querying AS Policy Details
- Executing, Enabling, or Disabling an AS Policy
- Deleting an AS Policy
- Performing Operations on AS Policies in Batches
- AS Policy Execution Logs
- Scaling Action Logs
- Quotas
- Notifications
- Lifecycle Hook
- Tag Management
- API Management
- Permissions Policies and Supported Actions
- Appendix
- Change History
-
User Guide (Ankara Region)
- Service Overview
- Best Practices
- Quick Start
- AS Management
-
FAQs
-
General
- What Are Restrictions on Using AS?
- Must I Use AS Together With ELB and Cloud Eye?
- Will an Abrupt Change in Monitoring Metric Values Trigger an Unnecessary Scaling Action?
- How Many AS Policies and AS Configurations Can I Create and Use?
- How Do I Fix the Error "The key pair does not exist" When I Connect to an Instance?
- AS Group
-
AS Policy
- How Many AS Policies Can I Enable?
- What Are the Conditions to Trigger an Alarm-based AS Policy?
- What Is a Cooldown Period and Why Is It Required?
- What Monitoring Metrics for an AS Group Will Be Affected If VM Tools Are Not Installed on the Instances in the Group?
- What Can I Do If an AS Policy Fails to Be Enabled?
-
Instance
- How Do I Prevent Instances Manually Added to an AS Group from Being Automatically Removed?
- When an Instance Is Removed from an AS Group and Deleted, Is the Application Data Saved?
- Can AS Automatically Delete Instances Added Based on an AS Policy When They Are Not Required?
- What Is the Expected Number of Instances?
- How Do I Delete an ECS Instance Created in a Scaling Action?
- How Do I Handle Unhealthy Instances in an AS Group?
- Why Instances in an AS Group Keep Failing Health Checks and Getting Deleted and Recreated?
- How Do I Prevent Instances from Being Automatically Removed from an AS Group?
- Why Is an Instance that Was Removed from an AS Group and Deleted Still Displayed in the ECS List?
-
Others
- How Can I Automatically Deploy My Application on an Instance?
- How Does Cloud-Init Affect the AS Service?
- Why Can't I Use a Key File to Log In to an ECS?
- Do I Need to Configure an EIP in an AS Configuration When a Load Balancer Has Been Enabled for an AS Group?
- How Do I Enable Automatic Initialization of EVS Disks on Instances that Have Been Added to an AS Group During Scaling Actions?
-
General
- Change History
-
API Reference (Ankara Region)
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
APIs
- AS Groups
- AS Configurations
- Instances
-
AS Policies
- Creating an AS Policy
- Creating an AS Policy (V2)
- Modifying an AS Policy
- Modifying an AS Policy (V2)
- Querying AS Policies Bound to an AS Group
- Querying AS Policies Bound to a Scaling Resource (V2)
- Querying AS Policies (V2)
- Querying an AS Policy
- Querying an AS Policy (V2)
- Executing, Enabling, or Disabling an AS Policy
- Deleting an AS Policy
- Batch Managing AS Policies
- AS Policy Execution Logs
- Scaling Action Logs
- Quotas
- Notifications
- Lifecycle Hooks
- API Version Query
- Permissions and Supported Actions
- Appendix
- Change History
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Show all
Copied.
Example 4: Creating an AS Policy
Scenarios
This section describes how to create an AS policy by calling APIs. For details, see Calling APIs.
An AS policy specifies a condition for triggering a scaling action. When the trigger condition is met, a scaling action occurs.
Involved APIs
Creating an AS policy involves the following APIs:
- Obtaining a User Token: Determine the user token that can be used to authenticate the calling of other APIs.
- Querying AS Groups: Determine the AS group for which the AS policy is created.
- Creating an AS Policy: Create a policy for the specified AS group.
- Querying AS Policy Details: Verify the AS policy creation.
Procedure
- Determine the user token that can be used to authenticate the calling of other APIs.
- View the user token. For details, see Obtaining a User Token.
- Obtain the value of X-Subject-Token in the response header.
- Determine the AS group.
- View AS groups.
- API
URI format: GET /autoscaling-api/v1/{project_id}/scaling_group
For details, see Querying AS Groups.
- Example request
GET: https://{Endpoint}/autoscaling-api/v1/0605767c2e80d5762fd0c0146a10aaf2/scaling_group
Obtain {endpoint} from Regions and Endpoints.
- Example response
{ "limit": 20, "scaling_groups": [ { "networks": [ { "id": "a8327883-6b07-4497-9c61-68d03ee193a", "ipv6_enable": true, "ipv6_bandwidth": { "id": "076ee2ff-f23e-4338-b8ac-1bc7278532d5" } } ], "available_zones": [ "XXXa", "XXXb" ], "detail": null, "scaling_group_name": "as-group-test", "scaling_group_id": "77a7a397-7d2f-4e79-9da9-6a35e2709150", "scaling_group_status": "INSERVICE", "scaling_configuration_id": "1d281494-6085-4579-b817-c1f813be835f", "scaling_configuration_name": "healthCheck", "current_instance_number": 0, "desire_instance_number": 1, "min_instance_number": 0, "max_instance_number": 500, "cool_down_time": 300, "lb_listener_id": "f06c0112570743b51c0e8fbe1f235bab", "security_groups": [ { "id": "8a4b1d5b-0054-419f-84b1-5c8a59ebc829" } ], "create_time": "2015-07-23T02:46:29Z", "vpc_id": "863ccae2-ee85-4d27-bc5b-3ba2a198a9e2", "health_periodic_audit_method": "ELB_AUDIT", "health_periodic_audit_time": 5, "health_periodic_audit_grace_period": 600, "instance_terminate_policy": "OLD_CONFIG_OLD_INSTANCE", "is_scaling": false, "delete_publicip": false, "enterprise_project_id": "c92b1a5d-6f20-43f2-b1b7-7ce35e58e413", "multi_az_priority_policy": "PICK_FIRST" } ], "total_number": 1, "start_number": 0 }
- API
- Select an AS group and record the AS group ID.
- View AS groups.
- Create an AS policy for the selected AS group.
- API
URI format: POST /autoscaling-api/v1/{project_id}/scaling_policy
For details, see Creating an AS Policy.
- Example request
This example shows how to create a periodic AS policy named as-policy-7a75. The policy takes effect from 2015-12-14T03:34Z through 2015-12-27T03:34Z. During this period, one instance will be added to AS group with ID 5bc3aa02-b83e-454c-aba1-4d2095c68f8b at 16:00 every day.
POST: https://{Endpoint}/autoscaling-api/v1/0605767c2e80d5762fd0c0146a10aaf2/scaling_policy
Obtain {endpoint} from Regions and Endpoints.
Body:
{ "scaling_policy_name": "as-policy-7a75", "scaling_policy_action": { "operation": "ADD", "instance_number": 1 }, "cool_down_time": 900, "scheduled_policy": { "launch_time": "16:00", "recurrence_type": "Daily", "start_time": "2015-12-14T03:34Z", "end_time": "2015-12-27T03:34Z" }, "scaling_policy_type": "RECURRENCE", "scaling_group_id": "5bc3aa02-b83e-454c-aba1-4d2095c68f8b" }
- Example response
{ "scaling_policy_id": "0h327883-324n-4dzd-9c61-68d03ee191dd" }
- API
- Verify the AS policy creation.
- API
URI format: GET /autoscaling-api/v1/{project_id}/scaling_policy/{scaling_policy_id}
For details, see Querying an AS Policy.
- Example request
This example shows how to query details about the AS policy with ID 0h327883-324n-4dzd-9c61-68d03ee191dd.
GET: https://{Endpoint}/autoscaling-api/v1/0605767c2e80d5762fd0c0146a10aaf2/scaling_policy/fd7d63ce-8f5c-443e-b9a0-bef9386b23b3
Obtain {endpoint} from Regions and Endpoints.
- Example response
{ "scaling_policy": { "scaling_policy_id": "fd7d63ce-8f5c-443e-b9a0-bef9386b23b3", "scaling_group_id": "e5d27f5c-dd76-4a61-b4bc-a67c5686719a", "scaling_policy_name": "Scheduled 1", "scaling_policy_type": "SCHEDULED", "scheduled_policy": { "launch_time": "2015-07-24T01:21Z" }, "cool_down_time": 300, "scaling_policy_action": { "operation": "REMOVE", "instance_number": 1 }, "policy_status": "INSERVICE", "create_time": "2015-07-24T01:09:30Z" } }
- API
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot