use of com.cloud.baremetal.networkservice.schema.SecurityGroupRule in project cloudstack by apache.
the class SecurityGroupHttpClient method generateRules.
private List<SecurityGroupRule> generateRules(final List<IpPortAndProto> ipps) {
List<SecurityGroupRule> rules = new ArrayList<SecurityGroupRule>(ipps.size());
for (SecurityGroupRulesCmd.IpPortAndProto ipp : ipps) {
SecurityGroupRule r = new SecurityGroupRule();
r.setProtocol(ipp.getProto());
r.setStartPort(ipp.getStartPort());
r.setEndPort(ipp.getEndPort());
for (String cidr : ipp.getAllowedCidrs()) {
r.getIp().add(cidr);
}
rules.add(r);
}
return rules;
}
Aggregations