All Products
Search
Document Center

Elastic Compute Service:DescribeLaunchTemplates

Last Updated:Dec 25, 2024

Queries the information of one or more launch templates, such as the total number of launch templates, the creation time of each launch template, and the latest version number of each launch template. When you can this operation, you can specify parameters, such as TemplateTag, TemplateResourceGroupId, and LaunchTemplateId, in the request.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeLaunchTemplatesget
*LaunchTemplate
acs:ecs:{#regionId}:{#accountId}:launchtemplate/*
*LaunchTemplate
acs:ecs:{#regionId}:{#accountId}:launchtemplate/{#launchtemplateId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The tags of the launch template.

cn-hangzhou
TemplateTagarray<object>No

The tags of the launch template.

Note You can only call API operations to add tags to and query the tags of a launch template. You cannot add tags to or view the tags of a launch template in the Elastic Compute Service (ECS) console.
objectNo

Tag N of the launch template.

KeystringNo

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

If you specify a single tag to query resources, up to 1,000 resources to which the tag is added are returned. If you specify multiple tags to query resources, up to 1,000 resources to which all specified tags are added are returned. To query more than 1,000 resources that have specified tags added, call the ListTagResources operation.

TestKey
ValuestringNo

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

TestValue
PageNumberintegerNo

The number of entries to return on each page.

Default value: 10.

1
PageSizeintegerNo

The ID of the resource group to which the launch template belongs. If you specify this parameter to query resources, up to 1,000 resources that belong to the specified resource group can be returned.

Note Resources in the default resource group are displayed in the response regardless of whether you specify this parameter.
10
TemplateResourceGroupIdstringNo

The IDs of launch templates. You can specify up to 100 launch template IDs. You must specify LaunchTemplateId or LaunchTemplateName to determine a launch template.

rg-acfmxazb4p****
LaunchTemplateIdarrayNo

The IDs of launch templates.

  • You can query up to 100 launch templates.
  • You must specify LaunchTemplateId or LaunchTemplateName to specify a launch template.
stringNo

The ID of the launch template.

  • You can query up to 100 launch templates.
  • You must specify LaunchTemplateId or LaunchTemplateName to specify a launch template.
lt-m5e3ofjr1zn1aw7q****
LaunchTemplateNamearrayNo

The names of launch templates.

  • You can query up to 100 launch templates.
  • You must specify LaunchTemplateId or LaunchTemplateName to specify a launch template.
stringNo

The name of the launch template.

  • You can query up to 100 launch templates.
  • You must specify LaunchTemplateId or LaunchTemplateName to specify a launch template.
wd-152630748****

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The ID of the request.

10
RequestIdstring

The page number of the returned page.

04F0F334-1335-436C-A1D7-6C044FE12CBA
PageNumberinteger

The total number of launch templates.

1
TotalCountinteger

The information about the launch templates.

1
LaunchTemplateSetsarray<object>

The queried launch templates.

LaunchTemplateSetobject

The information about the launch template.

LaunchTemplateNamestring

The default version number of the launch template.

wd-152630748****
DefaultVersionNumberlong

The time when the launch template was modified.

1
ModifiedTimestring

The time when a version was added to or deleted from the launch template.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2018-05-14T14:18:00Z
LaunchTemplateIdstring

The time when the launch template was created.

lt-m5e3ofjr1zn1aw7q****
CreateTimestring

The time when the launch template was created.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2018-05-14T14:18:00Z
ResourceGroupIdstring

The creator of the launch template.

rg-acfmxazb4p****
CreatedBystring

The ID of the Alibaba Cloud account that created the launch template.

1234567890
LatestVersionNumberlong

The tags of the launch template.

1
Tagsarray<object>

The tags of the launch template.

Note You can only call API operations to add tags to and query the tags of a launch template. You cannot add tags to or view the tags of a launch template in the ECS console.
Tagobject

The tag of the launch template.

TagValuestring

The tag key of the launch template.

TestValue
TagKeystring

The tag value of the launch template.

TestKey

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE12CBA",
  "PageNumber": 1,
  "TotalCount": 1,
  "LaunchTemplateSets": {
    "LaunchTemplateSet": [
      {
        "LaunchTemplateName": "wd-152630748****",
        "DefaultVersionNumber": 1,
        "ModifiedTime": "2018-05-14T14:18:00Z",
        "LaunchTemplateId": "lt-m5e3ofjr1zn1aw7q****",
        "CreateTime": "2018-05-14T14:18:00Z",
        "ResourceGroupId": "rg-acfmxazb4p****",
        "CreatedBy": "1234567890",
        "LatestVersionNumber": 1,
        "Tags": {
          "Tag": [
            {
              "TagValue": "TestValue",
              "TagKey": "TestKey"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidRegion.NotExist%sThe specified region does not exist.
400MissingParameter%sA parameter is not specified.
400InvalidParameter%sThe specified parameter is invalid.
403InnerServiceFailed%sAn internal service cannot be called.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error has occurred. Try again later.
503ServiceUnavailableThe request has failed due to a temporary failure of the server.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-28The Error code has changedView Change Details