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 Reservation
clone()
boolean
equals(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.String
getOwnerId()
The ID of the AWS account that owns the reservation.String
getRequesterId()
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).String
getReservationId()
The ID of the reservation.int
hashCode()
void
setGroupNames(Collection<String> groupNames)
One or more security group names.void
setGroups(Collection<GroupIdentifier> groups)
[EC2-Classic only] One or more security groups.void
setInstances(Collection<Instance> instances)
One or more instances.void
setOwnerId(String ownerId)
The ID of the AWS account that owns the reservation.void
setRequesterId(String requesterId)
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).void
setReservationId(String reservationId)
The ID of the reservation.String
toString()
Returns a string representation of this object; useful for testing and debugging.Reservation
withGroupNames(String... groupNames)
One or more security group names.Reservation
withGroupNames(Collection<String> groupNames)
One or more security group names.Reservation
withGroups(GroupIdentifier... groups)
[EC2-Classic only] One or more security groups.Reservation
withGroups(Collection<GroupIdentifier> groups)
[EC2-Classic only] One or more security groups.Reservation
withInstances(Instance... instances)
One or more instances.Reservation
withInstances(Collection<Instance> instances)
One or more instances.Reservation
withOwnerId(String ownerId)
The ID of the AWS account that owns the reservation.Reservation
withRequesterId(String requesterId)
The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).Reservation
withReservationId(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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public Reservation clone()
-
-