Queries the instances that match a capacity reservation.

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

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeCapacityReservationInstances

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

RegionIdStringYescn-hangzhou

The ID of the region in which to create the capacity reservation. You can call the DescribeRegions operation to query the most recent region list.

MaxResultsIntegerNo10

The maximum number of entries to return on each page.

Maximum value: 100.

Default value: 10.

NextTokenStringNocaeba0bbb2be03f84eb48b699f0a4883

The token used to start the next query. Set the value to the NextToken value obtained from the response to the previous request.

PrivatePoolOptions.IdStringYescrp-bp67acfmxazb4****

The ID of the capacity reservation.

Response parameters

ParameterTypeExampleDescription
NextTokenStringcaeba0bbb2be03f84eb48b699f0a4883

The token used to start the next query.

RequestIdString473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

TotalCountInteger10

The total number of entries returned.

MaxResultsInteger10

The maximum number of entries returned per page.

CapacityReservationItemArray of InstanceIdSet

Details about the instances that were created by using the capacity reservation.

InstanceIdSet
InstanceIdStringi-bp67acfmxazb4****

The ID of the instance.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=DescribeCapacityReservationInstances
&RegionId=cn-hangzhou
&PrivatePoolOptions.Id=crp-bp67acfmxazb4****
&<Common request parameters>

Sample success responses

XML format

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

<DescribeCapacityReservationInstancesResponse>
    <TotalCount>2</TotalCount>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <NextToken>caeba0bbb2be03f84eb48b699f0a4883</NextToken>
    <MaxResults>10</MaxResults>
    <CapacityReservationItem>
        <InstanceIdSet>
            <InstanceId>i-bp67acfmxazb4****</InstanceId>
        </InstanceIdSet>
        <InstanceIdSet>
            <InstanceId>i-bp67acfmxazb5****</InstanceId>
        </InstanceIdSet>
    </CapacityReservationItem>
</DescribeCapacityReservationInstancesResponse>

JSON format

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

{
  "TotalCount" : 2,
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "NextToken" : "caeba0bbb2be03f84eb48b699f0a4883",
  "MaxResults" : 10,
  "CapacityReservationItem" : {
    "InstanceIdSet" : [ {
      "InstanceId" : "i-bp67acfmxazb4****"
    }, {
      "InstanceId" : "i-bp67acfmxazb5****"
    } ]
  }
}

Error codes

HttpCodeError codeError messageDescription
400MissingParameter.RegionIdThe specified RegionId should not be null.The error message returned because the required RegionId parameter is not specified.
400DedicatedHostNotSupportedDedicatedHost is not supported for PrivatePool.The error message returned because private pools cannot be used to create instances on dedicated hosts.
400SpotNotSupportedSpot is not supported for PrivatePool.The error message returned because private pools cannot be used to create preemptible instances.
400ClassicNetworkNotSupportedClassic network is not supported for PrivatePool.The error message returned because private pools cannot be used to create instances of the classic network type.
400Invalid.InstanceIdInstance does not exist.The error message returned because the specified instance does not exist.
400Invalid.PrivatePoolOptions.MatchCriteriaTarget mode does not support this operation.The error message returned because the operation is not supported while the PrivatePoolOptions.MatchCriteria parameter is set to Target.
400MissingParameter.PrivatePoolOptions.IdThe specified PrivatePoolOptions.Id should not be null.The error message returned because the PrivatePoolOptions.Id parameter is not specified.
400Invalid.PrivatePoolOptions.IdThe PrivatePool does not exist.The error message returned because the private pool does not exist.
400Invalid.InstanceTypeThe InstanceType does not match the PrivatePool.The error message returned because the specified instance type does not match the specified private pool.
400Invalid.InstanceChargeTypeThe InstanceChargeType does not match the PrivatePool.The error message returned because the specified billing method of the specified instance does not match the specified private pool.
400Invalid.ZoneIdThe ZoneId does not match the PrivatePool.The error message returned because the specified zone does not match the specified private pool.
400Invalid.PrivatePoolOptions.MatchCriteriaThe PrivatePoolOptions.MatchCriteria does not match the PrivatePool.The error message returned because the specified PrivatePoolOptions.MatchCriteria parameter does not match the private pool.
400InvalidPlatform.ValueNotSupportedThe Platform does not match the PrivatePool.The error message returned because the specified Platform parameter does not match the private pool.
400InvalidAliUidThe PrivatePool does not belong to the user of the Instance.The error message returned because the specified private pool does not belong to the user who attempted to create the instance.
400Invalid.InstanceIdThe Instance dose not attached to a PrivatePool.The error message returned because the instance does not match the private pool.
400Invalid.TooManyPrivatePoolOptions.IdsToo many PrivatePoolOptions.Ids in this request.The error message returned because the number of specified private pools exceeds the upper limit.
400Invalid.TooManyZoneIdsToo many ZoneIds in the request.The error message returned because the number of specified zone IDs exceeds the upper limit.
400Invalid.TooManyInstanceTypesToo many InstanceTypes in the request.The error message returned because the number of specified instance types exceeds the upper limit.
400Invalid.TooManyUnpaidPrivatePoolToo many PrivatePools create but still unpaid.The error message returned because multiple private pools are created but not paid.
400Invalid.InstanceCpuCoreCountOrInstanceAmountBoth InstanceCpuCoreCount and InstanceAmount are provided.The error message returned because the InstanceCpuCoreCount and InstanceAmount parameters cannot be specified at the same time.
400Invalid.PrivatePool.PurchaseThe PrivatePool has already paid.The error message returned because the private pool is already paid.
400Invalid.AssuranceTimes.NotSupportedThe value of AssuranceTimes is not supported.The error message returned because the specified AssuranceTimes parameter is invalid.
400RepeatStartPrivatePoolPrivatePool has already been started.The error message returned because the private pool is already started.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.The error message returned because an internal error has occurred. Try again later.

For a list of error codes, see Service error codes.