Codota Logo
SecurityGroupApi.deleteRule
Code IndexAdd Codota to your IDE (free)

How to use
deleteRule
method
in
org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi

Best Java code snippets using org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi.deleteRule (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: io.fabric8/fabric-core-agent-jclouds

/**
 * Revokes access to the specified ports of the node, from the specified source.
 */
@Override
public void revoke(ComputeService service, NodeMetadata node, String source, int... ports) {
  String region = AWSUtils.parseHandle(node.getId())[0];
  Optional<? extends SecurityGroupApi> securityGroupApi = getSecurityGroup(service, region);
  if (securityGroupApi.isPresent()) {
    String groupName = "jclouds-" + node.getGroup();
    Optional<? extends SecurityGroup> securityGroup = getSecurityGroupForGroup(securityGroupApi.get(), groupName);
    if (securityGroup.isPresent()) {
      try {
        for (SecurityGroupRule rule : getAllRuleMatching(securityGroup.get(), source, ports)) {
          securityGroupApi.get().deleteRule(rule.getId());
        }
      } catch (IllegalStateException e) {
        //noop
      }
    }
  }
}
origin: io.fabric8/fabric-core-agent-jclouds

/**
 * Removes all rules.
 */
@Override
public void flush(ComputeService service, NodeMetadata node) {
  String region = AWSUtils.parseHandle(node.getId())[0];
  Optional<? extends SecurityGroupApi> securityGroupApi = getSecurityGroup(service, region);
  if (securityGroupApi.isPresent()) {
    String groupName = "jclouds-" + node.getGroup();
    Optional<? extends SecurityGroup> securityGroup = getSecurityGroupForGroup(securityGroupApi.get(), groupName);
    if (securityGroup.isPresent()) {
      try {
        for (SecurityGroupRule rule : securityGroup.get().getRules()) {
          securityGroupApi.get().deleteRule(rule.getId());
        }
      } catch (IllegalStateException e) {
        //noop
      }
    }
  }
  authorize(service, node, "0.0.0.0", 22);
}
origin: jclouds/legacy-jclouds

public void testDeleteSecurityGroupRuleWhenResponseIs2xx() throws Exception {
 HttpRequest deleteRule = HttpRequest.builder().method("DELETE").endpoint(
      URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-security-group-rules/161"))
      .headers(
          ImmutableMultimap.<String, String> builder().put("Accept", "*/*")
               .put("X-Auth-Token", authToken).build()).build();
 HttpResponse deleteRuleResponse = HttpResponse.builder().statusCode(202).build();
 NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
      responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteRule,
      deleteRuleResponse);
 assertTrue(apiWhenSecurityGroupsExist.getSecurityGroupExtensionForZone("az-1.region-a.geo-1").get()
      .deleteRule("161"));
}
origin: apache/jclouds

public void testDeleteSecurityGroupRuleWhenResponseIs2xx() throws Exception {
 HttpRequest deleteRule = HttpRequest.builder().method("DELETE").endpoint(
      URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/os-security-group-rules/161"))
      .headers(
          ImmutableMultimap.<String, String> builder().put("Accept", "application/json")
               .put("X-Auth-Token", authToken).build()).build();
 HttpResponse deleteRuleResponse = HttpResponse.builder().statusCode(202).build();
 NovaApi apiWhenSecurityGroupsExist = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
      responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, deleteRule,
      deleteRuleResponse);
 assertTrue(apiWhenSecurityGroupsExist.getSecurityGroupApi("az-1.region-a.geo-1").get()
      .deleteRule("161"));
}
origin: org.apache.jclouds.api/openstack-nova

      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
origin: com.amysta.jclouds.api/openstack-nova

      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
origin: io.cloudsoft.jclouds.api/openstack-nova

      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
origin: apache/jclouds

      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
      ruleStartPort(ipPermission.getFromPort()),
      ruleEndPort(ipPermission.getToPort())))) {
sgApi.get().deleteRule(rule.getId());
org.jclouds.openstack.nova.v2_0.extensionsSecurityGroupApideleteRule

Javadoc

Delete a Security Group Rule.

Popular methods of SecurityGroupApi

  • createRuleAllowingCidrBlock
    Create a Security Group Rule.
  • list
    List all Security Groups.
  • createWithDescription
    Create a Security Group
  • delete
    Delete a Security Group.
  • get
    Get a specific Security Group
  • createRuleAllowingSecurityGroupId
    Create a Security Group Rule.

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • findViewById (Activity)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now