Package org.jclouds.openstack.keystone.v2_0.extensions

Examples of org.jclouds.openstack.keystone.v2_0.extensions.ServiceAdminApi


      assertEquals(users.get("users"), expectedUsers);
   }

   public void testParseUsers() throws JsonSyntaxException, IOException {
      String json = Strings2.toStringAndClose(getClass().getResourceAsStream("/user_list.json"));
      Users users = gson.fromJson(json, Users.class);
      assertEquals(users.toSet(), expectedUsers);
   }
View Full Code Here


      assertEquals(users.get("users"), expectedUsers);
   }

   public void testParseUsers() throws JsonSyntaxException, IOException {
      String json = Strings2.toStringAndClose(getClass().getResourceAsStream("/user_list.json"));
      Users users = gson.fromJson(json, Users.class);
      assertEquals(users.toSet(), expectedUsers);
   }
View Full Code Here

      if (tenantAdminApiExtension.isPresent()) {
         System.out.format("    TenantAdminApi is present%n");

         TenantAdminApi tenantAdminApi = tenantAdminApiExtension.get();
         CreateTenantOptions tenantOptions = CreateTenantOptions.Builder
               .description("My New Tenant");
         Tenant tenant = tenantAdminApi.create("newTenant", tenantOptions);

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

      if (userAdminApiExtension.isPresent()) {
         System.out.format("    UserAdminApi is present%n");

         UserAdminApi userAdminApi = userAdminApiExtension.get();
         CreateUserOptions userOptions = CreateUserOptions.Builder
               .tenant(tenant.getId())
               .email("new.email@example.com");
         User user = userAdminApi.create("newUser", "newPassword", userOptions);

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

            stringFromResource("/user_create_response.json"))));

      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");
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      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);

         assertNull(testUser);

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

            stringFromResource("/user_update_response.json"))));

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         UserAdminApi userAdminApi = keystoneApi.getUserAdminApi().get();
         UpdateUserOptions updateUserOptions = UpdateUserOptions.Builder.email("john.smith.renamed@example.org")
               .enabled(false).name("jqsmith-renamed").password("jclouds-password");
         User updatedUser = userAdminApi.update("u1000", updateUserOptions);

         assertNotNull(updatedUser);
         assertEquals(updatedUser.getId(), "u1000");
View Full Code Here

      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404)));

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         UserAdminApi userAdminApi = keystoneApi.getUserAdminApi().get();
         UpdateUserOptions updateUserOptions = UpdateUserOptions.Builder.email("john.smith.renamed@example.org")
               .enabled(false).name("jqsmith-renamed").password("jclouds-password");
         User updatedUser = userAdminApi.update("u1000", updateUserOptions);

         assertNull(updatedUser);
View Full Code Here

            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

            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

TOP

Related Classes of org.jclouds.openstack.keystone.v2_0.extensions.ServiceAdminApi

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.