全部产品
Search
文档中心

云服务器 ECS:DescribeLaunchTemplateVersions

更新时间:Oct 24, 2023

调用DescribeLaunchTemplateVersions查询ECS实例启动模板版本。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String DescribeLaunchTemplateVersions

系统规定参数。取值:DescribeLaunchTemplateVersions

RegionId String cn-hangzhou

实例启动模板所属的地域ID。

您可以调用DescribeRegions查看最新的阿里云地域列表。

LaunchTemplateVersion.N Long 1

一个或多个实例启动模板版本。

LaunchTemplateId String lt-bp168lnahrdwl39p****

实例启动模板ID。

您必须指定LaunchTemplateId或LaunchTemplateName以确定模板。

LaunchTemplateName String testLaunchTemplateName

实例启动模板名称。

MinVersion Long 1

通过范围指定版本时的最小版本号。

MaxVersion Long 10

通过范围指定版本时的最大版本号。

DefaultVersion Boolean true

是否查询默认版本。

DetailFlag Boolean true

是否查询模板配置详细信息。取值范围:

  • true:查询模版配置详细信息,在模版基本信息的基础上,还会返回模版配置细节,如镜像ID、系统盘大小等。
  • false:只查询模版基本信息,如模版ID、模版名称、默认版本等。

默认值:true。

PageNumber Integer 1

实例启动模板列表的页码。

起始值:1。

默认值:1。

PageSize Integer 10

分页查询时设置的每页行数。

默认值:10。

返回数据

名称

类型

示例值

描述

PageSize Integer 10

分页查询时设置的每页行数。

RequestId String 3989ED0C-20A1-4351-A127-2067FF8390AX

请求ID。

PageNumber Integer 1

当前页码。

TotalCount Integer 1

实例启动模板总数。

LaunchTemplateVersionSets Array of LaunchTemplateVersionSet

关于模板版本的信息。

LaunchTemplateVersionSet
LaunchTemplateName String testLaunchTemplateName

模板名称。

DefaultVersion Boolean true

模板是否为默认版本。

VersionNumber Long 1

模板版本号。

ModifiedTime String 2022-01-17T08:40:00Z

模板修改时间。

LaunchTemplateId String lt-bp67acfmxazb4p****

模板ID。

CreateTime String 2022-01-17T08:22:43Z

模板创建时间。

CreatedBy String 123456789****

模板的创建者。

VersionDescription String testVersionDescription

模板版本描述。

LaunchTemplateData Object

模板具体配置。

DeploymentSetId String ds-bp1brhwhoqinyjd6****

部署集ID。

VpcId String v-bp67acfmxazb4p****

专有网络VPC ID。

SystemDisk.PerformanceLevel String PL0

创建ESSD云盘作为系统盘使用时,设置云盘的性能等级。可能值:

  • PL0(默认):单盘最高随机读写IOPS 1万。
  • PL1:单盘最高随机读写IOPS 5万。
  • PL2:单盘最高随机读写IOPS 10万。
  • PL3:单盘最高随机读写IOPS 100万。

有关如何选择ESSD性能等级,请参见ESSD云盘

KeyPairName String testKeyPairName

密钥对名称。

SecurityGroupId String sg-bp67acfmxazb4p****

实例的安全组ID。

说明 SecurityGroupIdSecurityGroupIds不会同时返回值。
NetworkType String vpc

网络类型。可能值:

  • classic:经典网络。
  • vpc:专有网络VPC。
SpotStrategy String NoSpot

按量付费实例的竞价策略。可能值:

  • NoSpot:正常按量付费实例。
  • SpotWithPriceLimit:设置上限价格的抢占式实例。
  • SpotAsPriceGo:系统自动出价,跟随当前市场实际价格。
EnableVmOsConfig Boolean false

是否启用实例操作系统配置。

Description String testInstanceDescription

实例描述。

SpotDuration Integer 1

抢占式实例的保留时长,单位为小时。可能值:0~6。

您需要注意:

  • 保留时长2~6正在邀测中,如需开通请提交工单。
  • 取值为0,则为无保护期模式。
InstanceName String testInstanceName

实例名称。

SecurityEnhancementStrategy String active

是否开启安全加固。

