public class AWSEC2SecurityGroupExtension extends EC2SecurityGroupExtension
SecurityGroup
s. Implementation
is optional by providers.Modifier and Type | Field and Description |
---|---|
protected AWSEC2Api |
client |
protected com.google.common.base.Function<String,String> |
groupNameToId |
groupConverter, groupCreator, locations, namingConvention, regions, userExecutor
Constructor and Description |
---|
AWSEC2SecurityGroupExtension(AWSEC2Api client,
com.google.common.util.concurrent.ListeningExecutorService userExecutor,
com.google.common.base.Supplier<Set<String>> regions,
com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter,
com.google.common.base.Supplier<Set<? extends Location>> locations,
com.google.common.cache.LoadingCache<RegionAndName,String> groupCreator,
GroupNamingConvention.Factory namingConvention,
com.google.common.base.Function<String,String> groupNameToId) |
Modifier and Type | Method and Description |
---|---|
SecurityGroup |
addIpPermission(IpPermission ipPermission,
SecurityGroup group)
Add a @{link IpPermission} to an existing @{link SecurityGroup}.
|
SecurityGroup |
addIpPermission(IpProtocol protocol,
int startPort,
int endPort,
com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs,
Iterable<String> ipRanges,
Iterable<String> groupIds,
SecurityGroup group)
Add a @{link IpPermission} to an existing @{link SecurityGroup}, based on the parameters given.
|
SecurityGroup |
createSecurityGroup(String name,
String region) |
SecurityGroup |
getSecurityGroupById(String id)
Get a security group by id.
|
SecurityGroup |
removeIpPermission(IpPermission ipPermission,
SecurityGroup group)
Remove a @{link IpPermission} from an existing @{link SecurityGroup}.
|
SecurityGroup |
removeIpPermission(IpProtocol protocol,
int startPort,
int endPort,
com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs,
Iterable<String> ipRanges,
Iterable<String> groupIds,
SecurityGroup group)
Remove a @{link IpPermission} from an existing @{link SecurityGroup}, based on the parameters given.
|
boolean |
removeSecurityGroup(String id)
Remove an existing @{link SecurityGroup}, and its permissions.
|
boolean |
supportsTenantIdGroupIdPairs()
Returns true if this SecurityGroupExtension supports tenant ID + group ID pairs.
|
boolean |
supportsTenantIdGroupNamePairs()
Returns true if this SecurityGroupExtension supports tenant ID + group name pairs.
|
allSecurityGroupsInRegion, createSecurityGroup, findLocationWithId, listSecurityGroups, listSecurityGroupsForNode, listSecurityGroupsInLocation, listSecurityGroupsInLocation, pollSecurityGroups, pollSecurityGroupsByRegion, supportsExclusionCidrBlocks, supportsGroupIds, supportsPortRangesForGroups
protected final AWSEC2Api client
@Inject public AWSEC2SecurityGroupExtension(AWSEC2Api client, @Named(value="jclouds.user-threads") com.google.common.util.concurrent.ListeningExecutorService userExecutor, com.google.common.base.Supplier<Set<String>> regions, com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter, com.google.common.base.Supplier<Set<? extends Location>> locations, @Named(value="SECURITY") com.google.common.cache.LoadingCache<RegionAndName,String> groupCreator, GroupNamingConvention.Factory namingConvention, @Named(value="SECGROUP_NAME_TO_ID") com.google.common.base.Function<String,String> groupNameToId)
public SecurityGroup createSecurityGroup(String name, String region)
createSecurityGroup
in class EC2SecurityGroupExtension
public SecurityGroup getSecurityGroupById(String id)
SecurityGroupExtension
getSecurityGroupById
in interface SecurityGroupExtension
getSecurityGroupById
in class EC2SecurityGroupExtension
public boolean removeSecurityGroup(String id)
SecurityGroupExtension
removeSecurityGroup
in interface SecurityGroupExtension
removeSecurityGroup
in class EC2SecurityGroupExtension
id
- The id of the SecurityGroup to delete.public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group)
SecurityGroupExtension
addIpPermission
in interface SecurityGroupExtension
addIpPermission
in class EC2SecurityGroupExtension
group
- The SecurityGroup to add the permission to.public SecurityGroup addIpPermission(IpProtocol protocol, int startPort, int endPort, com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group)
SecurityGroupExtension
addIpPermission
in interface SecurityGroupExtension
addIpPermission
in class EC2SecurityGroupExtension
protocol
- The @{link IpProtocol} for the permission.startPort
- The first port in the range to be opened, or -1 for ICMP.endPort
- The last port in the range to be opened, or -1 for ICMP.tenantIdGroupNamePairs
- source of traffic allowed is on basis of another group in a tenant, as opposed to by cidripRanges
- An Iterable of Strings representing the IP range(s) the permission should allow.groupIds
- An Iterable of @{link SecurityGroup} IDs this permission should allow.group
- The SecurityGroup to add the permission to.public SecurityGroup removeIpPermission(IpPermission ipPermission, SecurityGroup group)
SecurityGroupExtension
removeIpPermission
in interface SecurityGroupExtension
removeIpPermission
in class EC2SecurityGroupExtension
group
- The SecurityGroup to remove the permission from.public SecurityGroup removeIpPermission(IpProtocol protocol, int startPort, int endPort, com.google.common.collect.Multimap<String,String> tenantIdGroupNamePairs, Iterable<String> ipRanges, Iterable<String> groupIds, SecurityGroup group)
SecurityGroupExtension
removeIpPermission
in interface SecurityGroupExtension
removeIpPermission
in class EC2SecurityGroupExtension
protocol
- The @{link IpProtocol} for the permission.startPort
- The first port in the range to be opened, or -1 for ICMP.endPort
- The last port in the range to be opened, or -1 for ICMP.tenantIdGroupNamePairs
- source of traffic allowed is on basis of another group in a tenant, as opposed to by cidripRanges
- An Iterable of Strings representing the IP range(s) the permission should allow.groupIds
- An Iterable of @{link SecurityGroup} IDs this permission should allow.group
- The SecurityGroup to remove the permission from.public boolean supportsTenantIdGroupNamePairs()
SecurityGroupExtension
supportsTenantIdGroupNamePairs
in interface SecurityGroupExtension
supportsTenantIdGroupNamePairs
in class EC2SecurityGroupExtension
public boolean supportsTenantIdGroupIdPairs()
SecurityGroupExtension
supportsTenantIdGroupIdPairs
in interface SecurityGroupExtension
supportsTenantIdGroupIdPairs
in class EC2SecurityGroupExtension
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.