Package org.jclouds.cloudsigma2.domain

Examples of org.jclouds.cloudsigma2.domain.DriveInfo


   }

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

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


   }

   @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

TOP

Related Classes of org.jclouds.cloudsigma2.domain.DriveInfo

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.