Package org.jclouds.cloudsigma2.domain

Examples of org.jclouds.cloudsigma2.domain.Owner


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

      DriveInfo result = api.cloneLibraryDrive(uuid, new LibraryDrive.Builder()
            .media(org.jclouds.cloudsigma2.domain.MediaType.DISK)
            .name("test_drive_0")
            .size(new BigInteger("1024000000"))
            .allowMultimount(false)
            .build());
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

   }

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

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

   @Test
   public void testEditIP() throws Exception {
      Map<String, String> meta = Maps.newHashMap();
      meta.put("test", "test data");

      IPInfo ip = new IPInfo.Builder()
            .meta(meta)
            .build();

      if (api.listIPs().size() > 0) {
         checkIP(ip, api.editIP(api.listIPs().concat().get(0).getUuid(), ip));
View Full Code Here

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

      IPInfo result = api.getIPInfo(uuid);
      assertNotNull(result);
   }
View Full Code Here

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

      IPInfo result = api.editIP(uuid, new IPInfo.Builder().meta(meta).build());
      assertNotNull(result);
   }
View Full Code Here

TOP

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

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.