详情页标题前

阿里云ECS云服务器DescribeCapacityReservations-云淘科技

详情页1

调用DescribeCapacityReservations查询一个或多个容量预定服务的详细信息。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeCapacityReservations

系统规定参数。取值:DescribeCapacityReservations

RegionId String cn-hangzhou

容量预定服务所属地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。

ResourceGroupId String rg-bp67acfmxazb4p****

资源组ID。使用该参数过滤资源时,资源数量不能超过1000个。


说明 不支持默认资源组过滤。

Tag.N.Key String TestKey

标签键。N表示可以设置多个标签键进行过滤,N的取值范围为1~20。

使用一个标签过滤资源,查询到该标签下的资源数量不能超过1000个;使用多个标签过滤资源,查询到同时绑定了多个标签的资源数量不能超过1000个。如果资源数量超过1000个,请使用ListTagResources接口进行查询。

Tag.N.Value String TestValue

标签值。N表示可以设置多个标签值进行过滤,N的取值范围为1~20。

MaxResults Integer 10

分页查询时每页行数。

最大值:100。

默认值:10。

NextToken String caeba0bbb2be03f84eb48b699f0a4883

容量预定服务查询起始标志。由上一次的请求结果中获取。

PrivatePoolOptions.Ids String [“crp-bp1gubrkqutenqdd****”, “crp-bp67acfmxazb5****”]

容量预定服务ID列表。取值可以由多个ID组成一个JSON数组,最多支持100个ID,ID之间用半角逗号(,)隔开。

Platform String linux

实例的操作系统。取值范围:

  • windows:仅查询Windows系统的容量预定服务。
  • linux:仅查Linux系统的容量预定服务。
  • all:查询所有容量预定服务。

默认值:all。

InstanceType String ecs.c6.large

实例规格。

ZoneId String cn-hangzhou-h

容量预定服务所属地域下的可用区ID。

InstanceChargeType String PostPaid

实例的计费方式。取值范围:

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

默认值:PostPaid。

Status String Active

容量预定服务的状态。取值范围:

  • All:所有状态。
  • Pending:初始化。指定时间生效的容量预定会先进入初始化状态。
  • Preparing:准备中。指定时间生效的容量预定在资源交付进行阶段,处于准备中状态。
  • Prepared:待生效。指定时间生效的容量预定在资源交付完成,服务正式生效之前,处于待生效状态。
  • Active:生效中。
  • Released:已释放,包括手动释放与到期自动释放。

默认值:Active。

返回数据

名称 类型 示例值 描述
NextToken String caeba0bbb2be03f84eb48b699f0a****

容量预定服务下一个查询起始标志。

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

请求ID。

TotalCount Integer 1

符合查询条件的记录条数。

MaxResults Integer 10

容量预定服务每页显示行数。

CapacityReservationSet Array of CapacityReservationItem

容量预定服务详细信息组成的集合。

CapacityReservationItem
Status String Active

容量预定服务的状态。可能值:

  • Pending:初始化。
  • Preparing:准备中。
  • Prepared:待生效。
  • Active:生效中。
  • Released:已释放,包括手动释放与到期自动释放。
TimeSlot String null


说明 该参数正在邀测中,暂未开放使用。

PrivatePoolOptionsMatchCriteria String Open

容量预定服务生效后生成的私有资源池的类型。可能值:

  • Open:开放模式。
  • Target:专用模式。
PrivatePoolOptionsId String crp-bp1gubrkqutenqdd****

容量预定服务ID。

PrivatePoolOptionsName String crpTestName

容量预定服务名称。

RegionId String cn-hangzhou

容量预定服务所属地域ID。

InstanceChargeType String PostPaid

容量预定服务中实例的付费类型。可能值:

  • PostPaid:按量付费。
  • PrePaid:包年包月。
EndTime String 2021-02-19T03:02Z

容量预定服务的失效时间。

StartTime String 2021-02-19T02:01Z

容量预定服务生效时间。

Description String This is description.

容量预定服务描述。

EndTimeType String Unlimited

容量预定服务的失效方式。可能值:

  • Limited:指定时间释放。
  • Unlimited:手动释放。不限制时间。
ResourceGroupId String rg-bp67acfmxazb4p****

容量预定服务所属的资源组ID。

Platform String linux

匹配的实例的操作系统。可能值:

  • windows。
  • linux。
AllocatedResources Array of AllocatedResource

资源分配详情。

AllocatedResource
UsedAmount Integer 2

已使用的实例的数量。

TotalAmount Integer 2

在一个实例规格内,需要预留的实例的总数量。

zoneId String cn-hangzhou-h

可用区ID。

InstanceType String ecs.c6.large

实例规格。

Tags Array of Tag

容量预定服务绑定的标签键值对信息。

Tag
TagValue String TestValue

标签值。

TagKey String TestKey

标签键。

StartTimeType String Now

容量预定生效方式。可能值:

  • Now:立即生效。
  • Later:指定时间生效。
SavingPlanId String spn-c29b5e18pJMT****

容量预定搭配的节省计划券ID。

ReservedInstanceId String ri-bpzhex2ulpzf53****

容量预定搭配的预留实例券ID。

示例

请求示例

http(s)://ecs.aliyuncs.com/?Action=DescribeCapacityReservations
&RegionId=cn-hangzhou
&PrivatePoolOptions.Ids=["crp-bp1gubrkqutenqdd****", "crp-bp67acfmxazb5****"]
&InstanceType=ecs.c6.large
&

正常返回示例

