Package org.jclouds.openstack.trove.v1.domain

Examples of org.jclouds.openstack.trove.v1.domain.User


      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         UserAdminApi userAdminApi = keystoneApi.getUserAdminApi().get();
         CreateUserOptions createUserOptions = CreateUserOptions.Builder.email("john.smith@example.org").enabled(true);
         User testUser = userAdminApi.create("jqsmith", "jclouds-password", createUserOptions);

         assertNotNull(testUser);
         assertEquals(testUser.getId(), "u1000");

         assertEquals(server.getRequestCount(), 3);
         assertAuthentication(server);
         assertExtensions(server);
         RecordedRequest createUserRequest = server.takeRequest();
View Full Code Here


      TokenApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/tokens/sometokenorother").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/token_details.json", APPLICATION_JSON)).build())
            .getTokenApi().get();
      User user = api.getUserOfToken("sometokenorother");
      assertNotNull(user);
      assertEquals(user, User.builder().id("2b9b606181634ae9ac86fd95a8bc2cde").name("admin")
            .roles(ImmutableSet.of(Role.builder().id("79cada5c02814b57a52e0eed4dd388cb").name("admin").build()))
            .build());
   }
View Full Code Here

      UserApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/users/e021dfd758eb44a89f1c57c8ef3be8e2").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/user_details.json", APPLICATION_JSON)).build())
            .getUserApi().get();
      User user = api.get("e021dfd758eb44a89f1c57c8ef3be8e2");
      assertNotNull(user);
      assertEquals(user, User.builder().name("nova").id("e021dfd758eb44a89f1c57c8ef3be8e2").email("nova@example.com").enabled(true).
            tenantId("ab1da202f5774cceb5da2aeff1f0aa87").build());
   }
View Full Code Here

      UserApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/v2.0/users?name=nova").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/user_details.json", APPLICATION_JSON)).build())
            .getUserApi().get();
      User user = api.getByName("nova");
      assertNotNull(user);
      assertEquals(user, User.builder().name("nova").id("e021dfd758eb44a89f1c57c8ef3be8e2").email("nova@example.com").enabled(true).
            tenantId("ab1da202f5774cceb5da2aeff1f0aa87").build());
   }
View Full Code Here

      UserApi userApi = api.getUserApi().get();
      Set<? extends User> users = userApi.list().concat().toSet();
      assertNotNull(users);
      assertFalse(users.isEmpty());
      for (User user : users) {
         User aUser = userApi.get(user.getId());
         assertEquals(aUser, user);
      }

   }
View Full Code Here

   public void testUsersByName() {

      UserApi userApi = api.getUserApi().get();
      for (User user : userApi.list().concat()) {
         User aUser = userApi.getByName(user.getName());
         assertEquals(aUser, user);
      }

   }
View Full Code Here

      Token result = tokenApi.get(token);
      assertNotNull(result);
      assertEquals(result.getId(), token);
      assertNotNull(result.getTenant());

      User user = tokenApi.getUserOfToken(token);
      assertNotNull(user);
      assertNotNull(user.getId());
      assertNotNull(user.getName());

   }
View Full Code Here

      assertEquals(flavor.getLinks().size(), 2);
   }
  
   public void testGetFlavorByAccountId() {
        URI endpoint = URI.create("http://172.16.0.1:8776/v1/3456/flavors/40806637803162");
        TroveApi redDwarfApi = requestsSendResponses(
               keystoneAuthWithUsernameAndPasswordAndTenantName,
               responseWithKeystoneAccess,
               authenticatedGET().endpoint(endpoint).build(),
               HttpResponse.builder().statusCode(200).payload(payloadFromResource("/flavor_list.json")).build() );
        FlavorApi api = redDwarfApi.getFlavorApiForZone("RegionOne");

        Set<? extends Flavor> flavors = api.list( redDwarfApi.getCurrentTenantId().get().getId() ).toSet();
        Flavor flavor = flavors.iterator().next();
        assertEquals(flavor.getName(), "512MB Instance");
        assertEquals(flavor.getId(), 1);
        assertEquals(flavor.getRam(), 512);
        assertEquals(flavor.getLinks().size(), 2);
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("rackspace-clouddatabases-us")
         .name("Rackspace Clouddatabases US")
         .apiMetadata(new TroveApiMetadata().toBuilder()
                  .identityName("${userName}")
                  .credentialName("${apiKey}")
                  .defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
                  .endpointName("identity service url ending in /v2.0/")
                  .documentation(URI.create("http://docs.rackspace.com/cbs/api/v1.0/cbs-devguide/content/overview.html"))
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder(){
         id("rackspace-clouddatabases-us")
         .name("Rackspace Clouddatabases US")
         .apiMetadata(new TroveApiMetadata().toBuilder()
                  .identityName("${userName}")
                  .credentialName("${apiKey}")
                  .defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
                  .endpointName("identity service url ending in /v2.0/")
                  .documentation(URI.create("http://docs.rackspace.com/cbs/api/v1.0/cbs-devguide/content/overview.html"))
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.trove.v1.domain.User

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.