Class IpPermission
- java.lang.Object
-
- com.amazonaws.services.ec2.model.IpPermission
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class IpPermission extends Object implements Serializable, Cloneable
Describes a security group rule.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IpPermission()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IpPermission
clone()
boolean
equals(Object obj)
Integer
getFromPort()
The start of port range for the TCP and UDP protocols, or an ICMP type number.String
getIpProtocol()
List<String>
getIpRanges()
One or more IP ranges.List<PrefixListId>
getPrefixListIds()
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service.Integer
getToPort()
The end of port range for the TCP and UDP protocols, or an ICMP code.List<UserIdGroupPair>
getUserIdGroupPairs()
One or more security group and AWS account ID pairs.int
hashCode()
void
setFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP type number.void
setIpProtocol(String ipProtocol)
void
setIpRanges(Collection<String> ipRanges)
One or more IP ranges.void
setPrefixListIds(Collection<PrefixListId> prefixListIds)
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service.void
setToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP code.void
setUserIdGroupPairs(Collection<UserIdGroupPair> userIdGroupPairs)
One or more security group and AWS account ID pairs.String
toString()
Returns a string representation of this object; useful for testing and debugging.IpPermission
withFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP type number.IpPermission
withIpProtocol(String ipProtocol)
IpPermission
withIpRanges(String... ipRanges)
One or more IP ranges.IpPermission
withIpRanges(Collection<String> ipRanges)
One or more IP ranges.IpPermission
withPrefixListIds(PrefixListId... prefixListIds)
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service.IpPermission
withPrefixListIds(Collection<PrefixListId> prefixListIds)
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service.IpPermission
withToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP code.IpPermission
withUserIdGroupPairs(UserIdGroupPair... userIdGroupPairs)
One or more security group and AWS account ID pairs.IpPermission
withUserIdGroupPairs(Collection<UserIdGroupPair> userIdGroupPairs)
One or more security group and AWS account ID pairs.
-
-
-
Method Detail
-
setIpProtocol
public void setIpProtocol(String ipProtocol)
The IP protocol name (for
tcp
,udp
, andicmp
) or number (see Protocol Numbers).[EC2-VPC only] When you authorize or revoke security group rules, you can use
-1
to specify all.- Parameters:
ipProtocol
- The IP protocol name (fortcp
,udp
, andicmp
) or number (see Protocol Numbers).[EC2-VPC only] When you authorize or revoke security group rules, you can use
-1
to specify all.
-
getIpProtocol
public String getIpProtocol()
The IP protocol name (for
tcp
,udp
, andicmp
) or number (see Protocol Numbers).[EC2-VPC only] When you authorize or revoke security group rules, you can use
-1
to specify all.- Returns:
- The IP protocol name (for
tcp
,udp
, andicmp
) or number (see Protocol Numbers).[EC2-VPC only] When you authorize or revoke security group rules, you can use
-1
to specify all.
-
withIpProtocol
public IpPermission withIpProtocol(String ipProtocol)
The IP protocol name (for
tcp
,udp
, andicmp
) or number (see Protocol Numbers).[EC2-VPC only] When you authorize or revoke security group rules, you can use
-1
to specify all.- Parameters:
ipProtocol
- The IP protocol name (fortcp
,udp
, andicmp
) or number (see Protocol Numbers).[EC2-VPC only] When you authorize or revoke security group rules, you can use
-1
to specify all.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setFromPort
public void setFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of
-1
indicates all ICMP types.- Parameters:
fromPort
- The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of-1
indicates all ICMP types.
-
getFromPort
public Integer getFromPort()
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of
-1
indicates all ICMP types.- Returns:
- The start of port range for the TCP and UDP protocols, or an ICMP
type number. A value of
-1
indicates all ICMP types.
-
withFromPort
public IpPermission withFromPort(Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of
-1
indicates all ICMP types.- Parameters:
fromPort
- The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of-1
indicates all ICMP types.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setToPort
public void setToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of
-1
indicates all ICMP codes for the specified ICMP type.- Parameters:
toPort
- The end of port range for the TCP and UDP protocols, or an ICMP code. A value of-1
indicates all ICMP codes for the specified ICMP type.
-
getToPort
public Integer getToPort()
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of
-1
indicates all ICMP codes for the specified ICMP type.- Returns:
- The end of port range for the TCP and UDP protocols, or an ICMP
code. A value of
-1
indicates all ICMP codes for the specified ICMP type.
-
withToPort
public IpPermission withToPort(Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of
-1
indicates all ICMP codes for the specified ICMP type.- Parameters:
toPort
- The end of port range for the TCP and UDP protocols, or an ICMP code. A value of-1
indicates all ICMP codes for the specified ICMP type.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getUserIdGroupPairs
public List<UserIdGroupPair> getUserIdGroupPairs()
One or more security group and AWS account ID pairs.
- Returns:
- One or more security group and AWS account ID pairs.
-
setUserIdGroupPairs
public void setUserIdGroupPairs(Collection<UserIdGroupPair> userIdGroupPairs)
One or more security group and AWS account ID pairs.
- Parameters:
userIdGroupPairs
- One or more security group and AWS account ID pairs.
-
withUserIdGroupPairs
public IpPermission withUserIdGroupPairs(UserIdGroupPair... userIdGroupPairs)
One or more security group and AWS account ID pairs.
NOTE: This method appends the values to the existing list (if any). Use
setUserIdGroupPairs(java.util.Collection)
orwithUserIdGroupPairs(java.util.Collection)
if you want to override the existing values.- Parameters:
userIdGroupPairs
- One or more security group and AWS account ID pairs.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withUserIdGroupPairs
public IpPermission withUserIdGroupPairs(Collection<UserIdGroupPair> userIdGroupPairs)
One or more security group and AWS account ID pairs.
- Parameters:
userIdGroupPairs
- One or more security group and AWS account ID pairs.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getIpRanges
public List<String> getIpRanges()
One or more IP ranges.
- Returns:
- One or more IP ranges.
-
setIpRanges
public void setIpRanges(Collection<String> ipRanges)
One or more IP ranges.
- Parameters:
ipRanges
- One or more IP ranges.
-
withIpRanges
public IpPermission withIpRanges(String... ipRanges)
One or more IP ranges.
NOTE: This method appends the values to the existing list (if any). Use
setIpRanges(java.util.Collection)
orwithIpRanges(java.util.Collection)
if you want to override the existing values.- Parameters:
ipRanges
- One or more IP ranges.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withIpRanges
public IpPermission withIpRanges(Collection<String> ipRanges)
One or more IP ranges.
- Parameters:
ipRanges
- One or more IP ranges.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getPrefixListIds
public List<PrefixListId> getPrefixListIds()
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
- Returns:
- (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
-
setPrefixListIds
public void setPrefixListIds(Collection<PrefixListId> prefixListIds)
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
- Parameters:
prefixListIds
- (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
-
withPrefixListIds
public IpPermission withPrefixListIds(PrefixListId... prefixListIds)
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
NOTE: This method appends the values to the existing list (if any). Use
setPrefixListIds(java.util.Collection)
orwithPrefixListIds(java.util.Collection)
if you want to override the existing values.- Parameters:
prefixListIds
- (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withPrefixListIds
public IpPermission withPrefixListIds(Collection<PrefixListId> prefixListIds)
(Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.
- Parameters:
prefixListIds
- (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress request, this is the AWS service that you want to access through a VPC endpoint from instances associated with the security group.- 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 IpPermission clone()
-
-