XML格式

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


    1
    caeba0bbb2be03f84eb48b699f0a****
    473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
    10
    
        
            Active
            This is description.
            2021-02-19T03:02Z
            linux
            rg-bp67acfmxazb4p****
            crpTestName
            PostPaid
            2021-02-19T02:01Z
            Now
            Open
            
            spn-c29b5e18pJMT****
            ri-bpzhex2ulpzf53****
            
                
                    2
                    cn-hangzhou-h
                    2
                    ecs.c6.large
                
            
            crp-bp1gubrkqutenqdd****
            Unlimited
            cn-hangzhou
            
                
                    TestKey
                    TestValue
                
            
        
    

JSON格式

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

{
  "TotalCount" : 1,
  "NextToken" : "caeba0bbb2be03f84eb48b699f0a****",
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "MaxResults" : 10,
  "CapacityReservationSet" : {
    "CapacityReservationItem" : [ {
      "Status" : "Active",
      "Description" : "This is description.",
      "EndTime" : "2021-02-19T03:02Z",
      "Platform" : "linux",
      "ResourceGroupId" : "rg-bp67acfmxazb4p****",
      "PrivatePoolOptionsName" : "crpTestName",
      "InstanceChargeType" : "PostPaid",
      "StartTime" : "2021-02-19T02:01Z",
      "StartTimeType" : "Now",
      "PrivatePoolOptionsMatchCriteria" : "Open",
      "TimeSlot" : "",
      "SavingPlanId" : "spn-c29b5e18pJMT****",
      "ReservedInstanceId" : "ri-bpzhex2ulpzf53****",
      "AllocatedResources" : {
        "AllocatedResource" : [ {
          "UsedAmount" : 2,
          "zoneId" : "cn-hangzhou-h",
          "TotalAmount" : 2,
          "InstanceType" : "ecs.c6.large"
        } ]
      },
      "PrivatePoolOptionsId" : "crp-bp1gubrkqutenqdd****",
      "EndTimeType" : "Unlimited",
      "RegionId" : "cn-hangzhou",
      "Tags" : {
        "Tag" : [ {
          "TagKey" : "TestKey",
          "TagValue" : "TestValue"
        } ]
      }
    } ]
  }
}

错误码

HttpCode 错误码 错误信息 描述
400 MissingParameter.RegionId The specified RegionId should not be null. RegionId是必选参数。
400 DedicatedHostNotSupported DedicatedHost is not supported for PrivatePool. 私有池不支持专有宿主机。
400 SpotNotSupported Spot is not supported for PrivatePool. 私有池不支持抢占式实例。
400 ClassicNetworkNotSupported Classic network is not supported for PrivatePool. 私有池不支持经典网络类型实例。
400 Invalid.InstanceId Instance does not exist. 实例不存在。
400 Invalid.PrivatePoolOptions.MatchCriteria Target mode does not support this operation. Target模式不支持本次操作。
400 MissingParameter.PrivatePoolOptions.Id The specified PrivatePoolOptions.Id should not be null. PrivatePoolOptions.Id 参数不能为空。
400 Invalid.PrivatePoolOptions.Id The PrivatePool does not exist. 私有池不存在。
400 Invalid.InstanceType The InstanceType does not match the PrivatePool. 实例类型与私有池不匹配。
400 Invalid.InstanceChargeType The InstanceChargeType does not match the PrivatePool. 实例计费类型与私有池不匹配。
400 Invalid.ZoneId The ZoneId does not match the PrivatePool. 可用区与私有池不匹配。
400 Invalid.PrivatePoolOptions.MatchCriteria The PrivatePoolOptions.MatchCriteria does not match the PrivatePool. 指定的PrivatePoolOptions.MatchCriteria参数与私有池不匹配。
400 InvalidPlatform.ValueNotSupported The Platform does not match the PrivatePool. 指定的Platform参数与私有池不匹配。
400 InvalidAliUid The PrivatePool does not belong to the user of the Instance. 私有池不属于创建实例的用户。
400 Invalid.InstanceId The Instance dose not attached to a PrivatePool. 实例未与私有池匹配。
400 Invalid.TooManyPrivatePoolOptions.Ids Too many PrivatePoolOptions.Ids in this request. PrivatePoolOptions.Ids参数超过上限。
400 Invalid.TooManyZoneIds Too many ZoneIds in the request. ZoneIds参数超过上限。
400 Invalid.TooManyInstanceTypes Too many InstanceTypes in the request. InstanceTypes参数超过上限。
400 Invalid.TooManyUnpaidPrivatePool Too many PrivatePools create but still unpaid. 多个私有池未支付。
400 Invalid.InstanceCpuCoreCountOrInstanceAmount Both InstanceCpuCoreCount and InstanceAmount are provided. InstanceCpuCoreCount和InstanceAmount两个参数不需要同时提供。
400 Invalid.PrivatePool.Purchase The PrivatePool has already paid. 私有池已经支付。
400 Invalid.AssuranceTimes.NotSupported The value of AssuranceTimes is not supported. AssuranceTimes参数值不支持。
400 RepeatStartPrivatePool PrivatePool has already been started. 私有池已经启动。
400 InvalidParameter.RegionId The specified RegionId is not exist. 传入的 RegionId 不存在。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 内部错误,请重试。

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

腾讯云1折,限时活动,即将结束: 马上收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠

转转请注明出处:https://www.yunxiaoer.com/153335.html

(0)
上一篇 2023年12月9日
下一篇 2023年12月9日
详情页2

相关推荐

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
本站为广大会员提供阿里云、腾讯云、华为云、百度云等一线大厂的购买,续费优惠,保证底价,买贵退差。