You can call this operation to query one or more available instance launch templates.

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 DescribeLaunchTemplates

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

RegionId String Yes cn-hangzhou

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

TemplateTag.N.Key String No FinanceDept

The key of tag N of the instance launch template. Valid values of N: 1 to 20.

TemplateTag.N.Value String No FinanceDepltJoshua

The value of tag N of the instance launch template. Valid values of N: 1 to 20.

LaunchTemplateId.N RepeatList No lt-m5e3ofjr1zn1aw7qd***

The IDs of one or more instance launch templates to be queried. You can specify a maximum of 100 launch template IDs. You must specify the LaunchTemplateId parameter or the LaunchTemplateName parameter to determine an instance launch template.

LaunchTemplateName.N RepeatList No wd-1526307480***

The names of one or more instance launch templates to be queried. You can specify a maximum of 100 launch template names.

PageNumber Integer No 1

The number of the page to return. Pages start from page 1.

Default value: 1

PageSize Integer No 10

The number of entries to return on each page.

Default value: 10

TemplateResourceGroupId String No rg-resourcegroupid1

The ID of the resource group to which the instance launch template belongs.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FExxxxx

The ID of the request.

TotalCount Integer 1

The total number of instance launch templates.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

LaunchTemplateSets Array

The collection of instance launch templates.

CreateTime String 2018-05-14T14:18:00Z

The time when the instance launch template was created.

ModifiedTime String 2018-05-14T14:18:00Z

The time when the instance launch template was modified.

LaunchTemplateId String lt-m5e3ofjr1zn1aw7qd***

The ID of the instance launch template.

LaunchTemplateName String wd-1526307480***

The name of the instance launch template.

DefaultVersionNumber Long 1

The default version number of the instance launch template.

LatestVersionNumber Long 1

The latest version number of the instance launch template.

CreatedBy String 1942111349714***

The creator of the instance launch template.

ResourceGroupId String rg-resourcegroupid1

The ID of the resource group to which the instance launch template belongs.

Tags Array

The tag of the instance launch template.

TagKey String FinanceDept

The tag key of the instance launch template.

TagValue String FinanceDeptJoshua

The tag value of the instance launch template.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeLaunchTemplates
&RegionId=cn-hangzhou
&TemplateTag.1.Key=FinanceDept
&TemplateTag.1.Value=FinanceDepltJoshua
&LaunchTemplateId.1=lt-m5e3ofjr1zn1aw7qd***
&LaunchTemplateName.1=wd-1526307480***
&PageNumber=1
&PageSize=10
&TemplateResourceGroupId=rg-resourcegroupid1
&<Common request parameters>

Sample success responses

XML format

<DescribeLaunchTemplatesResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FExxxxx</RequestId>
      <TotalCount>1</TotalCount>
      <PageNumber>1</PageNumber>
      <PageSize>10</PageSize>
      <LaunchTemplateSets>
            <LaunchTemplateSet>
                  <CreateTime>2018-05-14T14:18:00Z</CreateTime>
                  <ModifiedTime>2018-05-14T14:18:00Z</ModifiedTime>
                  <LaunchTemplateid>lt-m5e3ofjr1zn1aw7****</LaunchTemplateid>
                  <LaunchTemplateName>wd-1526307480***</LaunchTemplateName>
                  <DefaultVersionNumber>1</DefaultVersionNumber>
                  <LatestVersionNumber>1</LatestVersionNumber>
                  <CreatedBy>1942111349714***</CreatedBy>
            </LaunchTemplateSet>
      </LaunchTemplateSets>
</DescribeLaunchTemplatesResponse>

JSON format

{
    "RequestId": "04F0F334-1335-436C-A1D7-6C044FExxxxx",
    "TotalCount": 1,
    "PageNumber": 1,
    "PageSize": 10,
    "LaunchTemplateSets": {
        "LaunchTemplateSet": [
            {
                "LaunchTemplateName": "wd-1526307480***",
                "CreatedBy": "1942111349714***",
                "ModifiedTime": "2018-05-14T14:18:00Z",
                "LatestVersionNumber": 1,
                "CreateTime": "2018-05-14T14:18:00Z",
                "LaunchTemplateId": "lt-m5e3ofjr1zn1aw7qd***",
                "DefaultVersionNumber": 1
            }
        ]
    }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidRegion.NotExist %s The error message returned because the specified InstanceId parameter does not exist. Check whether the instance ID is correct.
400 MissingParameter %s The error message returned because a required parameter is not specified.
400 InvalidParameter %s The error message returned because the specified parameter value is invalid.
403 InnerServiceFailed %s The error message returned because an internal service failed to be called.

For a list of error codes, visit the API Error Center.