All Products
Search
Document Center

:ModifyLaunchTemplateDefaultVersion

最終更新日:Dec 06, 2023

Modifies the default version of a launch template. If you do not specify a launch template version number when you create instances by calling the RunInstances operation, the default version is used.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes ModifyLaunchTemplateDefaultVersion

The operation that you want to perform. Set the value to ModifyLaunchTemplateDefaultVersion.

RegionId String Yes cn-hangzhou

The region ID of the launch template. You can call the DescribeRegions operation to query the most recent region list.

LaunchTemplateId String No lt-s-bp177juajht6****

The ID of the launch template. You must specify LaunchTemplateId or LaunchTemplateName to determine a launch template.

LaunchTemplateName String No testLaunchTemplateName

The name of the launch template. You must specify LaunchTemplateId or LaunchTemplateName to determine a launch template.

DefaultVersionNumber Long Yes 2

The default version number of the launch template.

Response parameters

Parameter

Type

Example

Description

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

LaunchTemplateId String lt-bp1apo0bbbkuy0rj****

The ID of the launch template. For more information, see DescribeLaunchTemplates.

You must specify LaunchTemplateId or LaunchTemplateName to determine a launch template.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=ModifyLaunchTemplateDefaultVersion
&DefaultVersionNumber=2
&RegionId=cn-hangzhou
&LaunchTemplateId=lt-s-bp177juajht6****
&LaunchTemplateName=testLaunchTemplateName
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyLaunchTemplateDefaultVersionResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <LaunchTemplateId>lt-bp1apo0bbbkuy0rj****</LaunchTemplateId>
</ModifyLaunchTemplateDefaultVersionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "LaunchTemplateId" : "lt-bp1apo0bbbkuy0rj****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidRegion.NotExist %s The specified region does not exist.
400 MissingParameter %s A required parameter is not specified.
400 InvalidParameter %s Invalid parameter value.
403 InnerServiceFailed %s An internal service cannot be called.
404 InvalidLaunchTemplate.NotFound %s The specified launch template is not found. Check whether the parameter value is correct.
404 InvalidLaunchTemplateVersion.NotFound %s The specified version of the launch template is not found. Check whether the parameter value is correct.

For a list of error codes, see Service error codes.