Package org.jclouds.glacier.domain

Examples of org.jclouds.glacier.domain.InventoryRetrievalJobRequest$Builder


   }

   @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testUploadArchive", "testCompleteMultipartUpload"})
   public void testInitiateJob() {
      ArchiveRetrievalJobRequest archiveRetrieval = ArchiveRetrievalJobRequest.builder().archiveId(archiveId).build();
      InventoryRetrievalJobRequest inventoryRetrieval = InventoryRetrievalJobRequest.builder().build();
      archiveRetrievalJob = api.initiateJob(VAULT_NAME, archiveRetrieval);
      inventoryRetrievalJob = api.initiateJob(VAULT_NAME, inventoryRetrieval);
      assertThat(archiveRetrievalJob).isNotNull();
      assertThat(inventoryRetrievalJob).isNotNull();
   }
View Full Code Here


      String marker = "vyS0t2jHQe5qbcDggIeD50chS1SXwYMrkVKo0KHiTUjEYxBGCqRLKaiySzdN7QXGVVV5XZpNVG67pCZ_uykQXFMLaxOSu2hO_-5C0AtWMDrfo7LgVOyfnveDRuOSecUo3Ueq7K0";
      int limit = 10000;
      String startDate = "2013-12-04T21:25:42Z";
      String endDate = "2013-12-05T21:25:42Z";
      String format = "CSV";
      InventoryRetrievalJobRequest job = InventoryRetrievalJobRequest.builder()
            .format(format)
            .endDate(endDate)
            .startDate(startDate)
            .limit(limit)
            .marker(marker)
            .build();
      assertThat(client.initiateJob(VAULT_NAME, job)).isEqualTo(JOB_ID);

      RecordedRequest request = server.takeRequest();
      Json json = new GsonWrapper(new Gson());
      job = json.fromJson(new String(request.getBody()), InventoryRetrievalJobRequest.class);
      assertThat(job.getFormat()).isEqualTo(format);
      assertThat(job.getParameters().getMarker()).isEqualTo(marker);
      assertThat(job.getParameters().getLimit()).isEqualTo(limit);
      assertThat(job.getParameters().getStartDate()).isEqualTo(startDate);
      assertThat(job.getParameters().getEndDate()).isEqualTo(endDate);
      assertThat(job.getType()).isEqualTo("inventory-retrieval");

      assertEquals(request.getRequestLine(), "POST /-/vaults/examplevault/jobs HTTP/1.1");
   }
View Full Code Here

TOP

Related Classes of org.jclouds.glacier.domain.InventoryRetrievalJobRequest$Builder

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.