UpgradeLaunchConfiguration

Last updated: 2020-03-06 20:45:44

PDF

1. API Description

Domain name for API request: as.tencentcloudapi.com.

This API (UpgradeLaunchConfiguration) is used to upgrade a launch configuration.

  • This API is used to upgrade a launch configuration in a "completely overriding" manner, i.e., it uniformly sets a new configuration according to the API parameters regardless of the original parameters. If optional fields are left empty, their default values will be used.
  • After the launch configuration is upgraded, the existing instances that have been created by it will not be changed, but new instances will be created according to the new configuration.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: as.ap-shanghai-fsi.tencentcloudapi.com

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: UpgradeLaunchConfiguration.
Version Yes String Common parameter. The value used for this API: 2018-04-19.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
LaunchConfigurationId Yes String Launch configuration ID.
ImageId Yes String Valid image ID in the format of img-8toqc6s3. There are four types of images:
  • Public images
  • Custom images
  • Shared images
  • Marketplace images

  • You can obtain the available image IDs in the following ways:
  • For public images, custom images, and shared images, log in to the console to query the image IDs; for marketplace images, query the image IDs through Cloud Marketplace.
  • This value can be obtained from the ImageId field in the return value of the DescribeImages API.
  • InstanceTypes.N Yes Array of String List of instance models. Different instance models specify different resource specifications. Up to 5 instance models can be supported.
    LaunchConfigurationName Yes String Display name of the launch configuration, which can contain Chinese characters, letters, numbers, underscores, separators ("-"), and decimal points with a maximum length of 60 bytes.
    DataDisks.N No Array of DataDisk 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.
    EnhancedService No EnhancedService Enhanced service. This parameter is used to specify whether to enable Cloud Security, Cloud Monitoring and other services. If this parameter is not specified, Cloud Monitoring and Cloud Security will be enabled by default.
    InstanceChargeType No String Instance billing type. CVM instances are POSTPAID_BY_HOUR by default.

  • POSTPAID_BY_HOUR: Pay-as-you-go on an hourly basis

  • SPOTPAID: Bidding
  • InstanceMarketOptions No InstanceMarketOptionsRequest Market-related options of the instance, such as the parameters related to stop instances. If the billing method of instance is specified as bidding, this parameter must be passed in.
    InstanceTypesCheckPolicy No String Instance type verification policy. Value range: ALL, ANY. Default value: ANY.

  • ALL: The verification will success only if all instance types (InstanceType) are available; otherwise, an error will be reported.

  • ANY: The verification will success if any instance type (InstanceType) is available; otherwise, an error will be reported.

    Common reasons why an instance type is unavailable include stock-out of the instance type and the corresponding cloud disk.
    If a model in InstanceTypes does not exist or has been deactivated, a verification error will be reported regardless of the value of InstanceTypesCheckPolicy.
  • InternetAccessible No InternetAccessible Configuration information of public network bandwidth. If this parameter is not specified, the default public network bandwidth is 0 Mbps.
    LoginSettings No LoginSettings Login settings of the instance. This parameter is used to set the login password and key for the instance, or to keep the original login settings for the image. By default, a random password is generated and sent to the user via the internal message.
    ProjectId No Integer Project ID of the instance. This parameter can be obtained from the projectId field in the returned values of DescribeProject. If this is left empty, default project is used.
    SecurityGroupIds.N No Array of String The security group of instance. 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.
    SystemDisk No SystemDisk System disk configuration of the instance. If this parameter is not specified, the default value will be assigned to it.
    UserData No String Base64-encoded custom data of up to 16 KB.
    InstanceTags.N No Array of InstanceTag List of tags. This parameter is used to bind up to 10 tags to newly added instances.
    CamRoleName No String CAM role name, which can be obtained from the roleName field in the return value of the DescribeRoleList API.
    HostNameSettings No HostNameSettings CVM HostName settings.

    3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Upgrading a Launch Configuration with Simple Parameters

    Only assign values for the required parameters (launch configuration name, instance model, and image ID) and use system default values for other parameters. The specific configuration is as follows: launch configuration name: as_test, instance model: Standard II 1C1G (S2.SMALL1), image ID: img-8toqc6s3.

    Input Example

    https://as.tencentcloudapi.com/?Action=UpgradeLaunchConfiguration
    &LaunchConfigurationId=asc-gj14vczi
    &LaunchConfigurationName=as_test
    &InstanceTypes.0=S2.SMALL1
    &ImageId=img-8toqc6s3
    &<common request parameters>

    Output Example

    {
      "Response": {
        "RequestId": "d68a3364-a933-4664-bee4-fb89b8c69b49"
      }
    }

    Example2 Upgrading a Launch Configuration with Detailed Parameters

    Launch configuration name: as_test; image ID: img-8toqc6s3; model: Standard II 1C1G (S2.SMALL1); system disk: 50 GB local disk; data disk: 100 GB HDD cloud disk; internet billing method: pay-as-you-go by traffic on an hourly basis; upper limit for internet bandwidth: 5 Mbps; IP: public IP; login method: key; Cloud Monitor and Cloud Security: installed.

    Input Example

    https://as.tencentcloudapi.com/?Action=UpgradeLaunchConfiguration
    &LaunchConfigurationId=asc-gj14vczi
    &LaunchConfigurationName=as_test
    &ImageId=img-8toqc6s3
    &InstanceTypes.0=S2.SMALL1
    &SystemDisk.DiskType=LOCAL_BASIC
    &SystemDisk.DiskSize=50
    &DataDisks.0.DiskType=CLOUD_BASIC
    &DataDisks.0.DiskSize=100
    &InternetAccessible.InternetChargeType=TRAFFIC_POSTPAID_BY_HOUR
    &InternetAccessible.InternetMaxBandwidthOut=5
    &InternetAccessible.PublicIpAssigned=TRUE
    &LoginSettings.KeyIds.0=skey-k8eypc1l
    &EnhancedService.SecurityService.Enabled=TRUE
    &EnhancedService.MonitorService.Enabled=TRUE
    &<common request parameters>

    Output Example

    {
      "Response": {
        "RequestId": "1430a2d3-eb73-44c6-8316-218c4562a85c"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    CallCvmError CVM API call failed.
    InternalError Internal error.
    InvalidImageId.NotFound The image was not found.
    InvalidParameter.Conflict Multiple parameters specified conflict and cannot co-exist.
    InvalidParameter.MustOneParameter A parameter is missing. One of the two parameters must be specified.
    InvalidParameterValue Wrong parameter value.
    InvalidParameterValue.CvmConfigurationError Exception with CVM parameter validation.
    InvalidParameterValue.CvmError Exception with CVM parameter validation.
    InvalidParameterValue.LaunchConfigurationNameDuplicated The launch configuration name already exists.
    MissingParameter Missing parameter.