Package org.jclouds.openstack.keystone.v2_0

Examples of org.jclouds.openstack.keystone.v2_0.KeystoneApi


     
      String passwordOrSecretKey = input.credential;

      C creds = createCredentials(usernameOrAccessKey, passwordOrSecretKey);

      Access access;
      if (tenantId.isPresent()) {
         access = authenticateWithTenantId(tenantId, creds);
      } else if (tenantName.isPresent()) {
         access = authenticateWithTenantName(tenantName, creds);
      } else if (!requiresTenant) {
View Full Code Here


            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            HttpRequest.builder().method("GET").endpoint(endpoint + "/v2.0/").
            addHeader("Accept", APPLICATION_JSON).build(),
            HttpResponse.builder().statusCode(200).
                  payload(payloadFromResourceWithContentType("/raxVersion.json", APPLICATION_JSON)).build());
      ApiMetadata metadata = api.getApiMetadata();

      assertEquals(metadata, new ParseRackspaceApiMetadataTest().expected());
   }
View Full Code Here

*/
@Test(groups = "live", testName = "KeystoneApiLiveTest")
public class KeystoneApiLiveTest extends BaseKeystoneApiLiveTest {

   public void testGetApiMetaData() {
      ApiMetadata result = api.getApiMetadata();
      assertNotNull(result);
      assertNotNull(result.getId());
      assertNotNull(result.getStatus());
      assertNotNull(result.getUpdated());
   }
View Full Code Here

            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            HttpRequest.builder().method("GET").endpoint(endpoint + "/v2.0/").
            addHeader("Accept", APPLICATION_JSON).build(),
            HttpResponse.builder().statusCode(200).
                  payload(payloadFromResourceWithContentType("/raxVersion.json", APPLICATION_JSON)).build());
      ApiMetadata metadata = api.getApiMetadata();

      assertEquals(metadata, new ParseRackspaceApiMetadataTest().expected());
   }
View Full Code Here

*/
@Test(groups = "live", testName = "KeystoneApiLiveTest")
public class KeystoneApiLiveTest extends BaseKeystoneApiLiveTest {

   public void testGetApiMetaData() {
      ApiMetadata result = api.getApiMetadata();
      assertNotNull(result);
      assertNotNull(result.getId());
      assertNotNull(result.getStatus());
      assertNotNull(result.getUpdated());
   }
View Full Code Here

               responseWithKeystoneAccess,
               authenticatedGET().endpoint(endpoint + "/v2.0/tenants/013ba41150a14830bec85ffe93353bcc").build(),
               HttpResponse.builder().statusCode(200).payload(
                        payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build())
               .getTenantApi().get();
      Tenant tenant = api.get("013ba41150a14830bec85ffe93353bcc");
      assertNotNull(tenant);
      assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").build());
   }
View Full Code Here

               responseWithKeystoneAccess,
               authenticatedGET().endpoint(endpoint + "/v2.0/tenants?name=admin").build(),
               HttpResponse.builder().statusCode(200).payload(
                        payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build())
               .getTenantApi().get();
      Tenant tenant = api.getByName("admin");
      assertNotNull(tenant);
      assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").build());
   }
View Full Code Here

               responseWithKeystoneAccess,
               authenticatedGET().endpoint(endpoint + "/v2.0/tenants/013ba41150a14830bec85ffe93353bcc").build(),
               HttpResponse.builder().statusCode(200).payload(
                        payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build())
               .getTenantApi().get();
      Tenant tenant = api.get("013ba41150a14830bec85ffe93353bcc");
      assertNotNull(tenant);
      assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").build());
   }
View Full Code Here

               responseWithKeystoneAccess,
               authenticatedGET().endpoint(endpoint + "/v2.0/tenants?name=admin").build(),
               HttpResponse.builder().statusCode(200).payload(
                        payloadFromResourceWithContentType("/tenant_details.json", APPLICATION_JSON)).build())
               .getTenantApi().get();
      Tenant tenant = api.getByName("admin");
      assertNotNull(tenant);
      assertEquals(tenant, Tenant.builder().id("013ba41150a14830bec85ffe93353bcc").name("admin").build());
   }
View Full Code Here

      assertFalse(result.isEmpty());

      for (Tenant tenant : result) {
         assertNotNull(tenant.getId());

         Tenant aTenant = tenantApi.get(tenant.getId());
         assertNotNull(aTenant, "get returned null for tenant: " + tenant);

         assertEquals(aTenant, tenant);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.keystone.v2_0.KeystoneApi

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.