as — Auto Scaling
as · 2018-04-19
CreateAutoScalingGroup
POST
Create an auto scaling group.
Wire call
Converge Cloud is RPC over HTTP. There is one path — / — and the action travels in the X-TC-Action header. The /as/CreateAutoScalingGroup path used in the OpenAPI document is a documentation convenience so each action is addressable; it is not a route on the server.
curl
curl -sS https://as.api3.convergecloud.com/ \
-H 'Authorization: TC3-HMAC-SHA256 Credential=<SecretId>/<YYYY-MM-DD>/as/tc3_request, SignedHeaders=content-type;host;x-tc-action, Signature=<sig>' \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Host: as.api3.convergecloud.com' \
-H 'X-TC-Action: CreateAutoScalingGroup' \
-H 'X-TC-Version: 2018-04-19' \
-H 'X-TC-Timestamp: <unix-seconds>' \
-H 'X-TC-Region: luzon' \
-d '{"AutoScalingGroupName":"<AutoScalingGroupName>","LaunchConfigurationId":"<LaunchConfigurationId>","MaxSize":1,"MinSize":1,"VpcId":"<VpcId>"}'Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| AutoScalingGroupName | string | Yes | Auto scaling group name, which can only contain letters, numbers, underscores, hyphens ("-"), and decimal points with a maximum length of 55 bytes and must be unique under your account. |
| LaunchConfigurationId | string | Yes | Launch configuration ID. you can obtain the launch configuration ID by logging in to the console or making an api call to DescribeLaunchConfigurations and retrieving the LaunchConfigurationId from the returned information. |
| MaxSize | integer | Yes | Maximum instance count. value range [0,2000]. to meet MaxSize >= DesiredCapacity >= MinSize. |
| MinSize | integer | Yes | Minimum number of instances. value range: [0,2000]. to meet MaxSize >= DesiredCapacity >= MinSize at the same time. |
| VpcId | string | Yes | vpc ID. a valid vpc ID can be queried by logging in to the console. you can also call the api DescribeVpc and obtain it from the VpcId field in the api response. |
| DefaultCooldown | integer | No | Default cooldown period in seconds. default value: 300. value range: [0,3600]. |
| DesiredCapacity | integer | No | The expected number of instances, in the range of [0,2000], default value equals current MinSize, and must meet MaxSize >= DesiredCapacity >= MinSize. |
| LoadBalancerIds | string[] | No | A list of classic load balancer ids with a current maximum length of 20. either LoadBalancerIds or ForwardLoadBalancers can be specified at the same time. can be obtained through the DescribeLoadBalancers api. |
| ProjectId | integer | No | Project ID of the instance within the scaling group. default value is 0, indicates usage of the default project. obtain this parameter by calling DescribeProject, `projectId` field in the return value. |
| ForwardLoadBalancers | ForwardLoadBalancer[] | No | Specifies the list of load balancers with a current maximum length of 100. either LoadBalancerIds or ForwardLoadBalancers can be specified at the same time. |
| SubnetIds | string[] | No | The subnet ID list must specify a subnet in VPC scenarios. multiple subnets are attempted sequentially based on the fill-in order as priority until successful instance creation. effective VPC subnet ids can be queried by logging in to the console or obtained from the SubnetId field in the API response by calling the DescribeSubnets API. |
| TerminationPolicies | string[] | No | Termination policy, whose maximum length is currently 1. Valid values: OLDEST_INSTANCE and NEWEST_INSTANCE. Default value: OLDEST_INSTANCE. |
| Zones | string[] | No | List of availability zones. An availability zone must be specified in the basic network scenario. If multiple availability zones are entered, their priority will be determined by the order in which they are entered, and they will be tried one by one until instances can be successfully created. |
| RetryPolicy | string | No | Retry policy. Valid values: IMMEDIATE_RETRY, INCREMENTAL_INTERVALS, and NO_RETRY. Default value: IMMEDIATE_RETRY. A partially successful scaling activity is considered a failed activity. |
| ZonesCheckPolicy | string | No | AZ verification policy. Valid values: ALL and ANY. Default value: ANY. |
| Tags | Tag[] | No | List of Tag descriptions. by specifying this parameter, you can bind tags to a scaling group and corresponding resource instances. each scaling group supports up to 30 tags. you can call the GetTags API to retrieve existing Tag key-value pairs based on the response. |
| ServiceSettings | ServiceSettings | No | Service settings such as unhealthy instance replacement. |
| Ipv6AddressCount | integer | No | The number of IPv6 addresses that an instance has. valid values: 0 and 1. default value: 0, which means the instance does not allocate an IPv6 address. use a private network that supports IPv6 and enable IPv6 CIDR in the subnet. for other usage restrictions, see IPv6 usage limits. |
| MultiZoneSubnetPolicy | string | No | Multi-AZ/multi-subnet policy, whose valid values include PRIORITY and EQUALITY, with the default value being PRIORITY. |
| HealthCheckType | string | No | Health check type for scaling group instances. Valid values: |
| LoadBalancerHealthCheckGracePeriod | integer | No | Grace period of the CLB health check during which the `IN_SERVICE` instances added will not be marked as `CLB_UNHEALTHY`. Valid range: 0-7200, in seconds. Default value: `0`. |
| InstanceAllocationPolicy | string | No | Instance assignment policy. Valid values: LAUNCH_CONFIGURATION and SPOT_MIXED. Default value: LAUNCH_CONFIGURATION. |
| SpotMixedAllocationPolicy | SpotMixedAllocationPolicy | No | Specifies how to assign pay-as-you-go instances and spot instances. |
| CapacityRebalance | boolean | No | Capacity rebalancing feature, which is applicable only to spot instances within the scaling group. Valid values: |
| InstanceNameIndexSettings | InstanceNameIndexSettings | No | Instance name sequencing settings. If this parameter is not specified, the default is not enabled. When enabled, an incremental numeric sequence will be appended to the names of instances automatically created within the scaling group. |
Response
Fields are returned inside the Response envelope. Converge Cloud answers HTTP 200 for errors as well as successes, so read Response.Error rather than the status code — and test for the presence of that object, because Code is occasionally the empty string.
| Field | Type | Description |
|---|---|---|
| AutoScalingGroupId | string | Auto scaling group ID |
| RequestId | string | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Success
{
"Response": {
"AutoScalingGroupId": …,
"RequestId": "…"
}
}Error
{
"Response": {
"Error": { "Code": "…", "Message": "…" },
"RequestId": "…"
}
}Try it
CredentialThe key never leaves this tab — it signs the request here. The signed request goes to /api-relay/as.
Request bodyvalid JSONPOST as.api3.convergecloud.com · CreateAutoScalingGroup
What failure looks like
Example error responses for this action. Match on Code.
Recorded error 1
{
"Response": {
"Error": {
"Code": "InvalidParameterValue.LaunchConfigurationNotFound",
"Message": "The specified launch configuration `asc-00000000` is not found."
},
"RequestId": "5945a183-8aa7-d110-e148-655a0cfcf851"
}
}