Package org.jclouds.openstack.keystone.v2_0.domain

Examples of org.jclouds.openstack.keystone.v2_0.domain.Tenant


               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

   public void testTenantsByName() {

      TenantApi tenantApi = api.getTenantApi().get();

      for (Tenant tenant : tenantApi.list().concat()) {
         Tenant aTenant = tenantApi.getByName(tenant.getName());
         assertNotNull(aTenant, "get returned null for tenant: " + tenant);

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

    */
   public static void main(String[] args) throws IOException {
      CreateTenantAndUser createTenantAndUser = new CreateTenantAndUser(args[0], args[1], args[2], args[3]);

      try {
         Tenant tenant = createTenantAndUser.createTenant();
         createTenantAndUser.createUser(tenant);
      } catch (Exception e) {
         e.printStackTrace();
      } finally {
         createTenantAndUser.close();
View Full Code Here

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

         return tenant;
      } else {
View Full Code Here

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         TenantAdminApi tenantAdminApi = keystoneApi.getTenantAdminApi().get();
         CreateTenantOptions createTenantOptions = CreateTenantOptions.Builder.description("jclouds-description")
               .enabled(true);
         Tenant testTenant = tenantAdminApi.create("jclouds-tenant", createTenantOptions);

         assertNotNull(testTenant);
         assertEquals(testTenant.getId(), "t1000");

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

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         TenantAdminApi tenantAdminApi = keystoneApi.getTenantAdminApi().get();
         CreateTenantOptions createTenantOptions = CreateTenantOptions.Builder.description("jclouds-description")
               .enabled(true);
         Tenant testTenant = tenantAdminApi.create("jclouds-tenant", createTenantOptions);

         assertNull(testTenant);

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

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         TenantAdminApi tenantAdminApi = keystoneApi.getTenantAdminApi().get();
         UpdateTenantOptions updateTenantOptions = UpdateTenantOptions.Builder
               .description("jclouds-description-modified").enabled(false).name("jclouds-tenant-modified");
         Tenant updatedTenant = tenantAdminApi.update("t1000", updateTenantOptions);

         assertNotNull(updatedTenant);
         assertEquals(updatedTenant.getId(), "t1000");

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

      try {
         KeystoneApi keystoneApi = api(server.getUrl("/").toString(), "openstack-keystone");
         TenantAdminApi tenantAdminApi = keystoneApi.getTenantAdminApi().get();
         UpdateTenantOptions updateTenantOptions = UpdateTenantOptions.Builder
               .description("jclouds-description-modified").enabled(false).name("jclouds-tenant-modified");
         Tenant updatedTenant = tenantAdminApi.update("t1000", updateTenantOptions);

         assertNull(updatedTenant);

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

TOP

Related Classes of org.jclouds.openstack.keystone.v2_0.domain.Tenant

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.