Package org.jclouds.rackspace.cloudfiles.v1.options

Examples of org.jclouds.rackspace.cloudfiles.v1.options.CreateContainerOptions


   }

   private void createContainer() {
      System.out.format("Create Container%n");

      CreateContainerOptions options = CreateContainerOptions.Builder
            .metadata(ImmutableMap.of("key1", "value1", "key2", "value2"));

      cloudFiles.getContainerApiForRegion(REGION).create(CONTAINER, options);

      System.out.format("  %s%n", CONTAINER);
View Full Code Here


   public void testCreateWithOptions() throws Exception {
      for (String regionId : regions) {
         ImmutableMultimap<String, String> headers =
               ImmutableMultimap.of(SwiftHeaders.STATIC_WEB_INDEX, "__index.html",
                                    SwiftHeaders.STATIC_WEB_ERROR, "__error.html");
         CreateContainerOptions opts = new CreateContainerOptions().headers(headers);

         assertNotNull(api.getContainerApi(regionId).create(name, opts));

         Container container = api.getContainerApi(regionId).get(name);
         assertNotNull(container);
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/cdn_container_list.json"))));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         CDNApi cdnApi = api.cdnApiInRegion("DFW");

         ImmutableList<CDNContainer> cdnContainers = cdnApi.list().toList();

         assertEquals(cdnContainers, mockContainers);
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         CDNApi cdnApi = api.cdnApiInRegion("DFW");

         List<CDNContainer> cdnContainers = cdnApi.list().toList();

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/cdn_container_list_at.json"))));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         ListContainerOptions options = ListContainerOptions.Builder.marker("cdn-container-3");
         ImmutableList<CDNContainer> containers = api.cdnApiInRegion("DFW").list(options).toList();

         for(CDNContainer container : containers) {
            assertCDNContainerNotNull(container);
         }
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         ListContainerOptions options = ListContainerOptions.Builder.marker("cdn-container-3");
         FluentIterable<CDNContainer> containers = api.cdnApiInRegion("DFW").list(options);

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "GET", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/?format=json&enabled_only=true&marker=cdn-container-3");
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(enabledResponse().setResponseCode(201)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         // enable a CDN Container
         URI enabledContainer = api.cdnApiInRegion("DFW").enable("container-1");
         assertNotNull(enabledContainer);

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/container-1");
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(enabledResponse().setResponseCode(404)));
      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");
         // enable a CDN Container
         assertNull(api.cdnApiInRegion("DFW").enable("container-1"));

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/container-1");
      } finally {
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(enabledResponse().setResponseCode(201)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         // enable a CDN Container with a TTL
         URI enabledContainer = api.cdnApiInRegion("DFW").enable("container-1", 777777);
         assertNotNull(enabledContainer);

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/container-1");
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(enabledResponse().setResponseCode(404)));

      try {
         CloudFilesApi api = api(server.getUrl("/").toString(), "rackspace-cloudfiles");

         // enable a CDN Container with a TTL
         URI enabledContainer = api.cdnApiInRegion("DFW").enable("container-1", 777777);
         assertNull(enabledContainer);

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/container-1");
View Full Code Here

TOP

Related Classes of org.jclouds.rackspace.cloudfiles.v1.options.CreateContainerOptions

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.