All Products
Search
Document Center

Auto Scaling:Creates a scaling configuration

Last Updated:Oct 23, 2023

This topic provides an example of how to call an API operation to create a scaling configuration.

Description

In this example, the following parameters are used to create a scaling configuration for a scaling group:

  • ScalingGroupId: the ID of the scaling group for which you want to create the scaling configuration.

  • InstanceType: the instance type that Auto Scaling uses to create Elastic Compute Service (ECS) instances in the scaling group.

  • SecurityGroupId: the ID of the security group with which the automatically created ECS instances are associated. ECS instances that are associated with the same security group can access each other.

  • ImageId: the ID of the image file. Auto Scaling creates ECS instances based on the image file.

For more information about the parameters, see CreateScalingConfiguration.

Sample requests

http(s)://ess.aliyuncs.com/?Action=CreateScalingConfiguration
&ScalingGroupId=asg-bp14wlu85wrpchm0****
&ImageId=centos6u5_64_20G_aliaegis****.vhd
&ImageName=image****
&InstanceType=ecs.g6.large
&SecurityGroupId=sg-280ih****
&<Common request parameters>

Sample success responses

XML format

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

<CreateScalingConfigurationResponse>
 <ScalingConfigurationId>asc-bp1ffogfdauy0nu5****</ScalingConfigurationId>
 <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</CreateScalingConfigurationResponse>

JSON format

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

{
  "ScalingConfigurationId" : "asc-bp1ffogfdauy0nu5****",
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}