Class Reservation
- java.lang.Object
-
- com.amazonaws.services.ec2.model.Reservation
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Reservation extends Object implements Serializable, Cloneable
Describes a reservation.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Reservation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Reservationclone()booleanequals(Object obj)List<String>getGroupNames()One or more security group names.List<GroupIdentifier>getGroups()[EC2-Classic only] One or more security groups.List<Instance>getInstances()One or more instances.StringgetOwnerId()The ID of the AWS account that owns the reservation.StringgetRequesterId()The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).StringgetReservationId()The ID of the reservation.inthashCode()voidsetGroupNames(Collection<String> groupNames)One or more security group names.voidsetGroups(Collection<GroupIdentifier> groups)[EC2-Classic only] One or more security groups.voidsetInstances(Collection<Instance> instances)One or more instances.voidsetOwnerId(String ownerId)The ID of the AWS account that owns the reservation.voidsetRequesterId(String requesterId)The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).voidsetReservationId(String reservationId)The ID of the reservation.StringtoString()Returns a string representation of this object; useful for testing and debugging.ReservationwithGroupNames(String... groupNames)One or more security group names.ReservationwithGroupNames(Collection<String> groupNames)One or more security group names.ReservationwithGroups(GroupIdentifier... groups)[EC2-Classic only] One or more security groups.ReservationwithGroups(Collection<GroupIdentifier> groups)[EC2-Classic only] One or more security groups.ReservationwithInstances(Instance... instances)One or more instances.ReservationwithInstances(Collection<Instance> instances)One or more instances.ReservationwithOwnerId(String ownerId)The ID of the AWS account that owns the reservation.ReservationwithRequesterId(String requesterId)The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).ReservationwithReservationId(String reservationId)The ID of the reservation.
-
-
-
Method Detail
-
setReservationId
public void setReservationId(String reservationId)
The ID of the reservation.
- Parameters:
reservationId- The ID of the reservation.
-
getReservationId
public String getReservationId()
The ID of the reservation.
- Returns:
- The ID of the reservation.
-
withReservationId
public Reservation withReservationId(String reservationId)
The ID of the reservation.
- Parameters:
reservationId- The ID of the reservation.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setOwnerId
public void setOwnerId(String ownerId)
The ID of the AWS account that owns the reservation.
- Parameters:
ownerId- The ID of the AWS account that owns the reservation.
-
getOwnerId
public String getOwnerId()
The ID of the AWS account that owns the reservation.
- Returns:
- The ID of the AWS account that owns the reservation.
-
withOwnerId
public Reservation withOwnerId(String ownerId)
The ID of the AWS account that owns the reservation.
- Parameters:
ownerId- The ID of the AWS account that owns the reservation.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setRequesterId
public void setRequesterId(String requesterId)
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
- Parameters:
requesterId- The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
-
getRequesterId
public String getRequesterId()
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
- Returns:
- The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
-
withRequesterId
public Reservation withRequesterId(String requesterId)
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).
- Parameters:
requesterId- The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getGroups
public List<GroupIdentifier> getGroups()
[EC2-Classic only] One or more security groups.
- Returns:
- [EC2-Classic only] One or more security groups.
-
setGroups
public void setGroups(Collection<GroupIdentifier> groups)
[EC2-Classic only] One or more security groups.
- Parameters:
groups- [EC2-Classic only] One or more security groups.
-
withGroups
public Reservation withGroups(GroupIdentifier... groups)
[EC2-Classic only] One or more security groups.
NOTE: This method appends the values to the existing list (if any). Use
setGroups(java.util.Collection)orwithGroups(java.util.Collection)if you want to override the existing values.- Parameters:
groups- [EC2-Classic only] One or more security groups.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withGroups
public Reservation withGroups(Collection<GroupIdentifier> groups)
[EC2-Classic only] One or more security groups.
- Parameters:
groups- [EC2-Classic only] One or more security groups.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getInstances
public List<Instance> getInstances()
One or more instances.
- Returns:
- One or more instances.
-
setInstances
public void setInstances(Collection<Instance> instances)
One or more instances.
- Parameters:
instances- One or more instances.
-
withInstances
public Reservation withInstances(Instance... instances)
One or more instances.
NOTE: This method appends the values to the existing list (if any). Use
setInstances(java.util.Collection)orwithInstances(java.util.Collection)if you want to override the existing values.- Parameters:
instances- One or more instances.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withInstances
public Reservation withInstances(Collection<Instance> instances)
One or more instances.
- Parameters:
instances- One or more instances.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getGroupNames
public List<String> getGroupNames()
One or more security group names.
- Returns:
- One or more security group names.
-
setGroupNames
public void setGroupNames(Collection<String> groupNames)
One or more security group names.
- Parameters:
groupNames- One or more security group names.
-
withGroupNames
public Reservation withGroupNames(String... groupNames)
One or more security group names.
NOTE: This method appends the values to the existing list (if any). Use
setGroupNames(java.util.Collection)orwithGroupNames(java.util.Collection)if you want to override the existing values.- Parameters:
groupNames- One or more security group names.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withGroupNames
public Reservation withGroupNames(Collection<String> groupNames)
One or more security group names.
- Parameters:
groupNames- One or more security group names.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public Reservation clone()
-
-