ModifyLaunchConfigurationAttributes

Last updated: 2021-02-24 19:29:45

1. API Description

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

This API (ModifyLaunchConfigurationAttributes) is used to modify some attributes of a launch configuration.

  • The changes of launch configuration do not affect the existing instances. New instances will be created based on the modified configuration.
  • This API supports modifying certain simple types of attributes.

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

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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: ModifyLaunchConfigurationAttributes.
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 No 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 No Array of String List of instance types. Each type specifies different resource specifications. This list contains up to 10 instance types.
    The launch configuration uses InstanceType to indicate one single instance type and InstanceTypes to indicate multiple instance types. After InstanceTypes is successfully specified for the launch configuration, the original InstanceType will be automatically invalidated.
    InstanceTypesCheckPolicy No String Instance type verification policy which works when InstanceTypes is actually modified. 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 or the corresponding cloud disk.
    If a model in InstanceTypes does not exist or has been discontinued, a verification error will be reported regardless of the value of InstanceTypesCheckPolicy.
  • LaunchConfigurationName No 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.
    UserData No String Base64-encoded custom data of up to 16 KB. If you want to clear UserData, specify it as an empty string
    SecurityGroupIds.N No Array of String Security group to which the instance belongs. This parameter can be obtained from the SecurityGroupId field in the response of the DescribeSecurityGroups API.
    At least one security group is required for this parameter. The security group specified is sequential.
    InternetAccessible No InternetAccessible Information of the public network bandwidth configuration.
    To modify it or even its subfield, you should specify all the subfields again.
    InstanceChargeType No String Instance billing mode. Valid values:

  • POSTPAID_BY_HOUR: pay-as-you-go hourly

  • SPOTPAID: spot instance
  • InstanceChargePrepaid No InstanceChargePrepaid
    InstanceMarketOptions No InstanceMarketOptionsRequest Market-related options for instances, such as parameters related to spot instances.
    This parameter is required when changing the instance billing mode to spot instance. It will be automatically discarded after the spot instance is changed to another instance billing mode.
    To modify it or even its subfield, you should specify all the subfields again.

    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 Modifying the image, instance type and name of the specified launch configuration

    Input Example

    https://as.tencentcloudapi.com/?Action=ModifyLaunchConfigurationAttributes
    &LaunchConfigurationId=asc-291kq6ku
    &ImageId=img-8toqc6s3
    &InstanceTypes.0=S2.SMALL1
    &LaunchConfigurationName=updated_config
    &<Common Request Parameter>

    Output Example

    {
      "Response": {
        "RequestId": "07022dcb-5bba-48f0-a2b0-800ad006d031"
      }
    }

    Example2 Clearing UserData

    Input Example

    POST / HTTP/1.1
    Host: as.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyLaunchConfigurationAttributes
    <Common request parameters>
    
    {"LaunchConfigurationId": "asc-291kq6ku", "UserData": ""}

    Output Example

    {
      "Response": {
        "RequestId": "2c027f22-3a3b-489a-a77a-89c53fc15212"
      }
    }

    5. Developer Resources

    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
    AccountQualificationRestrictions The requesting account failed to pass the qualification review.
    CallCvmError CVM API call failed.
    InvalidImageId.NotFound The image was not found.
    InvalidLaunchConfigurationId.NotFound The launch configuration was not found.
    InvalidParameter.ParameterMustBeDeleted Some parameters cannot coexist and should be deleted.
    InvalidParameterValue Wrong parameter value.
    InvalidParameterValue.CvmConfigurationError Exception with CVM parameter validation.
    InvalidParameterValue.InstanceTypeNotSupported The instance type is not supported.
    InvalidParameterValue.InvalidImageId Invalid image ID.
    InvalidParameterValue.InvalidInstanceType Invalid instance type.
    InvalidParameterValue.InvalidLaunchConfigurationId Invalid launch configuration ID.
    InvalidParameterValue.LaunchConfigurationNameDuplicated The launch configuration name already exists.
    InvalidParameterValue.UserDataFormatError Incorrect UserData format.
    InvalidParameterValue.UserDataSizeExceeded The UserData is too long.
    MissingParameter Parameter missing.
    MissingParameter.InScenario A parameter is missing in a specific scenario.
    ResourceNotFound.LaunchConfigurationIdNotFound

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help