Queries the list of versions of a template.

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 ListTemplateVersions

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

NextToken String No caeba0bbb2be03f84eb48b699f0****

The query token. Set the value to the NextToken value that is returned from the last call.

MaxResults Long No 50

The maximum number of results to be returned in a single call when the NextToken parameter is used for the query.

Valid values: 1 to 100.

Default value: 50.

TemplateId String Yes 5ecd1e10-b0e9-4389-a565-e4c15efc****

The ID of the template. This parameter applies to shared and private templates.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Versions Array of Version

The list of versions.

UpdateTime String 2020-02-27T07:47:47

The time when the version was last updated.

Description String test

The description of the version.

CreateTime String 2020-02-27T07:47:47

The time when the version was created.

TemplateName String test

The template name that corresponds to the specified version.

TemplateId String 5ecd1e10-b0e9-4389-a565-e4c15efc****

The ID of the template. This parameter applies to shared and private templates. For a shared template, the template ID is the same as the Alibaba Cloud Resource Name (ARN) of the template.

TemplateVersion String v1

The version number.

For a shared template, this parameter is returned only if the VersionOption parameter is set to AllVersions.

Valid values: v1 to v100.

NextToken String caeba0bbb2be03f84eb48b699f0****

The query token that is returned in this call.

RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6F

The ID of the request.

Examples

Sample requests

http(s)://ros.aliyuncs.com/?Action=ListTemplateVersions
&TemplateId=5ecd1e10-b0e9-4389-a565-e4c15efc****
&<Common request parameters>

Sample success responses

XML format

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

<ListTemplateVersionsResponse>
    <Versions>
        <Description>test</Description>
        <CreateTime>2020-02-27T07:47:47</CreateTime>
        <UpdateTime>2020-02-27T07:47:47</UpdateTime>
        <TemplateVersion>v1</TemplateVersion>
        <TemplateName>test</TemplateName>
        <TemplateId>5ecd1e10-b0e9-4389-a565-e4c15efc****</TemplateId>
    </Versions>
    <NextToken>caeba0bbb2be03f84eb48b699f0****</NextToken>
    <RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
</ListTemplateVersionsResponse>

JSON format

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

{
  "Versions" : [ {
    "Description" : "test",
    "CreateTime" : "2020-02-27T07:47:47",
    "UpdateTime" : "2020-02-27T07:47:47",
    "TemplateVersion" : "v1",
    "TemplateName" : "test",
    "TemplateId" : "5ecd1e10-b0e9-4389-a565-e4c15efc****"
  } ],
  "NextToken" : "caeba0bbb2be03f84eb48b699f0****",
  "RequestId" : "B288A0BE-D927-4888-B0F7-B35EF84B6E6F"
}

Error codes

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

HTTP status code

Error code

Error message

Description

404

TemplateNotFound

The Tempalte ({ ID }) could not be found.

The error message returned because the specified template does not exist. ID indicates the ID of the template.

404

TemplateNotFound

The Template { ID } with version { version } could not be found.

The error message returned because the specified template or template version does not exist. ID indicates the ID of the template. version indicates the version of the template.