public class CloudStackSecurityGroupExtension extends Object implements SecurityGroupExtension
SecurityGroup
s. Implementation
is optional by providers.Modifier and Type | Field and Description |
---|---|
protected CloudStackApi |
api |
protected BlockUntilJobCompletesAndReturnResult |
blockUntilJobCompletesAndReturnResult |
protected com.google.common.base.Function<SecurityGroup,SecurityGroup> |
groupConverter |
protected com.google.common.cache.LoadingCache<ZoneAndName,SecurityGroup> |
groupCreator |
protected com.google.common.base.Predicate<String> |
jobComplete |
protected com.google.common.base.Supplier<Set<? extends Location>> |
locations |
protected GroupNamingConvention.Factory |
namingConvention |
Constructor and Description |
---|
CloudStackSecurityGroupExtension(CloudStackApi api,
com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter,
com.google.common.cache.LoadingCache<ZoneAndName,SecurityGroup> groupCreator,
GroupNamingConvention.Factory namingConvention,
com.google.common.base.Supplier<Set<? extends Location>> locations,
BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult,
com.google.common.base.Predicate<String> jobComplete) |
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,
Location location)
Create a new @{link SecurityGroup} from the parameters given.
|
SecurityGroup |
getSecurityGroupById(String id)
Get a security group by id.
|
Set<SecurityGroup> |
listSecurityGroups()
List security groups.
|
Set<SecurityGroup> |
listSecurityGroupsForNode(String id)
List security groups for a given instance given the instance's ID.
|
Set<SecurityGroup> |
listSecurityGroupsInLocation(Location location)
Note that for the time being, security groups are not scoped by location in
CloudStack, so this will simply return listSecurityGroups().
|
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 |
supportsGroupIds()
Returns true if this SecurityGroupExtension supports group IDs.
|
boolean |
supportsPortRangesForGroups()
Returns true if this SecurityGroupExtension supports port ranges for group authorization.
|
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.
|
protected final CloudStackApi api
protected final com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter
protected final com.google.common.cache.LoadingCache<ZoneAndName,SecurityGroup> groupCreator
protected final GroupNamingConvention.Factory namingConvention
protected final BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult
protected final com.google.common.base.Predicate<String> jobComplete
@Inject public CloudStackSecurityGroupExtension(CloudStackApi api, com.google.common.base.Function<SecurityGroup,SecurityGroup> groupConverter, com.google.common.cache.LoadingCache<ZoneAndName,SecurityGroup> groupCreator, GroupNamingConvention.Factory namingConvention, com.google.common.base.Supplier<Set<? extends Location>> locations, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult, com.google.common.base.Predicate<String> jobComplete)
public Set<SecurityGroup> listSecurityGroups()
SecurityGroupExtension
listSecurityGroups
in interface SecurityGroupExtension
public Set<SecurityGroup> listSecurityGroupsInLocation(Location location)
listSecurityGroupsInLocation
in interface SecurityGroupExtension
location
- public Set<SecurityGroup> listSecurityGroupsForNode(String id)
SecurityGroupExtension
listSecurityGroupsForNode
in interface SecurityGroupExtension
public SecurityGroup getSecurityGroupById(String id)
SecurityGroupExtension
getSecurityGroupById
in interface SecurityGroupExtension
public SecurityGroup createSecurityGroup(String name, Location location)
SecurityGroupExtension
createSecurityGroup
in interface SecurityGroupExtension
name
- The name of the security grouplocation
- The @{link Location} of the security grouppublic boolean removeSecurityGroup(String id)
SecurityGroupExtension
removeSecurityGroup
in interface SecurityGroupExtension
id
- The id of the SecurityGroup to delete.public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group)
SecurityGroupExtension
addIpPermission
in interface SecurityGroupExtension
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
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
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
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
public boolean supportsTenantIdGroupIdPairs()
SecurityGroupExtension
supportsTenantIdGroupIdPairs
in interface SecurityGroupExtension
public boolean supportsGroupIds()
SecurityGroupExtension
supportsGroupIds
in interface SecurityGroupExtension
public boolean supportsPortRangesForGroups()
SecurityGroupExtension
supportsPortRangesForGroups
in interface SecurityGroupExtension
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.