Diese Seite ist in Ihrer lokalen Sprache noch nicht verfügbar. Wir arbeiten daran, weitere Sprachversionen hinzuzufügen. Vielen Dank für Ihre Unterstützung.
- 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
- API Version Query
- Application Examples
- Permissions Policies and Supported Actions
- Appendix
- Change History
- SDK Reference
-
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?
- 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 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 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?
- Will ECS Instances Be Deleted If They Become 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
Show all
Creating an AS Group
This section describes how to create an AS group by calling a series of AS APIs.
The validity period of a token obtained from IAM is 24 hours. If you want to use a token for authentication, cache it to avoid frequently calling the IAM API.
Involved APIs
To use token authentication, you need to obtain a token and add X-Auth-Token to the request header of API calls.
- API for obtaining tokens from IAM
- APIs used to create an AS group
Procedure
- Obtain the token by following instructions in Authentication.
- Obtain the project ID (project_id). For details, see Obtaining a Project ID.
- Add the Content-Type key to the request header. The value of Content-Type is application/json.
- Add the X-Auth-Token key to the request header. The value is the token obtained in step 1.
- Send POST https://AS endpoint/v1/{project_id}/scaling_group. project_id is the project ID obtained in step 2.
- Specify the following parameters in the request body:
{ "scaling_group_name": "GroupNameTest",//AS group name (This is a mandatory string.) "scaling_configuration_id": "47683a91-93ee-462a-a7d7-484c006f4440",//AS configuration ID (This is an optional string, but an AS group to be enabled must have an AS configuration.) "desire_instance_number": 0,//Expected instances (This is an optional integer.) "min_instance_number": 0,//Minimum instances (This is an optional integer.) "max_instance_number": 0,//Maximum instances (This is an optional integer.) "cool_down_time": 200,//Cooldown period (This is an optional integer.) "health_periodic_audit_method": "NOVA_AUDIT",//Instance health check method (This is an optional string.) "health_periodic_audit_time": 5,//Instance health check period (This is an optional integer.) "instance_terminate_policy": "OLD_CONFIG_OLD_INSTANCE",//Instance removal policy (This is an optional string.) "vpc_id": "a8327883-6b07-4497-9c61-68d03ee193a",//VPC information (This is a mandatory string.) "networks": [ { "id": "3cd35bca-5a10-416f-8994-f79169559870" } ]//Subnet information (This is a mandatory list data structure.) }
If the request is responded, scaling_group_id is returned, indicating that the AS group is successfully created.
If the request fails, an error code and error information are returned. For details, see Error Codes.
- You can query, modify, and delete an AS group based on the obtained scaling_group_id.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.