Tabnine Logo
SecurityGroupClient.deleteSecurityGroup
Code IndexAdd Tabnine to your IDE (free)

How to use
deleteSecurityGroup
method
in
org.jclouds.cloudstack.features.SecurityGroupClient

Best Java code snippets using org.jclouds.cloudstack.features.SecurityGroupClient.deleteSecurityGroup (Showing top 3 results out of 315)

origin: org.apache.provisionr/provisionr-cloudstack

public static void deleteByName(CloudStackClient cloudStackClient, String securityGroupName) {
  try {
    SecurityGroup securityGroup = getByName(cloudStackClient, securityGroupName);
    LOG.info("Deleting SecurityGroup {}", securityGroup.getName());
    cloudStackClient.getSecurityGroupClient().deleteSecurityGroup(securityGroup.getId());
  } catch (NoSuchElementException e) {
    LOG.warn("Exception retrieving SecurityGroup (most likely it does not yet exist){}: {}", securityGroupName, e);
  }
}
origin: jclouds/legacy-jclouds

@AfterGroups(groups = "live")
@Override
protected void tearDownContext() {
 if (vm != null) {
   assertTrue(jobComplete.apply(client.getVirtualMachineClient().destroyVirtualMachine(vm.getId())));
 }
 if (group != null) {
   for (IngressRule rule : group.getIngressRules())
    assertTrue(jobComplete.apply(client.getSecurityGroupClient().revokeIngressRule(rule.getId())), rule.toString());
   client.getSecurityGroupClient().deleteSecurityGroup(group.getId());
   assertEquals(client.getSecurityGroupClient().getSecurityGroup(group.getId()), null);
 }
 super.tearDownContext();
}
origin: jclouds/legacy-jclouds

@Test
public void testCreateDestroySecurityGroup() {
 try {
   zone = Iterables.find(client.getZoneClient().listZones(), new Predicate<Zone>() {
    @Override
    public boolean apply(Zone arg0) {
      return arg0.isSecurityGroupsEnabled();
    }
   });
   securityGroupsSupported = true;
   for (SecurityGroup securityGroup : client.getSecurityGroupClient().listSecurityGroups(
      ListSecurityGroupsOptions.Builder.named(prefix))) {
    for (IngressRule rule : securityGroup.getIngressRules())
      assertTrue(jobComplete.apply(client.getSecurityGroupClient().revokeIngressRule(rule.getId())), rule.toString());
    client.getSecurityGroupClient().deleteSecurityGroup(securityGroup.getId());
   }
   group = client.getSecurityGroupClient().createSecurityGroup(prefix);
   assertEquals(group.getName(), prefix);
   checkGroup(group);
   try {
    client.getSecurityGroupClient().createSecurityGroup(prefix);
    fail("Expected IllegalStateException");
   } catch (IllegalStateException e) {
   }
 } catch (NoSuchElementException e) {
   e.printStackTrace();
 }
}
org.jclouds.cloudstack.featuresSecurityGroupClientdeleteSecurityGroup

Javadoc

delete a specific security group by id

Popular methods of SecurityGroupClient

  • authorizeIngressICMPToCIDRs
    Authorizes a particular ICMP ingress rule for this security group
  • authorizeIngressPortsToCIDRs
    Authorizes a particular TCP or UDP ingress rule for this security group
  • createSecurityGroup
    Creates a security group
  • listSecurityGroups
    Lists security groups
  • revokeIngressRule
    Deletes a particular ingress rule from this security group
  • getSecurityGroup
    get a specific security group by id

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JList (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now