Package org.jclouds.googlecomputeengine.options

Examples of org.jclouds.googlecomputeengine.options.FirewallOptions


      FirewallApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, request, insertFirewallResponse).getFirewallApiForProject("myproject");

      assertEquals(api.createInNetwork("myfw", URI.create("https://www.googleapis" +
              ".com/compute/v1beta13/projects/myproject/networks/default"),
              new FirewallOptions()
                      .addAllowedRule(Firewall.Rule.builder()
                              .IPProtocol(IPProtocol.TCP)
                              .addPort(22)
                              .addPortRange(23, 24).build())
                      .addSourceTag("tag1")
View Full Code Here


      FirewallApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, update,
              updateFirewallResponse).getFirewallApiForProject("myproject");

      assertEquals(api.update("myfw",
              new FirewallOptions()
                      .name("myfw")
                      .network(URI.create("https://www.googleapis" +
                              ".com/compute/v1beta13/projects/myproject/networks/default"))
                      .addAllowedRule(Firewall.Rule.builder()
                              .IPProtocol(IPProtocol.TCP)
View Full Code Here

      FirewallApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, update,
              updateFirewallResponse).getFirewallApiForProject("myproject");

      assertEquals(api.patch("myfw",
              new FirewallOptions()
                      .name("myfw")
                      .network(URI.create("https://www.googleapis" +
                              ".com/compute/v1beta13/projects/myproject/networks/default"))
                      .addAllowedRule(Firewall.Rule.builder()
                              .IPProtocol(IPProtocol.TCP)
View Full Code Here

      // need to create the network first
      assertOperationDoneSucessfully(api.getNetworkApiForProject(userProject.get()).createInIPv4Range
              (FIREWALL_NETWORK_NAME, IPV4_RANGE), TIME_WAIT);

      FirewallOptions firewall = new FirewallOptions()
              .addAllowedRule(
                      Firewall.Rule.builder()
                              .IPProtocol(IPProtocol.TCP)
                              .addPort(22).build())
              .addSourceRange("10.0.0.0/8")
View Full Code Here

   }

   @Test(groups = "live", dependsOnMethods = "testInsertFirewall")
   public void testUpdateFirewall() {

      FirewallOptions firewall = new FirewallOptions()
              .name(FIREWALL_NAME)
              .network(getNetworkUrl(userProject.get(),FIREWALL_NETWORK_NAME))
              .addSourceRange("10.0.0.0/8")
              .addSourceTag("tag1")
              .addTargetTag("tag2")
View Full Code Here

   }

   @Test(groups = "live", dependsOnMethods = "testUpdateFirewall")
   public void testPatchFirewall() {

      FirewallOptions firewall = new FirewallOptions()
              .name(FIREWALL_NAME)
              .network(getNetworkUrl(userProject.get(),FIREWALL_NETWORK_NAME))
              .allowedRules(ImmutableSet.of(
                      Firewall.Rule.builder()
                              .IPProtocol(IPProtocol.TCP)
View Full Code Here

   }

   @Test(groups = "live", dependsOnMethods = "testPatchFirewall")
   public void testGetFirewall() {

      FirewallOptions patchedFirewall = new FirewallOptions()
              .name(FIREWALL_NAME)
              .network(getNetworkUrl(userProject.get(), FIREWALL_NETWORK_NAME))
              .allowedRules(ImmutableSet.of(
                      Firewall.Rule.builder()
                              .IPProtocol(IPProtocol.TCP)
View Full Code Here

   /**
    * {@inheritDoc}
    */
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
      FirewallOptions options = (FirewallOptions) checkNotNull(postParams.get("options"), "firewallOptions");
      String name = (String) checkNotNull(postParams.get("name"), "name");
      URI network = (URI) checkNotNull(postParams.get("network"), "network");
      options.name(name);
      options.network(network);
      return bindToRequest(request, options);
   }
View Full Code Here

      }
      rules.add(tcpRule.build());
      rules.add(udpRule.build());


      FirewallOptions options = new FirewallOptions()
              .name(sharedResourceName)
              .network(network.getSelfLink())
              .sourceTags(templateOptions.getTags())
              .allowedRules(rules.build())
              .sourceRanges(of(DEFAULT_INTERNAL_NETWORK_RANGE, EXTERIOR_RANGE));
View Full Code Here

   /**
    * {@inheritDoc}
    */
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
      FirewallOptions options = (FirewallOptions) checkNotNull(postParams.get("options"), "firewallOptions");
      String name = (String) checkNotNull(postParams.get("name"), "name");
      URI network = (URI) checkNotNull(postParams.get("network"), "network");
      options.name(name);
      options.network(network);
      return bindToRequest(request, options);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.googlecomputeengine.options.FirewallOptions

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.