Class CreateDbCapacityReservationRequest
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<CreateDbCapacityReservationRequest.Builder,CreateDbCapacityReservationRequest>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionA list of Availability Zones for the reservation.builder()final IntegerThe number of DB instances to reserve in each Availability Zone that you list inAvailabilityZones.final LongThe length of the capacity commitment that you request for a future-dated reservation, in seconds.final StringThe name of the DB capacity reservation.final StringThe compute and memory capacity to reserve, for exampledb.m5.large.final InstantendDate()The date and time when the reservation expires, in Universal Coordinated Time (UTC).final Stringengine()The database engine to reserve capacity for.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) Used to retrieve the value of a field from any class that extendsSdkRequest.final booleanFor responses, this returns true if the service returned a value for the AvailabilityZones property.final inthashCode()final booleanhasTags()For responses, this returns true if the service returned a value for the Tags property.final StringThe license model to reserve capacity for.static Class<? extends CreateDbCapacityReservationRequest.Builder> final InstantThe date and time when the reservation starts, in Universal Coordinated Time (UTC).tags()Tags to assign to the DB capacity reservation.Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
dbCapacityReservationName
The name of the DB capacity reservation. This name must be unique for your Amazon Web Services account in the Amazon Web Services Region.
Constraints:
-
Must contain from 1 to 63 lowercase letters, digits, or hyphens.
-
First character must be a lowercase letter.
-
Can't end with a hyphen or contain two consecutive hyphens.
-
Can't contain more than 16 groups of characters separated by hyphens.
-
Can't begin with
dbcr-.
- Returns:
- The name of the DB capacity reservation. This name must be unique for your Amazon Web Services account in
the Amazon Web Services Region.
Constraints:
-
Must contain from 1 to 63 lowercase letters, digits, or hyphens.
-
First character must be a lowercase letter.
-
Can't end with a hyphen or contain two consecutive hyphens.
-
Can't contain more than 16 groups of characters separated by hyphens.
-
Can't begin with
dbcr-.
-
-
-
dbInstanceClass
The compute and memory capacity to reserve, for example
db.m5.large. Not all DB instance classes are available in all Amazon Web Services Regions, or for all database engines. For the full list of DB instance classes, and availability for your engine, see DB instance classes in the Amazon RDS User Guide.Constraints:
-
Must be a DB instance class that the specified
Enginesupports. -
For RDS for Oracle with
LicenseModelset tolicense-included, some DB instance classes aren't supported. Either choose a supported DB instance class, or setLicenseModeltobring-your-own-license.
- Returns:
- The compute and memory capacity to reserve, for example
db.m5.large. Not all DB instance classes are available in all Amazon Web Services Regions, or for all database engines. For the full list of DB instance classes, and availability for your engine, see DB instance classes in the Amazon RDS User Guide.Constraints:
-
Must be a DB instance class that the specified
Enginesupports. -
For RDS for Oracle with
LicenseModelset tolicense-included, some DB instance classes aren't supported. Either choose a supported DB instance class, or setLicenseModeltobring-your-own-license.
-
-
-
engine
The database engine to reserve capacity for.
Valid Values:
aurora-mysql|aurora-postgresql|mysql|postgres|mariadb|oracle-ee|oracle-ee-cdb|oracle-se2|oracle-se2-cdb|sqlserver-ee|sqlserver-se|sqlserver-web|sqlserver-ex|sqlserver-dev-ee|sqlserver-dev-se|db2-ae|db2-ce|db2-seThe Developer Edition engines
sqlserver-dev-eeandsqlserver-dev-sesupport no Multi-AZ DB instance and no read replica. Therefore, a reservation for either engine serves Single-AZ DB instances only.- Returns:
- The database engine to reserve capacity for.
Valid Values:
aurora-mysql|aurora-postgresql|mysql|postgres|mariadb|oracle-ee|oracle-ee-cdb|oracle-se2|oracle-se2-cdb|sqlserver-ee|sqlserver-se|sqlserver-web|sqlserver-ex|sqlserver-dev-ee|sqlserver-dev-se|db2-ae|db2-ce|db2-seThe Developer Edition engines
sqlserver-dev-eeandsqlserver-dev-sesupport no Multi-AZ DB instance and no read replica. Therefore, a reservation for either engine serves Single-AZ DB instances only.
-
capacityPerAvailabilityZone
The number of DB instances to reserve in each Availability Zone that you list in
AvailabilityZones. Amazon RDS reserves this number of DB instances in every listed Availability Zone.A Single-AZ DB instance uses one unit of reserved capacity, in one Availability Zone. A Multi-AZ DB instance is one DB instance, and it uses one unit of reserved capacity in each of two Availability Zones. Therefore, a Multi-AZ DB instance uses two units in total. A read replica uses one unit of reserved capacity, in the same way as any other DB instance.
Amazon RDS reserves capacity in each Availability Zone separately. Reserved capacity in one Availability Zone can't serve a DB instance in another Availability Zone. A request for a DB instance fails when the Availability Zone of the DB instance has no available capacity.
Therefore, set this value to the number of DB instances that you want to run at the same time in one Availability Zone. Don't set it to the number that you want in total.
This value multiplied by the number of Availability Zones counts against the DB instances quota for your Amazon Web Services account in the Amazon Web Services Region. Your existing DB instances, and the unused capacity of your other reservations, count against the same quota.
To find the value of the DB instances quota, see Quotas and constraints for Amazon RDS in the Amazon RDS User Guide.
Constraints:
-
Minimum 1.
- Returns:
- The number of DB instances to reserve in each Availability Zone that you list in
AvailabilityZones. Amazon RDS reserves this number of DB instances in every listed Availability Zone.A Single-AZ DB instance uses one unit of reserved capacity, in one Availability Zone. A Multi-AZ DB instance is one DB instance, and it uses one unit of reserved capacity in each of two Availability Zones. Therefore, a Multi-AZ DB instance uses two units in total. A read replica uses one unit of reserved capacity, in the same way as any other DB instance.
Amazon RDS reserves capacity in each Availability Zone separately. Reserved capacity in one Availability Zone can't serve a DB instance in another Availability Zone. A request for a DB instance fails when the Availability Zone of the DB instance has no available capacity.
Therefore, set this value to the number of DB instances that you want to run at the same time in one Availability Zone. Don't set it to the number that you want in total.
This value multiplied by the number of Availability Zones counts against the DB instances quota for your Amazon Web Services account in the Amazon Web Services Region. Your existing DB instances, and the unused capacity of your other reservations, count against the same quota.
To find the value of the DB instances quota, see Quotas and constraints for Amazon RDS in the Amazon RDS User Guide.
Constraints:
-
Minimum 1.
-
-
-
hasAvailabilityZones
public final boolean hasAvailabilityZones()For responses, this returns true if the service returned a value for the AvailabilityZones property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
availabilityZones
A list of Availability Zones for the reservation.
You can't change the Availability Zones of a reservation after you create it. Reserved capacity in an Availability Zone that no DB instance uses stays unused.
Constraints:
-
Must specify one or more Availability Zones.
-
Each Availability Zone can appear only once.
-
Each Availability Zone must be in the Amazon Web Services Region of the request.
-
Each Availability Zone must have capacity for the requested DB instance class.
-
Must include two or more Availability Zones to use the reservation for a Multi-AZ DB instance.
-
A DB instance can use reserved capacity only in an Availability Zone that its DB subnet group covers.
Example:
us-east-1aAttempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasAvailabilityZones()method.- Returns:
- A list of Availability Zones for the reservation.
You can't change the Availability Zones of a reservation after you create it. Reserved capacity in an Availability Zone that no DB instance uses stays unused.
Constraints:
-
Must specify one or more Availability Zones.
-
Each Availability Zone can appear only once.
-
Each Availability Zone must be in the Amazon Web Services Region of the request.
-
Each Availability Zone must have capacity for the requested DB instance class.
-
Must include two or more Availability Zones to use the reservation for a Multi-AZ DB instance.
-
A DB instance can use reserved capacity only in an Availability Zone that its DB subnet group covers.
Example:
us-east-1a -
-
-
endDate
The date and time when the reservation expires, in Universal Coordinated Time (UTC). If you don't specify a value, the reservation doesn't expire.
To change the expiration of an existing reservation, use
ModifyDBCapacityReservation. That operation takesEndDateTypealong withEndDate.Constraints:
-
Must be a date and time in the future.
-
For a future-dated reservation, must be at or after
StartDateplusCommitmentDuration. For example, a reservation that starts on 2026-12-01 with a 30-day commitment can't expire before 2026-12-31. To reserve capacity for one calendar month, setCommitmentDurationto 30 days or fewer, not to the length of the month.
Example:
2026-12-31T23:59:59Z- Returns:
- The date and time when the reservation expires, in Universal Coordinated Time (UTC). If you don't specify
a value, the reservation doesn't expire.
To change the expiration of an existing reservation, use
ModifyDBCapacityReservation. That operation takesEndDateTypealong withEndDate.Constraints:
-
Must be a date and time in the future.
-
For a future-dated reservation, must be at or after
StartDateplusCommitmentDuration. For example, a reservation that starts on 2026-12-01 with a 30-day commitment can't expire before 2026-12-31. To reserve capacity for one calendar month, setCommitmentDurationto 30 days or fewer, not to the length of the month.
Example:
2026-12-31T23:59:59Z -
-
-
startDate
The date and time when the reservation starts, in Universal Coordinated Time (UTC). Specify this parameter to create a future-dated reservation. If you don't specify a value, the reservation starts immediately.
A reservation that starts later always carries a capacity commitment. Therefore, a request that specifies
StartDatemust also meet every constraint of a future-dated reservation, including the minimum reserved capacity in each Availability Zone.Constraints:
-
Must be from 5 to 120 days in the future.
-
You must also specify
CommitmentDuration.
Example:
2026-12-01T00:00:00Z- Returns:
- The date and time when the reservation starts, in Universal Coordinated Time (UTC). Specify this
parameter to create a future-dated reservation. If you don't specify a value, the reservation starts
immediately.
A reservation that starts later always carries a capacity commitment. Therefore, a request that specifies
StartDatemust also meet every constraint of a future-dated reservation, including the minimum reserved capacity in each Availability Zone.Constraints:
-
Must be from 5 to 120 days in the future.
-
You must also specify
CommitmentDuration.
Example:
2026-12-01T00:00:00Z -
-
-
commitmentDuration
The length of the capacity commitment that you request for a future-dated reservation, in seconds. Amazon RDS measures this length from
StartDate.Amazon RDS can grant a shorter capacity commitment than you request. Therefore, read
CommitmentEndDateinCommitmentInfofor the commitment that Amazon RDS granted.The commitment doesn't end the reservation. Specify
EndDateto set an expiration date. You can't cancel a reservation in theactivestate during the commitment.Constraints:
-
Minimum 1209600, which is 14 days. For a
db.xDB instance class, such asdb.x2g.xlarge, the minimum is 7257600, which is 84 days. -
Must be less than 315576000, which is 10 years.
-
You must also specify
StartDate.
Example:
2592000- Returns:
- The length of the capacity commitment that you request for a future-dated reservation, in seconds. Amazon
RDS measures this length from
StartDate.Amazon RDS can grant a shorter capacity commitment than you request. Therefore, read
CommitmentEndDateinCommitmentInfofor the commitment that Amazon RDS granted.The commitment doesn't end the reservation. Specify
EndDateto set an expiration date. You can't cancel a reservation in theactivestate during the commitment.Constraints:
-
Minimum 1209600, which is 14 days. For a
db.xDB instance class, such asdb.x2g.xlarge, the minimum is 7257600, which is 84 days. -
Must be less than 315576000, which is 10 years.
-
You must also specify
StartDate.
Example:
2592000 -
-
-
licenseModel
The license model to reserve capacity for. Specify this parameter only for RDS for Microsoft SQL Server Enterprise Edition, Standard Edition, and Developer Edition, for RDS for Oracle, or for RDS for Db2 Standard Edition and Advanced Edition. Amazon RDS rejects the request for any other engine. This includes Amazon Aurora, the Web and Express editions of RDS for Microsoft SQL Server, and RDS for Db2 Community Edition.
Valid Values:
-
RDS for Microsoft SQL Server Enterprise Edition and Standard Edition -
license-included | bring-your-own-media -
RDS for Microsoft SQL Server Developer Edition -
bring-your-own-license -
RDS for Oracle -
bring-your-own-license | license-included -
RDS for Db2 Standard Edition and Advanced Edition -
bring-your-own-license | marketplace-license
A DB instance launches into the reservation only when the license model of the DB instance matches the license model of the reservation. For a reservation that holds no license model, Amazon RDS applies no license model check at launch.
For RDS for Microsoft SQL Server Enterprise Edition and Standard Edition, if you don't specify a value, Amazon RDS uses
license-included.For RDS for Microsoft SQL Server Developer Edition, if you don't specify a value, Amazon RDS uses
bring-your-own-license. That is the only license model that these engines accept, and Amazon RDS rejects any other value.For RDS for Oracle, if you don't specify a value, Amazon RDS uses the only orderable license model for the DB instance class. If more than one license model is orderable, you must specify one.
For RDS for Db2 Standard Edition and Advanced Edition, if you don't specify a value, Amazon RDS uses
bring-your-own-license. To reserve capacity for Db2 DB instances that you license through Amazon Web Services Marketplace, specifymarketplace-license.For RDS for Oracle, the license models that you can reserve depend on the engine and the DB instance class. RDS for Oracle Enterprise Edition doesn't support
license-included.- Returns:
- The license model to reserve capacity for. Specify this parameter only for RDS for Microsoft SQL Server
Enterprise Edition, Standard Edition, and Developer Edition, for RDS for Oracle, or for RDS for Db2
Standard Edition and Advanced Edition. Amazon RDS rejects the request for any other engine. This includes
Amazon Aurora, the Web and Express editions of RDS for Microsoft SQL Server, and RDS for Db2 Community
Edition.
Valid Values:
-
RDS for Microsoft SQL Server Enterprise Edition and Standard Edition -
license-included | bring-your-own-media -
RDS for Microsoft SQL Server Developer Edition -
bring-your-own-license -
RDS for Oracle -
bring-your-own-license | license-included -
RDS for Db2 Standard Edition and Advanced Edition -
bring-your-own-license | marketplace-license
A DB instance launches into the reservation only when the license model of the DB instance matches the license model of the reservation. For a reservation that holds no license model, Amazon RDS applies no license model check at launch.
For RDS for Microsoft SQL Server Enterprise Edition and Standard Edition, if you don't specify a value, Amazon RDS uses
license-included.For RDS for Microsoft SQL Server Developer Edition, if you don't specify a value, Amazon RDS uses
bring-your-own-license. That is the only license model that these engines accept, and Amazon RDS rejects any other value.For RDS for Oracle, if you don't specify a value, Amazon RDS uses the only orderable license model for the DB instance class. If more than one license model is orderable, you must specify one.
For RDS for Db2 Standard Edition and Advanced Edition, if you don't specify a value, Amazon RDS uses
bring-your-own-license. To reserve capacity for Db2 DB instances that you license through Amazon Web Services Marketplace, specifymarketplace-license.For RDS for Oracle, the license models that you can reserve depend on the engine and the DB instance class. RDS for Oracle Enterprise Edition doesn't support
license-included. -
-
-
hasTags
public final boolean hasTags()For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
tags
Tags to assign to the DB capacity reservation.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTags()method.- Returns:
- Tags to assign to the DB capacity reservation.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<CreateDbCapacityReservationRequest.Builder,CreateDbCapacityReservationRequest> - Specified by:
toBuilderin classRdsRequest- Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
public static Class<? extends CreateDbCapacityReservationRequest.Builder> serializableBuilderClass() -
hashCode
public final int hashCode()- Overrides:
hashCodein classAwsRequest
-
equals
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
Description copied from class:SdkRequestUsed to retrieve the value of a field from any class that extendsSdkRequest. The field name specified should match the member name from the corresponding service-2.json model specified in the codegen-resources folder for a given service. The class specifies what class to cast the returned value to. If the returned value is also a modeled class, theSdkRequest.getValueForField(String, Class)method will again be available.- Overrides:
getValueForFieldin classSdkRequest- Parameters:
fieldName- The name of the member to be retrieved.clazz- The class to cast the returned object to.- Returns:
- Optional containing the casted return value
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo- Returns:
- The mapping between the field name and its corresponding field.
-