UserData String SGVsbG9FQ1M=

实例自定义数据,以Base64方式编码。

SystemDisk.DiskName String testSystemDiskName

系统盘名称。

SystemDisk.Size Integer 40

系统盘大小,单位:GiB。

SpotPriceLimit Float 0.98

设置实例的每小时最高价格。

PasswordInherit Boolean true

是否继承原镜像里设置的用户名密码。

PrivateIpAddress String 10.1.**.**

实例私网IP地址。

ImageId String m-bp67acfmxazb4p****

实例使用的镜像ID。

SystemDisk.DeleteWithInstance Boolean true

系统盘是否随实例释放。可能值:

  • true:随实例释放。
  • false:不随实例释放。
SystemDisk.Category String cloud_ssd

系统盘的云盘种类。可能值:

  • cloud:普通云盘。
  • cloud_efficiency:高效云盘。
  • cloud_ssd:SSD云盘。
  • cloud_essd:ESSD云盘。您可以通过参数SystemDisk.PerformanceLevel设置云盘的性能等级。

已停售的实例规格且非I/O优化实例默认值为cloud,否则默认值为cloud_efficiency。

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

自动释放时间。

SystemDisk.Description String testSystemDiskDescription

系统盘描述。

ImageOwnerAlias String system

镜像来源。可能值:

  • system:阿里云提供的公共镜像。
  • self:您创建的自定义镜像。
  • others:其他阿里云用户共享给您的镜像。
  • marketplace:云市场镜像。
HostName String testHostName

实例主机名。

SystemDisk.Iops Integer 101800

系统盘总IOPS。

SystemDisk.AutoSnapshotPolicyId String sp-bp1j0alc2z1fhvie****

自动快照策略ID。

InternetMaxBandwidthOut Integer 100

公网出带宽最大值。

InternetMaxBandwidthIn Integer 5

公网入带宽最大值。

InstanceType String ecs.g5.large

实例规格。

Period Integer 1

购买资源的时长。

InstanceChargeType String Postpaid

实例计费类型。可能值:

  • PrePaid:包年包月。
  • PostPaid:按量付费。
IoOptimized String none

是否为I/O优化实例。

RamRoleName String testRamRoleName

实例RAM角色名称。

VSwitchId String vsw-bp67acfmxazb4p****

实例所属的虚拟交换机ID。

ResourceGroupId String rg-bp67acfmxazb4p****

启动模板所在的企业资源组ID。

InternetChargeType String PayByTraffic

公网带宽计费方式。

ZoneId String cn-hangzhou-g

可用区ID。

Ipv6AddressCount Integer 1

实例的IPv6地址数量。

DataDisks Array of DataDisk

数据盘集合。

DataDisk
PerformanceLevel String PL1

创建ESSD云盘作为数据盘使用时,设置云盘的性能等级。当Category=cloud_essd时该参数有返回值。可能值:

  • PL0:单盘最高随机读写IOPS 1万。
  • PL1:单盘最高随机读写IOPS 5万。
  • PL2:单盘最高随机读写IOPS 10万。
  • PL3:单盘最高随机读写IOPS 100万。
Description String testDiskDescription

数据盘描述。

SnapshotId String s-bp67acfmxazb4p****

数据盘使用的快照ID。

Device String /dev/xvda

数据盘的设备名。

说明 该参数即将停止使用,为提高代码兼容性,建议您尽量不要使用该参数。
Size Integer 2000

数据盘大小。

DiskName String testDiskName

数据盘名称。

Category String cloud_ssd

数据盘的云盘种类。

DeleteWithInstance Boolean true

数据盘是否随实例释放而释放。

Encrypted String false

数据盘是否加密。

ProvisionedIops Long 50000

是否修改ESSD AutoPL云盘预配置读写IOPS。取值范围:0~min{50000, 1000*容量-基准性能}。

基准性能=min{1,800+50*容量, 50,000}

说明 当DiskCategory取值为cloud_auto时才支持设置该参数。更多信息,请参见ESSD AutoPL云盘修改ESSD AutoPL云盘预配置信息
BurstingEnabled Boolean true

是否开启Burst(性能突发)。取值范围:

  • true:是。
  • false:否。
