Deletes the versions of a launch template. This operation cannot delete the default version of a launch template. To delete the default version, you must call the DeleteLaunchTemplate operation to delete the launch template and all of its versions.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DeleteLaunchTemplateVersion | The operation that you want to perform. Set the value to DeleteLaunchTemplateVersion. |
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. |
DeleteVersion.N | Long | No | 2 | The version number of the launch template. Valid values of N: 1 to 29. You can call the DescribeLaunchTemplateVersions operation to query all versions of a launch template. |
LaunchTemplateId | String | No | lt-bp1apo0bbbkuy0rj**** | The ID of the launch template. For more information, see DescribeLaunchTemplates. |
LaunchTemplateName | String | No | testLaunchTemplateName | The name of the launch template. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
LaunchTemplateVersions | Array of LaunchTemplateVersion | The deleted launch template versions. | |
LaunchTemplateVersion | |||
LaunchTemplateId | String | lt-bp1apo0bbbkuy0rj**** | The ID of the launch template. |
LaunchTemplateVersionNumber | Long | 2 | The version number of the launch template. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=DeleteLaunchTemplateVersion
&DeleteVersion.1=2
&RegionId=cn-hangzhou
&LaunchTemplateId=lt-bp1apo0bbbkuy0rj****
&LaunchTemplateName=testLaunchTemplateName
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DeleteLaunchTemplateVersionResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<LaunchTemplateVersions>
<LaunchTemplateId>lt-bp1apo0bbbkuy0rj****</LaunchTemplateId>
<LaunchTemplateVersionNumber>2</LaunchTemplateVersionNumber>
</LaunchTemplateVersions>
</DeleteLaunchTemplateVersionResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"LaunchTemplateVersions" : [ {
"LaunchTemplateId" : "lt-bp1apo0bbbkuy0rj****",
"LaunchTemplateVersionNumber" : 2
} ]
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidRegion.NotExist | %s | Thee specified region is not found. |
400 | MissingParameter | %s | A required parameter is not specified. |
400 | InvalidParameter | %s | Invalid parameter. |
403 | InvalidOperation.DeleteDefaultVersion | %s | The specified operation is invalid. |
403 | InnerServiceFailed | %s | An internal service cannot be called. |
For a list of error codes, visit the API Error Center.