Examples of CreateContainerOptions


Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

   @BeforeClass(groups = "live")
   public void setup() {
      super.setup();
      for (String regionId : api.configuredRegions()) {
         boolean created = api.containerApiInRegion(regionId).createIfAbsent(containerName,
               new CreateContainerOptions());
         if (!created) {
            deleteAllObjectsInContainer(regionId, containerName);
         }
      }
      megOf1s = new byte[1024 * 1024];
 

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(new MockResponse().setResponseCode(201));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.containerApiInRegion("DFW").createIfAbsent("myContainer", new CreateContainerOptions()));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest createRequest = server.takeRequest();
         assertEquals(createRequest.getRequestLine(),

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(new MockResponse().setResponseCode(202));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertFalse(api.containerApiInRegion("DFW").createIfAbsent("myContainer", new CreateContainerOptions()));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest createRequest = server.takeRequest();
         assertEquals(createRequest.getRequestLine(),

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

   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.getContainerApiForRegion(regionId).create(name, opts));

         Container container = api.getContainerApiForRegion(regionId).get(name);
         assertNotNull(container);

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

      Multimap<String, String> enableStaticWebHeaders =
            ImmutableMultimap.of(STATIC_WEB_INDEX, FILENAME + SUFFIX,
                                 STATIC_WEB_ERROR, "error.html");

      CreateContainerOptions opts = new CreateContainerOptions().headers(enableStaticWebHeaders);
      cloudFiles.getContainerApiForRegion(REGION).create(CONTAINER_PUBLISH, opts);

      System.out.format("  %s%n", CONTAINER_PUBLISH);
   }

Examples of org.jclouds.openstack.swift.v1.options.CreateContainerOptions

      Multimap<String, String> headers = ImmutableMultimap.of(
            "Access-Control-Allow-Origin", "*",
            "Access-Control-Max-Age", "600",
            "Access-Control-Allow-Headers", "X-My-Header");
      CreateContainerOptions options = CreateContainerOptions.Builder.headers(headers);

      containerApi.create(CONTAINER, options);
      System.out.format("  %s%n", CONTAINER);

      Container container = containerApi.get(CONTAINER);

Examples of org.jclouds.openstack.swift.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);

Examples of org.jclouds.snia.cdmi.v1.options.CreateContainerOptions

      pDataObjectMetaDataIn.put("dataObjectkey3", "value3");

      Payload payloadIn;
      Payload payloadOut;

      CreateContainerOptions pCreateContainerOptions = CreateContainerOptions.Builder.metadata(pContainerMetaDataIn);
      ContainerApi containerApi = cdmiContext.getApi().getApi();
      DataApi dataApi = cdmiContext.getApi().getDataApiForContainer(containerName);
      DataNonCDMIContentTypeApi dataNonCDMIContentTypeApi = cdmiContext.getApi()
               .getDataNonCDMIContentTypeApiForContainer(containerName);
      Logger.getAnonymousLogger().info("create: " + containerName);

Examples of org.jclouds.snia.cdmi.v1.options.CreateContainerOptions

      Map<String, String> pDataObjectMetaDataIn = Maps.newLinkedHashMap();
      pDataObjectMetaDataIn.put("dataObjectkey1", "value1");
      pDataObjectMetaDataIn.put("dataObjectkey2", "value2");
      pDataObjectMetaDataIn.put("dataObjectkey3", "value3");

      CreateContainerOptions pCreateContainerOptions = CreateContainerOptions.Builder.metadata(pContainerMetaDataIn);
      ContainerApi containerApi = cdmiContext.getApi().getApi();
      DataApi dataApi = cdmiContext.getApi().getDataApiForContainer(containerName);
      Logger.getAnonymousLogger().info("create: " + containerName);
      Container container = containerApi.create(containerName, pCreateContainerOptions);
      try {

Examples of org.jclouds.snia.cdmi.v1.options.CreateContainerOptions

      Map<String, String> pDataObjectMetaDataIn = Maps.newLinkedHashMap();
      pDataObjectMetaDataIn.put("dataObjectkey1", "value1");
      pDataObjectMetaDataIn.put("dataObjectkey2", "value2");
      pDataObjectMetaDataIn.put("dataObjectkey3", "value3");

      CreateContainerOptions pCreateContainerOptions = CreateContainerOptions.Builder.metadata(pContainerMetaDataIn);
      ContainerApi containerApi = cdmiContext.getApi().getApi();
      DataApi dataApi = cdmiContext.getApi().getDataApiForContainer(containerName);
      Logger.getAnonymousLogger().info("create: " + containerName);
      Container container = containerApi.create(containerName, pCreateContainerOptions);
      try {
TOP
Copyright © 2018 www.massapi.com. 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.