tencent cloud

APIs

ModifyLaunchConfigurationAttributes

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-09-10 11:57:21

1. API Description

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

This API (ModifyLaunchConfigurationAttributes) is used to modify part of a launch configuration's attributes.

This API is used to modify the startup configuration. Existing instances scaled out using this configuration will not change, while newly added instances using this launch configuration will scale out according to the new configuration.

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

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 Params. The value used for this API: ModifyLaunchConfigurationAttributes.
Version Yes String Common Params. The value used for this API: 2018-04-19.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
LaunchConfigurationId Yes String

Launch configuration ID. You can obtain it by logging in to the console or calling the DescribeLaunchConfigurations API, and retrieving LaunchConfigurationId from the returned information.

ImageId No String

Specify a valid image ID, such as img-8toqc6s3. There are four image types:

  • Public image
  • Custom image
  • Shared image
  • Service market image

  • You can obtain an available image ID in the following ways:
  • For public images, custom images, and shared images, query the image ID by logging in to the console. For service market images, query the image ID in the cloud market.
  • Call the DescribeImages API and take the ImageId field from the returned information.
  • InstanceTypes.N No Array of String

    Types of CVM instances. Different instance models specify different resource specifications, and a maximum of 10 instance models are supported.
    InstanceType specifies a single instance type. By setting InstanceTypes, you can specify multiple instance types and invalidate the original InstanceType. Specific values can be obtained by calling the API DescribeZoneInstanceConfigInfos to obtain the latest specification table or see Instance Specifications.

    InstanceTypesCheckPolicy No String

    Instance type validation policy, effective during actual modification of InstanceTypes. Valid values include ALL and ANY, default value: ANY.

  • ALL: Verification passes if all InstanceTypes are available; otherwise, a verification error will be reported.
  • ANY: Verification passes if any InstanceType is available; otherwise, a verification error will be reported.
  • Common causes of InstanceTypes unavailable include InstanceType sold out, corresponding cloud disk sold out. If a model in InstanceTypes does not exist or has been removed, a verification error will be reported regardless of the value of InstanceTypesCheckPolicy.
    LaunchConfigurationName No String

    Display name of the launch configuration. The name only supports Chinese, English, numbers, underscores, separator "-", and decimal points. The maximum length cannot exceed 60 bytes.

    UserData No String

    The custom data after Base64 encoding should not exceed 16 KB. To clear UserData, assign it an empty string.

    SecurityGroupIds.N No Array of String

    Security group to which the instance belongs. You can obtain this parameter by calling the DescribeSecurityGroups API and getting the SecurityGroupId field in the return value.
    If you specify this parameter, provide at least one security group, and the list order is sequential.

    InternetAccessible No InternetAccessible

    Public network bandwidth-related information settings.
    When the public network outbound bandwidth cap is 0 Mbps, it cannot be modified to enable assigning public IP. Accordingly, when assigning public IP is currently enabled, the modified public network outbound bandwidth cap must be greater than 0 Mbps.

    InstanceChargeType No String

    Instance billing type. Valid values:

  • POSTPAID_BY_HOUR: hourly postpaid
  • SPOTPAID: spot payment
  • PREPAID: prepaid, which is a Monthly Subscription
  • CDCPAID: dedicated cluster payment
  • InstanceChargePrepaid No InstanceChargePrepaid

    Prepaid mode, that is, parameter settings related to monthly/annual subscription. By specifying this parameter, you can set attributes such as the duration of instance purchase and whether to enable auto-renewal.
    If you change the payment mode of an instance to prepaid, this parameter is required. When changing from prepaid to other payment modes, the original info in this field is automatically discarded.
    When adding this field, you must specify the duration of instance purchase. Other fields not specified will be set to default values.
    When modifying this field, the current payment mode must be prepaid.

    InstanceMarketOptions No InstanceMarketOptionsRequest

    Market-related options of the instance, such as bidding instance parameters.
    If you change the payment mode of the instance to spot payment, this parameter is required. When changing from spot payment to other payment modes, the original info in this field is automatically discarded.
    When adding this field, you must transmit the bid price under relevant spot options. Other fields not transmitted will be set as default.
    When modifying this field, the current payment mode must be spot payment.

    DiskTypePolicy No String

    Cloud disk type selection policy. Value range:

  • ORIGINAL: use the set cloud disk type.
  • AUTOMATIC: automatically select the currently available cloud disk type.
  • SystemDisk No SystemDisk

    Instance system disk configuration information.

    DataDisks.N No Array of DataDisk

    Instance data disk configuration information.
    Supports up to 11 data disks. Apply the modification as a whole, so provide all values after modification.
    The data disk type is consistent with the system disk type by default.

    HostNameSettings No HostNameSettings

    Settings for the CVM host name.
    Configuring the host name for windows instances is not supported.
    When adding this attribute, you must transmit the CVM host name. Other fields not transmitted will be set to default values.
    The host name (with the suffix added if it exists) is verified to check whether it exceeds the maximum length of 46 characters.

    InstanceNameSettings No InstanceNameSettings

    Settings related to the CVM instance name (InstanceName).
    If the user sets this field in the launch configuration, the InstanceName of instances created by the scaling group will be set according to this field and transmitted to CVM. If the user does not set this field in the launch configuration, the InstanceName of instances created by the scaling group will be set as "as-{{ AutoScalingGroupName }}" and transmitted to CVM.
    When adding this attribute, the CVM instance name must be transmitted. Other fields not transmitted will be set to default values.
    It will verify whether the instance name (with the suffix added if it exists) exceeds the maximum length of 108 characters.

    EnhancedService No EnhancedService

    Enhanced service. This parameter can be used to specify whether to enable services such as cloud security and Cloud Monitor.

    CamRoleName No String

    CAM role name, which can be obtained from the roleName in the return value from the DescribeRoleList API.

    HpcClusterId No String

    Hyper Computing Cluster ID. This parameter is currently not supported on the international site.

    IPv6InternetAccessible No IPv6InternetAccessible

    IPv6 public network bandwidth-related information settings. If the new instance includes an IPv6 address, this parameter can allocate public network bandwidth for the IPv6 address of the new instance. When the Ipv6AddressCount parameter of the scaling group associated with the launch configuration is 0, this parameter will not take effect.

    DisasterRecoverGroupIds.N No Array of String

    Placement Group id. Only one can be specified. You can obtain this parameter by calling the DescribeDisasterRecoverGroups API.

    LoginSettings No LoginSettings

    Instance login settings, including passwords, keys, or maintaining the image's original login settings.
    Please note that specifying new login settings overwrites existing login settings. For example, if you previously used a password to login, use this parameter to change login settings to a key, and the original password is removed.

    InstanceTags.N No Array of InstanceTag

    Instance tag list. By specifying this parameter, the instances added through scale-out can be bound to the tag. Up to 10 Tags can be specified.
    This parameter overrides the original instance tag list. To add a tag, import both the new tag and the original tags.

    ImageFamily No String

    Image family name. You can obtain this parameter by calling the DescribeImages API.

    DedicatedClusterId No String

    Local exclusive cluster ID.

    Metadata No Metadata

    Custom metadata.

    NetworkInterfaces.N No Array of NetworkInterface

    Replace the ENI configuration in the launch configuration.

    Input limits: up to 17 items; must explicitly include and can only contain one PRIMARY. AS does not auto-complete the primary ENI. An explicit empty array is illegal.

    Field rules match CreateLaunchConfiguration. To clean up, call ClearLaunchConfigurationAttributes with ClearNetworkInterfaces=true.

    3. Output Parameters

    Parameter Name Type Description
    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.

    4. Example

    Example1 Specifying the Launch Configuration to Modify Images, InstanceTypes, and Names

    This example shows you how to specify the launch configuration asc-291kq6ku and modify the image to img-8toqc6s3, the InstanceType to S2.SMALL1, and the launch configuration name to updated_config.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyLaunchConfigurationAttributes
    <Common request parameters>
    
    {
        "ImageId": "img-8toqc6s3",
        "InstanceTypes": [
            "S2.SMALL1"
        ],
        "LaunchConfigurationName": "updated_config",
        "LaunchConfigurationId": "asc-291kq6ku"
    }

    Output Example

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

    Example2 Clearing UserData

    This example shows you how to specify the launch configuration asc-291kq6ku and modify UserData to a null string.

    Input Example

    POST / HTTP/1.1
    Host: as.intl.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
    InternalError.CalleeError Exceptions occurred while invoking other services.
    InvalidParameter.ActionNotFound Invalid Action request.
    InvalidParameter.Conflict Multiple parameters specified conflict and cannot co-exist.
    InvalidParameter.HostNameUnavailable The hostname parameter is unavailable to this image.
    InvalidParameter.InScenario The parameter is invalid in a specific scenario.
    InvalidParameter.InvalidCombination Invalid parameter combination.
    InvalidParameter.ParameterDeprecated This parameter has been disused.
    InvalidParameter.ParameterMustBeDeleted Some parameters cannot coexist and should be deleted.
    InvalidParameterCombination.NetworkInterfacesConflict NetworkInterfaces does not support combined use with basic network, IPv6, or spot instance billing mode.
    InvalidParameterValue Wrong parameter value.
    InvalidParameterValue.AccountNotSupportBandwidthPackageId The bandwidth package ID is not supported in this account.
    InvalidParameterValue.CvmConfigurationError Exception with CVM parameter validation.
    InvalidParameterValue.HostNameIllegal Invalid hostname
    InvalidParameterValue.HostNameWithSuffixTooLong HostNames with suffixes are too long and exceed the specified upper limit.
    InvalidParameterValue.IPv6InternetChargeType The specified IPv6 public network bandwidth billing mode is invalid.
    InvalidParameterValue.ImageNotFound The specified image does not exist.
    InvalidParameterValue.InstanceNameIllegal Invalid instance name
    InvalidParameterValue.InstanceNameWithSuffixTooLong Instance names with suffixes are too long and exceed the specified upper limit.
    InvalidParameterValue.InstanceTypeNotSupported The instance type is not supported.
    InvalidParameterValue.InvalidDisasterRecoverGroupId The format of the placement group ID is incorrect.
    InvalidParameterValue.InvalidHpcClusterId The HPC ID is invalid.
    InvalidParameterValue.InvalidImageId Invalid image ID.
    InvalidParameterValue.InvalidInstanceType Invalid instance type.
    InvalidParameterValue.InvalidLaunchConfigurationId Invalid launch configuration ID.
    InvalidParameterValue.InvalidSecurityGroupId Invalid security group ID.
    InvalidParameterValue.LaunchConfigurationNameDuplicated The launch configuration name already exists.
    InvalidParameterValue.LimitExceeded The value exceeds the limit.
    InvalidParameterValue.MissingBandwidthPackageId The bandwidth package ID is required.
    InvalidParameterValue.NetworkInterfacesInvalid Invalid Multi-NIC parameter NetworkInterfaces.
    InvalidParameterValue.NetworkInterfacesLimitExceeded The number of network interface cards in NetworkInterfaces exceeds the upper limit 17.
    InvalidParameterValue.NotStringTypeFloat The value should be a floating point string.
    InvalidParameterValue.TooLong Too many values.
    InvalidParameterValue.TooShort The value of input parameter is too short.
    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.BandwidthPackageIdNotFound The specified bandwidth package ID is not found.
    ResourceNotFound.DisasterRecoverGroupNotFound The specified placement group ID does not exist.
    ResourceNotFound.LaunchConfigurationIdNotFound The specified launch configuration does not exist.

    Ajuda e Suporte

    Esta página foi útil?

    comentários