AutoSnapshotPolicyId String sp-wz91dz3ghear2a5s****

自动快照策略ID。

NetworkInterfaces Array of NetworkInterface

辅助弹性网卡的属性集合。

NetworkInterface
NetworkInterfaceName String testNetworkInterfaceName

辅助弹性网卡名称。

VSwitchId String vsw-bp67acfmxazb4p****

弹性网卡所属的虚拟交换机ID。

Description String testNetworkInterfacesDescription

辅助弹性网卡描述信息。

PrimaryIpAddress String 203.0.*.*

辅助弹性网卡的主私有IP地址。

SecurityGroupId String sg-bp67acfmxazb4p****

辅助弹性网卡所属的安全组ID。必须是同一个VPC下的安全组。

说明 SecurityGroupId和SecurityGroupIds不会同时返回值。
SecurityGroupIds Array of String ["sg-bp15ed6xe1yxeycg7****"]

辅助弹性网卡加入的一个或多个安全组。

说明 SecurityGroupId和SecurityGroupIds不会同时返回值。
InstanceType String ecs.s2.xlarge

实例的规格。

NetworkInterfaceTrafficMode String Standard

主网卡的通讯模式。参数取值范围:

  • Standard:使用TCP通讯模式。
  • HighPerformance:开启ERI(Elastic RDMA Interface)接口,使用RDMA通讯模式。
Tags Array of InstanceTag

实例的标签列表。

InstanceTag
Key String TestKey

实例的标签键。

Value String TestValue

实例的标签值。

SecurityGroupIds Array of String ["sg-bp15ed6xe1yxeycg7****"]

实例加入的一个或多个安全组。

说明 SecurityGroupIdSecurityGroupIds不会同时返回值。
SystemDisk.ProvisionedIops Long 50000

ESSD AutoPL云盘预配置读写IOPS。取值范围:0~min{50000, 1000*容量-基准性能}。

基准性能=min{1,800+50*容量, 50,000}

说明 当DiskCategory取值为cloud_auto时才支持设置该参数。更多信息,请参见ESSD AutoPL云盘修改ESSD AutoPL云盘预配置信息
SystemDisk.BurstingEnabled Boolean true

是否开启Burst(性能突发)。取值范围:

  • true:是。
  • false:否。
SystemDisk.Encrypted String false

系统盘是否加密。可能值:

  • true:加密。
  • false:不加密。

默认值:false。

说明 中国香港D可用区、新加坡A可用区暂不支持在创建实例时加密系统盘。
DeletionProtection Boolean false

实例释放保护属性,指定是否支持通过控制台或API(DeleteInstance)释放实例。取值范围:

  • true:开启实例释放保护。
  • false:关闭实例释放保护。

默认值:false。

说明 该属性仅适用于按量付费实例,且只能限制手动释放操作,对系统释放操作不生效。
CreditSpecification String Standard

突发性能实例的运行模式。可能值:

示例

请求示例

http(s)://ecs.aliyuncs.com/?Action=DescribeLaunchTemplateVersions
&RegionId=cn-hangzhou
&LaunchTemplateId=lt-bp168lnahrdwl39p****
&公共请求参数

正常返回示例

XML格式

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

