Package org.jclouds.cloudsigma2.binders

Examples of org.jclouds.cloudsigma2.binders.BindIPInfoToJsonRequest


   }

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

      JsonObject serverInfoJson = createTagRequestToJson.apply(create);
      request.setPayload(serverInfoJson.toString());
      request.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON);
      return request;
View Full Code Here


   @Test(dependsOnMethods = {"testCreateDrive"})
   public void testCreateTag() throws Exception {
      Map<String, String> meta = Maps.newHashMap();
      meta.put("description", "Test tag");

      Tag newTag = new Tag.Builder()
            .meta(meta)
            .name("Cloudsigma2 Test tag")
            .meta(Maps.<String, String>newHashMap())
            .resources(ImmutableList.of(
                  new TagResource.Builder()
View Full Code Here

   @Test(dependsOnMethods = {"testCreateTag"})
   public void testEditTag() throws Exception {
      Map<String, String> meta = Maps.newHashMap();
      meta.put("description", "test tag");

      Tag editedTag = new Tag.Builder().meta(meta).name("Edited tag")
            .resources(ImmutableList.of(new TagResource.Builder().uuid(createdDrive.getUuid()).build())).build();

      checkTag(editedTag, api.editTag(createdTag.getUuid(), editedTag));
   }
View Full Code Here

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

      Tag result = api.getTagInfo(uuid);
      assertNotNull(result);
   }
View Full Code Here

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

      Tag result = api.editTag(uuid,
            new Tag.Builder()
                  .name("TagCreatedWithResource")
                  .resources(ImmutableList.of(
                        new TagResource.Builder().uuid("61bcc398-c034-42f1-81c9-f6d7f62c4ea0").build()
                        , new TagResource.Builder().uuid("8ac6ac13-a55e-4b01-bcf4-5eed7b60a3ed").build()
View Full Code Here

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

      Tag result = api.createTag(new Tag.Builder()
            .name("TagCreatedWithResource")
            .resources(ImmutableList.of(
                  new TagResource.Builder().uuid("61bcc398-c034-42f1-81c9-f6d7f62c4ea0").build(),
                  new TagResource.Builder().uuid("8ac6ac13-a55e-4b01-bcf4-5eed7b60a3ed").build(),
                  new TagResource.Builder().uuid("3610d935-514a-4552-acf3-a40dd0a5f961").build(),
View Full Code Here

   @Test(dependsOnMethods = {"testCreateDrive"})
   public void testCreateTag() throws Exception {
      Map<String, String> meta = Maps.newHashMap();
      meta.put("description", "Test tag");

      Tag newTag = new Tag.Builder()
            .meta(meta)
            .name("Cloudsigma2 Test tag")
            .meta(Maps.<String, String>newHashMap())
            .resources(ImmutableList.of(
                  new TagResource.Builder()
View Full Code Here

   @Test(dependsOnMethods = {"testCreateTag"})
   public void testEditTag() throws Exception {
      Map<String, String> meta = Maps.newHashMap();
      meta.put("description", "test tag");

      Tag editedTag = new Tag.Builder().meta(meta).name("Edited tag")
            .resources(ImmutableList.of(new TagResource.Builder().uuid(createdDrive.getUuid()).build())).build();

      checkTag(editedTag, api.editTag(createdTag.getUuid(), editedTag));
   }
View Full Code Here

   }

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

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

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

      VLANInfo vlanInfo = new VLANInfo.Builder()
            .meta(meta)
            .build();

      if (api.listVLANs().size() > 0) {
         checkVlAN(vlanInfo, api.editVLAN(api.listVLANs().concat().get(0).getUuid(), vlanInfo));
View Full Code Here

TOP

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

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.