Package org.jclouds.cloudsigma2.binders

Examples of org.jclouds.cloudsigma2.binders.BindVLANToJsonRequest


   }

   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object input) {
      checkArgument(input instanceof FirewallPolicy, "this binder is only valid for FirewallPolicy!");
      FirewallPolicy create = FirewallPolicy.class.cast(input);
      JsonObject firewallJsonObject = policyJsonObjectFunction.apply(create);

      request.setPayload(firewallJsonObject.toString());
      request.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON);
      return request;
View Full Code Here


      }
   }

   @Test
   public void testCreateFirewallPolicy() throws Exception {
      FirewallPolicy newFirewallPolicy = new FirewallPolicy.Builder()
            .name("My awesome policy")
            .rules(ImmutableList.of(
                  new FirewallRule.Builder()
                        .action(FirewallAction.DROP)
                        .comment("Drop traffic from the VM to IP address 23.0.0.0/32")
View Full Code Here

      checkFirewallPolicy(newFirewallPolicy, createdFirewallPolicy);
   }

   @Test(dependsOnMethods = {"testCreateFirewallPolicy"})
   public void testEditFirewallPolicy() throws Exception {
      FirewallPolicy editedPolicy = new FirewallPolicy.Builder()
            .name("Edited policy")
            .rules(ImmutableList.of(
                  new FirewallRule.Builder()
                        .action(FirewallAction.ACCEPT)
                        .comment("Edited policy rule comment")
View Full Code Here

                  .build(),
            responseBuilder()
                  .payload(payloadFromResourceWithContentType("/fwpolicies-single.json", MediaType.APPLICATION_JSON))
                  .build());

      FirewallPolicy result = api.createFirewallPolicy(new FirewallPolicy.Builder()
            .name("My awesome policy")
            .rules(ImmutableList.of(
                  new FirewallRule.Builder()
                        .action(FirewallAction.DROP)
                        .comment("Drop traffic from the VM to IP address 23.0.0.0/32")
View Full Code Here

                  .build(),
            responseBuilder()
                  .payload(payloadFromResourceWithContentType("/fwpolicies-single.json", MediaType.APPLICATION_JSON))
                  .build());

      FirewallPolicy result = api.editFirewallPolicy(uuid,
            new FirewallPolicy.Builder()
                  .name("My awesome policy")
                  .rules(ImmutableList.of(
                        new FirewallRule.Builder()
                              .action(FirewallAction.DROP)
View Full Code Here

      }
   }

   @Test
   public void testCreateFirewallPolicy() throws Exception {
      FirewallPolicy newFirewallPolicy = new FirewallPolicy.Builder()
            .name("My awesome policy")
            .rules(ImmutableList.of(
                  new FirewallRule.Builder()
                        .action(FirewallAction.DROP)
                        .comment("Drop traffic from the VM to IP address 23.0.0.0/32")
View Full Code Here

      checkFirewallPolicy(newFirewallPolicy, createdFirewallPolicy);
   }

   @Test(dependsOnMethods = {"testCreateFirewallPolicy"})
   public void testEditFirewallPolicy() throws Exception {
      FirewallPolicy editedPolicy = new FirewallPolicy.Builder()
            .name("Edited policy")
            .rules(ImmutableList.of(
                  new FirewallRule.Builder()
                        .action(FirewallAction.ACCEPT)
                        .comment("Edited policy rule comment")
View Full Code Here

                  .build(),
            responseBuilder()
                  .payload(payloadFromResourceWithContentType("/fwpolicies-single.json", MediaType.APPLICATION_JSON))
                  .build());

      FirewallPolicy result = api.createFirewallPolicy(new FirewallPolicy.Builder()
            .name("My awesome policy")
            .rules(ImmutableList.of(
                  new FirewallRule.Builder()
                        .action(FirewallAction.DROP)
                        .comment("Drop traffic from the VM to IP address 23.0.0.0/32")
View Full Code Here

                  .build(),
            responseBuilder()
                  .payload(payloadFromResourceWithContentType("/fwpolicies-single.json", MediaType.APPLICATION_JSON))
                  .build());

      FirewallPolicy result = api.editFirewallPolicy(uuid,
            new FirewallPolicy.Builder()
                  .name("My awesome policy")
                  .rules(ImmutableList.of(
                        new FirewallRule.Builder()
                              .action(FirewallAction.DROP)
View Full Code Here

            .meta(meta)
            .name("test_acc_full_server")
            .nics(ImmutableList.of(
                  new NIC.Builder()
                        .firewallPolicy(null)
                        .ipV4Configuration(new IPConfiguration(IPConfigurationType.DHCP, null))
                        .ipV6Configuration(null)
                        .mac("22:a7:a0:0d:43:48")
                        .model(Model.VIRTIO)
                        .runtime(null)
                        .vlan(null)
View Full Code Here

TOP

Related Classes of org.jclouds.cloudsigma2.binders.BindVLANToJsonRequest

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.