<DescribeLaunchTemplateVersionsResponse>
    <PageSize>10</PageSize>
    <RequestId>3989ED0C-20A1-4351-A127-2067FF8390AX</RequestId>
    <PageNumber>1</PageNumber>
    <TotalCount>1</TotalCount>
    <LaunchTemplateVersionSets>
        <LaunchTemplateName>testLaunchTemplateName</LaunchTemplateName>
        <DefaultVersion>true</DefaultVersion>
        <VersionNumber>1</VersionNumber>
        <ModifiedTime>2022-01-17T08:40:00Z</ModifiedTime>
        <LaunchTemplateId>lt-bp67acfmxazb4p****</LaunchTemplateId>
        <CreateTime>2022-01-17T08:22:43Z</CreateTime>
        <CreatedBy>123456789****</CreatedBy>
        <VersionDescription>testVersionDescription</VersionDescription>
        <LaunchTemplateData>
            <DeploymentSetId>ds-bp1brhwhoqinyjd6****</DeploymentSetId>
            <VpcId>v-bp67acfmxazb4p****</VpcId>
            <SystemDisk.PerformanceLevel>PL0</SystemDisk.PerformanceLevel>
            <KeyPairName>testKeyPairName</KeyPairName>
            <SecurityGroupId>sg-bp67acfmxazb4p****</SecurityGroupId>
            <NetworkType>vpc</NetworkType>
            <SpotStrategy>NoSpot</SpotStrategy>
            <EnableVmOsConfig>false</EnableVmOsConfig>
            <Description>testInstanceDescription</Description>
            <SpotDuration>1</SpotDuration>
            <InstanceName>testInstanceName</InstanceName>
            <SecurityEnhancementStrategy>active</SecurityEnhancementStrategy>
            <UserData>SGVsbG9FQ1M=</UserData>
            <SystemDisk.DiskName>testSystemDiskName</SystemDisk.DiskName>
            <SystemDisk.Size>40</SystemDisk.Size>
            <SpotPriceLimit>0.98</SpotPriceLimit>
            <PasswordInherit>true</PasswordInherit>
            <PrivateIpAddress>10.1.**.**</PrivateIpAddress>
            <ImageId>m-bp67acfmxazb4p****</ImageId>
            <SystemDisk.DeleteWithInstance>true</SystemDisk.DeleteWithInstance>
            <SystemDisk.Category>cloud_ssd</SystemDisk.Category>
            <AutoReleaseTime>2018-05-14T14:18:00Z</AutoReleaseTime>
            <SystemDisk.Description>testSystemDiskDescription</SystemDisk.Description>
            <ImageOwnerAlias>system</ImageOwnerAlias>
            <HostName>testHostName</HostName>
            <SystemDisk.Iops>101800</SystemDisk.Iops>
            <InternetMaxBandwidthOut>100</InternetMaxBandwidthOut>
            <InternetMaxBandwidthIn>5</InternetMaxBandwidthIn>
            <InstanceType>ecs.g5.large</InstanceType>
            <Period>1</Period>
            <InstanceChargeType>Postpaid</InstanceChargeType>
            <IoOptimized>none</IoOptimized>
            <RamRoleName>testRamRoleName</RamRoleName>
            <VSwitchId>vsw-bp67acfmxazb4p****</VSwitchId>
            <ResourceGroupId>rg-bp67acfmxazb4p****</ResourceGroupId>
            <InternetChargeType>PayByTraffic</InternetChargeType>
            <ZoneId>cn-hangzhou-g</ZoneId>
            <Ipv6AddressCount>1</Ipv6AddressCount>
            <DataDisks>
                <PerformanceLevel>PL1</PerformanceLevel>
                <Description>testDiskDescription</Description>
                <SnapshotId>s-bp67acfmxazb4p****</SnapshotId>
                <Device>/dev/xvda</Device>
                <Size>2000</Size>
                <DiskName>testDiskName</DiskName>
                <Category>cloud_ssd</Category>
                <DeleteWithInstance>true</DeleteWithInstance>
                <Encrypted>false</Encrypted>
            </DataDisks>
            <NetworkInterfaces>
                <NetworkInterfaceName>testNetworkInterfaceName</NetworkInterfaceName>
                <VSwitchId>vsw-bp67acfmxazb4p****</VSwitchId>
                <Description>testNetworkInterfacesDescription</Description>
                <PrimaryIpAddress>203.0.*.*</PrimaryIpAddress>
                <SecurityGroupId>sg-bp67acfmxazb4p****</SecurityGroupId>
                <SecurityGroupIds>["sg-bp15ed6xe1yxeycg7****"]</SecurityGroupIds>
            </NetworkInterfaces>
            <Tags>
                <Key>TestKey</Key>
                <Value>TestValue</Value>
            </Tags>
            <SecurityGroupIds>["sg-bp15ed6xe1yxeycg7****"]</SecurityGroupIds>
        </LaunchTemplateData>
    </LaunchTemplateVersionSets>
</DescribeLaunchTemplateVersionsResponse>

JSON格式

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

