Package com.cloud.stack.models

Examples of com.cloud.stack.models.CloudStackSecurityGroupIngress


        for (EC2SecurityGroup group : groups) {
          CloudStackKeyValue pair = new CloudStackKeyValue();
          pair.setKeyValue(group.getAccount(), group.getName());
          secGroupList.add(pair);
        }
        CloudStackSecurityGroupIngress resp = null;
        if (ipPerm.getProtocol().equalsIgnoreCase("icmp")) {
          resp = getApi().authorizeSecurityGroupIngress(null, constructCIDRList(ipPerm.getIpRangeSet()), null, null,
              ipPerm.getToPort().toString(), ipPerm.getFromPort().toString(), ipPerm.getProtocol(), null,
              request.getName(), null, secGroupList);
        } else {
          resp = getApi().authorizeSecurityGroupIngress(null, constructCIDRList(ipPerm.getIpRangeSet()), null,
              ipPerm.getToPort().longValue(), null, null, ipPerm.getProtocol(), null, request.getName(),
              ipPerm.getFromPort().longValue(), secGroupList);
        }
        if (resp != null && resp.getRuleId() != null) {
          return true;
        }
        return false;
      }
    } catch(Exception e) {
View Full Code Here


        for (EC2SecurityGroup group : groups) {
          CloudStackKeyValue pair = new CloudStackKeyValue();
          pair.setKeyValue(group.getAccount(), group.getName());
          secGroupList.add(pair);
        }
        CloudStackSecurityGroupIngress resp = null;
        if (ipPerm.getProtocol().equalsIgnoreCase("icmp")) {
          resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null, null,
              ipPerm.getIcmpCode(), ipPerm.getIcmpType(), ipPerm.getProtocol(), null,
              request.getName(), null, secGroupList);
        } else {
          resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null,
              ipPerm.getToPort().longValue(), null, null, ipPerm.getProtocol(), null, request.getName(),
              ipPerm.getFromPort().longValue(), secGroupList);
        }
        if (resp != null && resp.getRuleId() != null) {
          return true;
        }
        return false;
      }
    } catch(Exception e) {
View Full Code Here

TOP

Related Classes of com.cloud.stack.models.CloudStackSecurityGroupIngress

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.