}
public List<Firewall> getInstanceFirewallRules(String instanceUrl) throws OpsException {
List<Firewall> ret = Lists.newArrayList();
FirewallList firewalls;
try {
log.debug("Listing firewall rules");
firewalls = compute.firewalls().list(projectId).execute();
} catch (IOException e) {
throw new OpsException("Error listing firewalls", e);
}
// TODO: Use filter
if (firewalls.getItems() != null) {
for (Firewall firewall : firewalls.getItems()) {
if (firewall.getTargetTags() != null && firewall.getTargetTags().contains(instanceUrl)) {
ret.add(firewall);
}
}
}