Package org.openstack.model.compute

Examples of org.openstack.model.compute.SecurityGroupRule


          newRule.setIpProtocol("tcp");
          newRule.setParentGroupId(createdSecurityGroup.getId());

          try {
            log.info("Creating security group rule for port: " + newRule.getToPort());
            SecurityGroupRule createdRule = computeClient.root().securityGroupRules().create(newRule);
          } catch (OpenstackException e) {
            String message = e.getMessage();
            if (message != null && message.contains("This rule already exists")) {
              log.warn("Ignoring 'rule already exists': " + e.getMessage());
            } else {
View Full Code Here


      Server server = machine.getServer();
      SecurityGroup securityGroup = openstackHelpers.getMachineSecurityGroup(openstackComputeClient, server);

      securityGroup = openstackComputeClient.root().securityGroups().securityGroup(securityGroup.getId()).show();

      SecurityGroupRule matchingRule = findMatchingRule(securityGroup);

      if (OpsContext.isConfigure()) {
        if (matchingRule == null) {
          CreateSecurityGroupRuleRequest rule = new CreateSecurityGroupRuleRequest();
          rule.setCidr("0.0.0.0/0");
View Full Code Here

TOP

Related Classes of org.openstack.model.compute.SecurityGroupRule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.