Package com.google.api.services.compute.model

Examples of com.google.api.services.compute.model.FirewallList


  }

  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);
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.google.api.services.compute.model.FirewallList

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.