{
  "PageSize" : 10,
  "RequestId" : "3989ED0C-20A1-4351-A127-2067FF8390AX",
  "PageNumber" : 1,
  "TotalCount" : 1,
  "LaunchTemplateVersionSets" : [ {
    "LaunchTemplateName" : "testLaunchTemplateName",
    "DefaultVersion" : true,
    "VersionNumber" : 1,
    "ModifiedTime" : "2022-01-17T08:40:00Z",
    "LaunchTemplateId" : "lt-bp67acfmxazb4p****",
    "CreateTime" : "2022-01-17T08:22:43Z",
    "CreatedBy" : "123456789****",
    "VersionDescription" : "testVersionDescription",
    "LaunchTemplateData" : {
      "DeploymentSetId" : "ds-bp1brhwhoqinyjd6****",
      "VpcId" : "v-bp67acfmxazb4p****",
      "SystemDisk.PerformanceLevel" : "PL0",
      "KeyPairName" : "testKeyPairName",
      "SecurityGroupId" : "sg-bp67acfmxazb4p****",
      "NetworkType" : "vpc",
      "SpotStrategy" : "NoSpot",
      "EnableVmOsConfig" : false,
      "Description" : "testInstanceDescription",
      "SpotDuration" : 1,
      "InstanceName" : "testInstanceName",
      "SecurityEnhancementStrategy" : "active",
      "UserData" : "SGVsbG9FQ1M=",
      "SystemDisk.DiskName" : "testSystemDiskName",
      "SystemDisk.Size" : 40,
      "SpotPriceLimit" : 0.98,
      "PasswordInherit" : true,
      "PrivateIpAddress" : "10.1.**.**",
      "ImageId" : "m-bp67acfmxazb4p****",
      "SystemDisk.DeleteWithInstance" : true,
      "SystemDisk.Category" : "cloud_ssd",
      "AutoReleaseTime" : "2018-05-14T14:18:00Z",
      "SystemDisk.Description" : "testSystemDiskDescription",
      "ImageOwnerAlias" : "system",
      "HostName" : "testHostName",
      "SystemDisk.Iops" : 101800,
      "InternetMaxBandwidthOut" : 100,
      "InternetMaxBandwidthIn" : 5,
      "InstanceType" : "ecs.g5.large",
      "Period" : 1,
      "InstanceChargeType" : "Postpaid",
      "IoOptimized" : "none",
      "RamRoleName" : "testRamRoleName",
      "VSwitchId" : "vsw-bp67acfmxazb4p****",
      "ResourceGroupId" : "rg-bp67acfmxazb4p****",
      "InternetChargeType" : "PayByTraffic",
      "ZoneId" : "cn-hangzhou-g",
      "Ipv6AddressCount" : 1,
      "DataDisks" : [ {
        "PerformanceLevel" : "PL1",
        "Description" : "testDiskDescription",
        "SnapshotId" : "s-bp67acfmxazb4p****",
        "Device" : "/dev/xvda",
        "Size" : 2000,
        "DiskName" : "testDiskName",
        "Category" : "cloud_ssd",
        "DeleteWithInstance" : true,
        "Encrypted" : "false"
      } ],
      "NetworkInterfaces" : [ {
        "NetworkInterfaceName" : "testNetworkInterfaceName",
        "VSwitchId" : "vsw-bp67acfmxazb4p****",
        "Description" : "testNetworkInterfacesDescription",
        "PrimaryIpAddress" : "203.0.*.*",
        "SecurityGroupId" : "sg-bp67acfmxazb4p****",
        "SecurityGroupIds" : [ "[\"sg-bp15ed6xe1yxeycg7****\"]" ]
      } ],
      "Tags" : [ {
        "Key" : "TestKey",
        "Value" : "TestValue"
      } ],
      "SecurityGroupIds" : [ "[\"sg-bp15ed6xe1yxeycg7****\"]" ]
    }
  } ]
}

错误码

HttpCode

错误码

错误信息

描述

400 InvalidRegion.NotExist %s 指定的地域不存在,请确认参数是否正确。
400 MissingParameter %s 缺失参数,请检查参数是否完整。
400 InvalidParameter %s 无效的参数。
403 InnerServiceFailed %s 内部服务调用失败。
404 InvalidLaunchTemplate.NotFound The specified LaunchTemplate is not found. 指定的模板未找到。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 内部错误,请重试。

访问错误中心查看更多错误码。