as — Auto Scaling
as · 2018-04-19
CreateLaunchConfiguration
POST
Create new launch configuration.
Wire call
Converge Cloud is RPC over HTTP. There is one path — / — and the action travels in the X-TC-Action header. The /as/CreateLaunchConfiguration 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: CreateLaunchConfiguration' \
-H 'X-TC-Version: 2018-04-19' \
-H 'X-TC-Timestamp: <unix-seconds>' \
-H 'X-TC-Region: luzon' \
-d '{"LaunchConfigurationName":"<LaunchConfigurationName>","ImageId":"<ImageId>"}'Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| LaunchConfigurationName | string | Yes | Display name of the launch configuration, which can contain letters, digits, underscores and hyphens (-), and dots. Up to of 60 bytes allowed.. |
| ImageId | string | Yes | Image ID in the format of `img-xxx`. There are three types of images: Public images Custom images Shared images You can obtain the image IDs in the CVM console. You can also use the DescribeImages and look for `ImageId` in the response. |
| ProjectId | integer | No | Project ID of the launch configuration. default value is 0, indicating usage of the default project. obtain this parameter by calling the projectId field in the return value of DescribeProject. |
| InstanceType | string | No | Instance model. Different instance models specify different resource specifications. The specific value can be obtained by calling the DescribeInstanceTypeConfigs API to get the latest specification table or referring to the descriptions in Instance Types. |
| SystemDisk | SystemDisk | No | System disk configuration of the instance. If this parameter is not specified, the default value will be used. |
| DataDisks | DataDisk[] | No | Information of the instance's data disk configuration. If this parameter is not specified, no data disk is purchased by default. Up to 11 data disks can be supported. |
| InternetAccessible | InternetAccessible | No | Configuration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default. |
| LoginSettings | LoginSettings | No | Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center. |
| SecurityGroupIds | string[] | No | The security group to which the instance belongs. This parameter can be obtained by calling the `SecurityGroupId` field in the returned value of DescribeSecurityGroups. If this parameter is not specified, no security group will be bound by default. |
| EnhancedService | EnhancedService | No | Enhanced services. You can use this parameter to specify whether to enable services such as Cloud Security and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Cloud Security will be enabled by default. |
| UserData | string | No | Base64-encoded custom data of up to 16 KB. |
| InstanceChargeType | string | No | Instance billing mode. CVM instances take `POSTPAID_BY_HOUR` by default. Valid values: |
| InstanceMarketOptions | InstanceMarketOptionsRequest | No | Market options of the instance, such as parameters related to spot instances. This parameter is required for spot instances. |
| InstanceTypes | string[] | No | Instance model list. different instance models specify different resource specifications. supports up to 10 instance models. |
| CamRoleName | string | No | CAM role name. you can obtain it from the roleName in the return value from the API DescribeRoleList. |
| InstanceTypesCheckPolicy | string | No | Instance type validation policy. valid values include ALL and ANY. default value: ANY. this parameter is valid only when the InstanceTypes parameter contains multiple instance types. |
| InstanceTags | InstanceTag[] | No | List of tags. This parameter is used to bind up to 10 tags to newly added instances. |
| Tags | Tag[] | No | List of tags. You can specify tags that you want to bind to the launch configuration. Each launch configuration can have up to 30 tags. |
| HostNameSettings | HostNameSettings | No | CVM hostname settings. |
| InstanceNameSettings | InstanceNameSettings | No | Settings of CVM instance names |
| InstanceChargePrepaid | InstanceChargePrepaid | No | Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the `InstanceChargeType` is `PREPAID`. |
| DiskTypePolicy | string | No | Cloud disk type selection policy, whose default value is ORIGINAL. Valid values: |
| HpcClusterId | string | No | High-Performance computing cluster ID. you can obtain this parameter by calling the DescribeHpcClusters api. |
| IPv6InternetAccessible | IPv6InternetAccessible | No | IPv6 public network bandwidth configuration. If the IPv6 address is available in the new instance, public network bandwidth can be allocated to the IPv6 address. This parameter is invalid if `Ipv6AddressCount` of the scaling group associated with the launch configuration is 0. |
| DisasterRecoverGroupIds | string[] | No | Placement group ID. Only one is allowed. |
| ImageFamily | string | No | Image family name. one and only one must be filled in between image Id and image family name. this parameter can be obtained by calling the DescribeImages api. |
| DedicatedClusterId | string | No | Local exclusive cluster ID. this parameter can be obtained through the DescribeDedicatedClusters api. |
| Metadata | Metadata | No | Custom metadata. |
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 |
|---|---|---|
| LaunchConfigurationId | string | This parameter is returned when a launch configuration is created through this API, indicating the launch configuration 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": {
"LaunchConfigurationId": …,
"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 · CreateLaunchConfiguration
What failure looks like
Example error responses for this action. Match on Code.
Recorded error 1
{
"Response": {
"Error": {
"Code": "MissingParameter",
"Message": "The request is missing a required parameter `DiskType`."
},
"RequestId": "64d7aca9-9ce9-979e-96b1-b49d70b0e779"
}
}