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

FieldTypeRequiredDescription
LaunchConfigurationNamestringYesDisplay name of the launch configuration, which can contain letters, digits, underscores and hyphens (-), and dots. Up to of 60 bytes allowed..
ImageIdstringYesImage 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.
ProjectIdintegerNoProject 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.
InstanceTypestringNoInstance 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.
SystemDiskSystemDiskNoSystem disk configuration of the instance. If this parameter is not specified, the default value will be used.
DataDisksDataDisk[]NoInformation 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.
InternetAccessibleInternetAccessibleNoConfiguration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default.
LoginSettingsLoginSettingsNoLogin 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.
SecurityGroupIdsstring[]NoThe 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.
EnhancedServiceEnhancedServiceNoEnhanced 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.
UserDatastringNoBase64-encoded custom data of up to 16 KB.
InstanceChargeTypestringNoInstance billing mode. CVM instances take `POSTPAID_BY_HOUR` by default. Valid values:
InstanceMarketOptionsInstanceMarketOptionsRequestNoMarket options of the instance, such as parameters related to spot instances. This parameter is required for spot instances.
InstanceTypesstring[]NoInstance model list. different instance models specify different resource specifications. supports up to 10 instance models.
CamRoleNamestringNoCAM role name. you can obtain it from the roleName in the return value from the API DescribeRoleList.
InstanceTypesCheckPolicystringNoInstance 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.
InstanceTagsInstanceTag[]NoList of tags. This parameter is used to bind up to 10 tags to newly added instances.
TagsTag[]NoList of tags. You can specify tags that you want to bind to the launch configuration. Each launch configuration can have up to 30 tags.
HostNameSettingsHostNameSettingsNoCVM hostname settings.
InstanceNameSettingsInstanceNameSettingsNoSettings of CVM instance names
InstanceChargePrepaidInstanceChargePrepaidNoDetails of the monthly subscription, including the purchase period, auto-renewal. It is required if the `InstanceChargeType` is `PREPAID`.
DiskTypePolicystringNoCloud disk type selection policy, whose default value is ORIGINAL. Valid values:
HpcClusterIdstringNoHigh-Performance computing cluster ID. you can obtain this parameter by calling the DescribeHpcClusters api.
IPv6InternetAccessibleIPv6InternetAccessibleNoIPv6 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.
DisasterRecoverGroupIdsstring[]NoPlacement group ID. Only one is allowed.
ImageFamilystringNoImage 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.
DedicatedClusterIdstringNoLocal exclusive cluster ID. this parameter can be obtained through the DescribeDedicatedClusters api.
MetadataMetadataNoCustom 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.

FieldTypeDescription
LaunchConfigurationIdstringThis parameter is returned when a launch configuration is created through this API, indicating the launch configuration ID.
RequestIdstringThe 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"
  }
}