Package org.jclouds.compute.extensions
Interface SecurityGroupExtension
-
- All Known Implementing Classes:
AWSEC2SecurityGroupExtension
,AzureComputeSecurityGroupExtension
,CloudStackSecurityGroupExtension
,EC2SecurityGroupExtension
,NeutronSecurityGroupExtension
,NovaSecurityGroupExtension
,StubSecurityGroupExtension
public interface SecurityGroupExtension
An extension to compute service to allow for the manipulation ofSecurityGroup
s. Implementation is optional by providers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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)
List security groups in a given @{link Location}.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
supportsExclusionCidrBlocks()
Returns true if this SecurityGroupExtension supports exclusion CIDR groups.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.
-
-
-
Method Detail
-
listSecurityGroups
Set<SecurityGroup> listSecurityGroups()
List security groups.- Returns:
- The set of @{link SecurityGroup}s we have access to.
-
listSecurityGroupsInLocation
Set<SecurityGroup> listSecurityGroupsInLocation(Location location)
List security groups in a given @{link Location}.- Returns:
- The set of @{link SecurityGroup}s we have access to in the given location.
-
listSecurityGroupsForNode
Set<SecurityGroup> listSecurityGroupsForNode(String id)
List security groups for a given instance given the instance's ID.- Returns:
- The set of @{link SecurityGroup}s for the given instance..
-
getSecurityGroupById
SecurityGroup getSecurityGroupById(String id)
Get a security group by id.- Returns:
- The @{link SecurityGroup}, if it exists.
-
createSecurityGroup
SecurityGroup createSecurityGroup(String name, Location location)
Create a new @{link SecurityGroup} from the parameters given.- Parameters:
name
- The name of the security grouplocation
- The @{link Location} of the security group- Returns:
- The SecurityGroup that has been created.
-
removeSecurityGroup
boolean removeSecurityGroup(String id)
Remove an existing @{link SecurityGroup}, and its permissions.- Parameters:
id
- The id of the SecurityGroup to delete.- Returns:
- true if we were able to remove the group, false otherwise.
-
addIpPermission
SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group)
Add a @{link IpPermission} to an existing @{link SecurityGroup}. Applies the permission to the security group on the provider.- Parameters:
rule
- The IpPermission to add.group
- The SecurityGroup to add the permission to.- Returns:
- The SecurityGroup with the new permission added, after the permission has been applied on the provider.
-
removeIpPermission
SecurityGroup removeIpPermission(IpPermission ipPermission, SecurityGroup group)
Remove a @{link IpPermission} from an existing @{link SecurityGroup}. Removes the permission from the security group on the provider.- Parameters:
rule
- The IpPermission to remove.group
- The SecurityGroup to remove the permission from.- Returns:
- The SecurityGroup with the permission removed, after the permission has been removed on the provider.
-
addIpPermission
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. Applies the permission to the security group on the provider.- Parameters:
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.- Returns:
- The SecurityGroup with the new permission added, after the permission has been applied on the provider.
-
removeIpPermission
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. Removes the permission from the security group on the provider.- Parameters:
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.- Returns:
- The SecurityGroup with the permission removed, after the permission has been removed from the provider.
-
supportsTenantIdGroupNamePairs
boolean supportsTenantIdGroupNamePairs()
Returns true if this SecurityGroupExtension supports tenant ID + group name pairs.
-
supportsTenantIdGroupIdPairs
boolean supportsTenantIdGroupIdPairs()
Returns true if this SecurityGroupExtension supports tenant ID + group ID pairs.
-
supportsGroupIds
boolean supportsGroupIds()
Returns true if this SecurityGroupExtension supports group IDs.
-
supportsPortRangesForGroups
boolean supportsPortRangesForGroups()
Returns true if this SecurityGroupExtension supports port ranges for group authorization.
-
supportsExclusionCidrBlocks
@Beta boolean supportsExclusionCidrBlocks()
Returns true if this SecurityGroupExtension supports exclusion CIDR groups.
-
-