describe_db_capacity_reservations
async
¶
describe_db_capacity_reservations(
*,
config_overrides: Optional[AsyncRDSClientConfig] = 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.
>>> await 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.
>>> await client.describe_db_capacity_reservations(filters=[{'Name': 'state', 'Values': ['active']}], max_records=20, marker='eyJ2ZXJzaW9uIjoxLCJ0b2tlbkRldGFpbCI6IkFRSUNBSGhWdjlWNG1RM3JLY0xwWjh0Mlh5RjdiTjB3UmpTNXVF...')
Source code in docs_src/capo_rds/_services/async_rds.py
5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 | |