2026/02/25 - Amazon Elastic Compute Cloud - 4 updated api methods
Changes Add support for EC2 Capacity Blocks in Local Zones.
{'CapacityBlockExtensions': {'ZoneType': 'string'}}
Describes the events for the specified Capacity Block extension during the specified time.
See also: AWS API Documentation
Request Syntax
client.describe_capacity_block_extension_history(
CapacityReservationIds=[
'string',
],
NextToken='string',
MaxResults=123,
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
DryRun=True|False
)
list
The IDs of Capacity Block reservations that you want to display the history for.
(string) --
string
The token to use to retrieve the next page of results.
integer
The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
list
One or more filters
availability-zone - The Availability Zone of the extension.
availability-zone-id - The Availability Zone ID of the extension.
capacity-block-extension-offering-id - The ID of the extension offering.
capacity-block-extension-status - The status of the extension ( payment-pending | payment-failed | payment-succeeded).
capacity-reservation-id - The reservation ID of the extension.
instance-type - The instance type of the extension.
(dict) --
A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.
If you specify multiple filters, the filters are joined with an AND, and the request returns only results that match all of the specified filters.
For more information, see List and filter using the CLI and API in the Amazon EC2 User Guide.
Name (string) --
The name of the filter. Filter names are case-sensitive.
Values (list) --
The filter values. Filter values are case-sensitive. If you specify multiple values for a filter, the values are joined with an OR, and the request returns all results that match any of the specified values.
(string) --
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
dict
Response Syntax
{
'CapacityBlockExtensions': [
{
'CapacityReservationId': 'string',
'InstanceType': 'string',
'InstanceCount': 123,
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'CapacityBlockExtensionOfferingId': 'string',
'CapacityBlockExtensionDurationHours': 123,
'CapacityBlockExtensionStatus': 'payment-pending'|'payment-failed'|'payment-succeeded',
'CapacityBlockExtensionPurchaseDate': datetime(2015, 1, 1),
'CapacityBlockExtensionStartDate': datetime(2015, 1, 1),
'CapacityBlockExtensionEndDate': datetime(2015, 1, 1),
'UpfrontFee': 'string',
'CurrencyCode': 'string',
'ZoneType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
CapacityBlockExtensions (list) --
Describes one or more of your Capacity Block extensions. The results describe only the Capacity Block extensions in the Amazon Web Services Region that you're currently using.
(dict) --
Describes a Capacity Block extension. With an extension, you can extend the duration of time for an existing Capacity Block.
CapacityReservationId (string) --
The reservation ID of the Capacity Block extension.
InstanceType (string) --
The instance type of the Capacity Block extension.
InstanceCount (integer) --
The number of instances in the Capacity Block extension.
AvailabilityZone (string) --
The Availability Zone of the Capacity Block extension.
AvailabilityZoneId (string) --
The Availability Zone ID of the Capacity Block extension.
CapacityBlockExtensionOfferingId (string) --
The ID of the Capacity Block extension offering.
CapacityBlockExtensionDurationHours (integer) --
The duration of the Capacity Block extension in hours.
CapacityBlockExtensionStatus (string) --
The status of the Capacity Block extension. A Capacity Block extension can have one of the following statuses:
payment-pending - The Capacity Block extension payment is processing. If your payment can't be processed within 12 hours, the Capacity Block extension is failed.
payment-failed - Payment for the Capacity Block extension request was not successful.
payment-succeeded - Payment for the Capacity Block extension request was successful. You receive an invoice that reflects the one-time upfront payment. In the invoice, you can associate the paid amount with the Capacity Block reservation ID.
CapacityBlockExtensionPurchaseDate (datetime) --
The date when the Capacity Block extension was purchased.
CapacityBlockExtensionStartDate (datetime) --
The start date of the Capacity Block extension.
CapacityBlockExtensionEndDate (datetime) --
The end date of the Capacity Block extension.
UpfrontFee (string) --
The total price to be paid up front.
CurrencyCode (string) --
The currency of the payment for the Capacity Block extension.
ZoneType (string) --
The type of zone where the Capacity Block extension is located.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
{'CapacityBlockExtensionOfferings': {'ZoneType': 'string'}}
Describes Capacity Block extension offerings available for purchase in the Amazon Web Services Region that you're currently using.
See also: AWS API Documentation
Request Syntax
client.describe_capacity_block_extension_offerings(
DryRun=True|False,
CapacityBlockExtensionDurationHours=123,
CapacityReservationId='string',
NextToken='string',
MaxResults=123
)
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
integer
[REQUIRED]
The duration of the Capacity Block extension offering in hours.
string
[REQUIRED]
The ID of the Capacity reservation to be extended.
string
The token to use to retrieve the next page of results.
integer
The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
dict
Response Syntax
{
'CapacityBlockExtensionOfferings': [
{
'CapacityBlockExtensionOfferingId': 'string',
'InstanceType': 'string',
'InstanceCount': 123,
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'StartDate': datetime(2015, 1, 1),
'CapacityBlockExtensionStartDate': datetime(2015, 1, 1),
'CapacityBlockExtensionEndDate': datetime(2015, 1, 1),
'CapacityBlockExtensionDurationHours': 123,
'UpfrontFee': 'string',
'CurrencyCode': 'string',
'Tenancy': 'default'|'dedicated',
'ZoneType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
CapacityBlockExtensionOfferings (list) --
The recommended Capacity Block extension offerings for the dates specified.
(dict) --
The recommended Capacity Block extension that fits your search requirements.
CapacityBlockExtensionOfferingId (string) --
The ID of the Capacity Block extension offering.
InstanceType (string) --
The instance type of the Capacity Block that will be extended.
InstanceCount (integer) --
The number of instances in the Capacity Block extension offering.
AvailabilityZone (string) --
The Availability Zone of the Capacity Block that will be extended.
AvailabilityZoneId (string) --
The Availability Zone ID of the Capacity Block that will be extended.
StartDate (datetime) --
The start date of the Capacity Block that will be extended.
CapacityBlockExtensionStartDate (datetime) --
The date and time at which the Capacity Block extension will start. This date is also the same as the end date of the Capacity Block that will be extended.
CapacityBlockExtensionEndDate (datetime) --
The date and time at which the Capacity Block extension expires. When a Capacity Block expires, the reserved capacity is released and you can no longer launch instances into it. The Capacity Block's state changes to expired when it reaches its end date
CapacityBlockExtensionDurationHours (integer) --
The amount of time of the Capacity Block extension offering in hours.
UpfrontFee (string) --
The total price of the Capacity Block extension offering, to be paid up front.
CurrencyCode (string) --
The currency of the payment for the Capacity Block extension offering.
Tenancy (string) --
Indicates the tenancy of the Capacity Block extension offering. A Capacity Block can have one of the following tenancy settings:
default - The Capacity Block is created on hardware that is shared with other Amazon Web Services accounts.
dedicated - The Capacity Block is created on single-tenant hardware that is dedicated to a single Amazon Web Services account.
ZoneType (string) --
The type of zone where the Capacity Block extension offering is available.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
{'AllAvailabilityZones': 'boolean'}
Response {'CapacityBlockOfferings': {'ZoneType': 'string'}}
Describes Capacity Block offerings available for purchase in the Amazon Web Services Region that you're currently using. With Capacity Blocks, you can purchase a specific GPU instance type or EC2 UltraServer for a period of time.
To search for an available Capacity Block offering, you specify a reservation duration and instance count.
See also: AWS API Documentation
Request Syntax
client.describe_capacity_block_offerings(
DryRun=True|False,
InstanceType='string',
InstanceCount=123,
StartDateRange=datetime(2015, 1, 1),
EndDateRange=datetime(2015, 1, 1),
CapacityDurationHours=123,
NextToken='string',
MaxResults=123,
UltraserverType='string',
UltraserverCount=123,
AllAvailabilityZones=True|False
)
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
string
The type of instance for which the Capacity Block offering reserves capacity.
integer
The number of instances for which to reserve capacity. Each Capacity Block can have up to 64 instances, and you can have up to 256 instances across Capacity Blocks.
datetime
The earliest start date for the Capacity Block offering.
datetime
The latest end date for the Capacity Block offering.
integer
[REQUIRED]
The reservation duration for the Capacity Block, in hours. You must specify the duration in 1-day increments up 14 days, and in 7-day increments up to 182 days.
string
The token to use to retrieve the next page of results.
integer
The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
string
The EC2 UltraServer type of the Capacity Block offerings.
integer
The number of EC2 UltraServers in the offerings.
boolean
Include all Availability Zones and Local Zones, regardless of your opt-in status. If you do not use this parameter, the results include available offerings from all Availability Zones in the Amazon Web Services Region and Local Zones you are opted into.
dict
Response Syntax
{
'CapacityBlockOfferings': [
{
'CapacityBlockOfferingId': 'string',
'InstanceType': 'string',
'AvailabilityZone': 'string',
'InstanceCount': 123,
'StartDate': datetime(2015, 1, 1),
'EndDate': datetime(2015, 1, 1),
'CapacityBlockDurationHours': 123,
'UpfrontFee': 'string',
'CurrencyCode': 'string',
'Tenancy': 'default'|'dedicated',
'UltraserverType': 'string',
'UltraserverCount': 123,
'CapacityBlockDurationMinutes': 123,
'ZoneType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
CapacityBlockOfferings (list) --
The recommended Capacity Block offering for the dates specified.
(dict) --
The recommended Capacity Block that fits your search requirements.
CapacityBlockOfferingId (string) --
The ID of the Capacity Block offering.
InstanceType (string) --
The instance type of the Capacity Block offering.
AvailabilityZone (string) --
The Availability Zone of the Capacity Block offering.
InstanceCount (integer) --
The number of instances in the Capacity Block offering.
StartDate (datetime) --
The start date of the Capacity Block offering.
EndDate (datetime) --
The end date of the Capacity Block offering.
CapacityBlockDurationHours (integer) --
The number of hours (in addition to capacityBlockDurationMinutes) for the duration of the Capacity Block reservation. For example, if a Capacity Block starts at 04:55 and ends at 11:30, the hours field would be 6.
UpfrontFee (string) --
The total price to be paid up front.
CurrencyCode (string) --
The currency of the payment for the Capacity Block.
Tenancy (string) --
The tenancy of the Capacity Block.
UltraserverType (string) --
The EC2 UltraServer type of the Capacity Block offering.
UltraserverCount (integer) --
The number of EC2 UltraServers in the offering.
CapacityBlockDurationMinutes (integer) --
The number of minutes (in addition to capacityBlockDurationHours) for the duration of the Capacity Block reservation. For example, if a Capacity Block starts at 08:55 and ends at 11:30, the minutes field would be 35.
ZoneType (string) --
The type of zone where the Capacity Block offering is available.
NextToken (string) --
The token to use to retrieve the next page of results. This value is null when there are no more results to return.
{'CapacityBlockExtensions': {'ZoneType': 'string'}}
Purchase the Capacity Block extension for use with your account. You must specify the ID of the Capacity Block extension offering you are purchasing.
See also: AWS API Documentation
Request Syntax
client.purchase_capacity_block_extension(
CapacityBlockExtensionOfferingId='string',
CapacityReservationId='string',
DryRun=True|False
)
string
[REQUIRED]
The ID of the Capacity Block extension offering to purchase.
string
[REQUIRED]
The ID of the Capacity reservation to be extended.
boolean
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
dict
Response Syntax
{
'CapacityBlockExtensions': [
{
'CapacityReservationId': 'string',
'InstanceType': 'string',
'InstanceCount': 123,
'AvailabilityZone': 'string',
'AvailabilityZoneId': 'string',
'CapacityBlockExtensionOfferingId': 'string',
'CapacityBlockExtensionDurationHours': 123,
'CapacityBlockExtensionStatus': 'payment-pending'|'payment-failed'|'payment-succeeded',
'CapacityBlockExtensionPurchaseDate': datetime(2015, 1, 1),
'CapacityBlockExtensionStartDate': datetime(2015, 1, 1),
'CapacityBlockExtensionEndDate': datetime(2015, 1, 1),
'UpfrontFee': 'string',
'CurrencyCode': 'string',
'ZoneType': 'string'
},
]
}
Response Structure
(dict) --
CapacityBlockExtensions (list) --
The purchased Capacity Block extensions.
(dict) --
Describes a Capacity Block extension. With an extension, you can extend the duration of time for an existing Capacity Block.
CapacityReservationId (string) --
The reservation ID of the Capacity Block extension.
InstanceType (string) --
The instance type of the Capacity Block extension.
InstanceCount (integer) --
The number of instances in the Capacity Block extension.
AvailabilityZone (string) --
The Availability Zone of the Capacity Block extension.
AvailabilityZoneId (string) --
The Availability Zone ID of the Capacity Block extension.
CapacityBlockExtensionOfferingId (string) --
The ID of the Capacity Block extension offering.
CapacityBlockExtensionDurationHours (integer) --
The duration of the Capacity Block extension in hours.
CapacityBlockExtensionStatus (string) --
The status of the Capacity Block extension. A Capacity Block extension can have one of the following statuses:
payment-pending - The Capacity Block extension payment is processing. If your payment can't be processed within 12 hours, the Capacity Block extension is failed.
payment-failed - Payment for the Capacity Block extension request was not successful.
payment-succeeded - Payment for the Capacity Block extension request was successful. You receive an invoice that reflects the one-time upfront payment. In the invoice, you can associate the paid amount with the Capacity Block reservation ID.
CapacityBlockExtensionPurchaseDate (datetime) --
The date when the Capacity Block extension was purchased.
CapacityBlockExtensionStartDate (datetime) --
The start date of the Capacity Block extension.
CapacityBlockExtensionEndDate (datetime) --
The end date of the Capacity Block extension.
UpfrontFee (string) --
The total price to be paid up front.
CurrencyCode (string) --
The currency of the payment for the Capacity Block extension.
ZoneType (string) --
The type of zone where the Capacity Block extension is located.