describe_db_capacity_reservations
¶
describe_db_capacity_reservations(
*,
config_overrides: Optional[RDSClientConfig] = None,
db_capacity_reservation_identifier: Optional[
DBCapacityReservationIdentifier
] = None,
marker: Optional[String] = None,
max_records: Optional[MaxRecords] = None,
filters: Optional[FilterList] = None,
) -> DescribeDBCapacityReservationsResponse
Describes one or more DB capacity reservations. A DB capacity reservation reserves capacity for Amazon RDS DB instances in one or more Availability Zones.
If you don't specify a DBCapacityReservationIdentifier, this operation returns information about all DB capacity reservations for your Amazon Web Services account.
This operation supports pagination.
Parameters:
-
db_capacity_reservation_identifier(Optional[DBCapacityReservationIdentifier], default:None) –The identifier or the name of the DB capacity reservation to describe. You can specify the identifier, which has the prefix
dbcr-, or the reservation name. -
marker(Optional[String], default:None) –An optional pagination token provided by a previous
DescribeDBCapacityReservationsrequest. If this parameter is specified, the response includes only records beyond the marker, up to the value specified byMaxRecords. -
max_records(Optional[MaxRecords], default:None) –The maximum number of records to include in the response. If more records exist than the specified
MaxRecordsvalue, a pagination token called a marker is included in the response so that you can retrieve the remaining results.Default: 100
Constraints:
-
Must be a minimum of 20.
-
Can't exceed 100.
-
-
filters(Optional[FilterList], default:None) –A filter that specifies which DB capacity reservations to describe.
Supported filters:
-
db-capacity-reservation-name- Accepts DB capacity reservation names. The response includes only the reservations that these names identify. Use this filter to describe several reservations by name in one request. -
state- Accepts reservation states. The response includes only the reservations in these states. -
engine- Accepts database engine names. The response includes only the reservations that reserve capacity for these engines. -
db-instance-class- Accepts DB instance classes. The response includes only the reservations that reserve capacity for these DB instance classes. -
availability-zone- Accepts Availability Zone names. The response includes only the reservations that cover these Availability Zones.
When you specify more than one value for a filter, the response includes the reservations that match any of those values. When you specify more than one filter, the response includes only the reservations that match every filter.
Amazon RDS rejects the request when a filter name isn't in this list, or when a filter specifies no values.
The
statefilter doesn't acceptexpired. To find an expired reservation, compareEndDateagainst the current date and time. -
Raises:
-
DBCapacityReservationNotFoundFault–DBCapacityReservationIdentifierdoesn't refer to an existing DB capacity reservation. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To describe a DB capacity reservation The following example retrieves the details of the specified DB capacity reservation. The response reports the reserved capacity and the available capacity for each Availability Zone of the reservation.
>>> client.describe_db_capacity_reservations(db_capacity_reservation_identifier='dbcr-7hqk2m9xv4t1bn6cz3ws8dj5fp0gyr2a')
To list DB capacity reservations one page at a time
The following example lists the active DB capacity reservations for the AWS account, 20 records at a time. The Marker value comes from the response of the previous DescribeDBCapacityReservations request. Omit Marker for the first request. A Marker is an opaque token. Pass it back without any change, and don't parse it or build one yourself. A Marker expires 24 hours after Amazon RDS issues it. The Marker values in this example are shortened for readability.
>>> client.describe_db_capacity_reservations(filters=[{'Name': 'state', 'Values': ['active']}], max_records=20, marker='eyJ2ZXJzaW9uIjoxLCJ0b2tlbkRldGFpbCI6IkFRSUNBSGhWdjlWNG1RM3JLY0xwWjh0Mlh5RjdiTjB3UmpTNXVF...')
Source code in docs_src/capo_rds/_services/rds.py
5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 | |