Examples of accountApiInRegion()


Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

            .addHeader("X-Account-Meta-Apiname", "swift") //
            .addHeader("X-Account-Meta-Apiversion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Account account = api.accountApiInRegion("DFW").get();
         assertEquals(account.containerCount(), 3l);
         assertEquals(account.objectCount(), 42l);
         assertEquals(account.bytesUsed(), 323479l);
         for (Entry<String, String> entry : metadata.entrySet()) {
            assertEquals(account.metadata().get(entry.getKey().toLowerCase()), entry.getValue());
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

            .addHeader("X-Account-Meta-ApiName", "swift") //
            .addHeader("X-Account-Meta-ApiVersion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").updateMetadata(metadata));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest replaceRequest = server.takeRequest();
         assertEquals(replaceRequest.getRequestLine(),
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(accountResponse()));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").updateTemporaryUrlKey("foobar"));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest replaceRequest = server.takeRequest();
         assertEquals(replaceRequest.getRequestLine(),
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(accountResponse()));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").deleteMetadata(metadata));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest deleteRequest = server.takeRequest();
         assertEquals(deleteRequest.getRequestLine(),
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

            .addHeader("X-Account-Meta-Apiname", "swift") //
            .addHeader("X-Account-Meta-Apiversion", "v1.1"));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Account account = api.accountApiInRegion("DFW").get();
         assertEquals(account.containerCount(), 3l);
         assertEquals(account.objectCount(), 42l);
         assertEquals(account.bytesUsed(), 323479l);
         for (Entry<String, String> entry : metadata.entrySet()) {
            assertEquals(account.metadata().get(entry.getKey().toLowerCase()), entry.getValue());
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

            .addHeader("X-Account-Meta-ApiName", "swift") //
            .addHeader("X-Account-Meta-ApiVersion", "v1.1"));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").updateMetadata(metadata));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest replaceRequest = server.takeRequest();
         assertEquals(replaceRequest.getRequestLine(),
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(accountResponse());

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").updateTemporaryUrlKey("foobar"));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest replaceRequest = server.takeRequest();
         assertEquals(replaceRequest.getRequestLine(),
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

      server.enqueue(new MockResponse().setBody(accessRackspace));
      server.enqueue(accountResponse());

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").deleteMetadata(metadata));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest deleteRequest = server.takeRequest();
         assertEquals(deleteRequest.getRequestLine(),
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

            .addHeader(ACCOUNT_METADATA_PREFIX + "Apiname", "swift")
            .addHeader(ACCOUNT_METADATA_PREFIX + "Apiversion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         Account account = api.accountApiInRegion("DFW").get();
         assertEquals(account.getContainerCount(), 3l);
         assertEquals(account.getObjectCount(), 42l);
         assertEquals(account.getBytesUsed(), 323479l);
         for (Entry<String, String> entry : metadata.entrySet()) {
            assertEquals(account.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.SwiftApi.accountApiInRegion()

            .addHeader(ACCOUNT_METADATA_PREFIX + "ApiName", "swift")
            .addHeader(ACCOUNT_METADATA_PREFIX + "ApiVersion", "v1.1")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.accountApiInRegion("DFW").updateMetadata(metadata));

         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
        
         RecordedRequest replaceRequest = server.takeRequest();
View Full Code Here
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.