Package org.jclouds.openstack.trove.v1.features

Examples of org.jclouds.openstack.trove.v1.features.FlavorApi


        
         if (status.equals(instance.getStatus())) {
            return true;
         }
         else {
            Instance instanceUpdated = instanceApi.get(instance.getId());
            checkNotNull(instanceUpdated, "Instance %s not found.", instance.getId());
           
            return status.equals(instanceUpdated.getStatus());
         }
      }
View Full Code Here


   private void createInstance(Flavor flavor) throws TimeoutException {
      System.out.format("Create Instance for Flavor: %s%n", flavor.getId());

      TroveUtils utils = new TroveUtils(troveApi);
      // This call will take a while - it ensures a working instance is created.
      Instance instance = utils.getWorkingInstance(ZONE, NAME, "" + flavor.getId(), 1);

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

      super.setup();
      TroveUtils utils = new TroveUtils(api);
      for (String zone : api.getConfiguredZones()) {
         // create instances
         List<Instance> instanceList = Lists.newArrayList();
         Instance first = utils.getWorkingInstance(zone, "first_database_testing_" + zone, "1", 1);
         Instance second = utils.getWorkingInstance(zone, "second_database_testing_" + zone, "1", 1);
         instanceList.add(first);
         instanceList.add(second);
         instancesToDelete.put(zone, instanceList);

         DatabaseApi databaseApiFirst = api.getDatabaseApiForZoneAndInstance(zone, first.getId());
         DatabaseApi databaseApiSecond = api.getDatabaseApiForZoneAndInstance(zone, second.getId());
         databaseApiFirst.create("livetest_db1");
         databaseApiFirst.create("livetest_db2");
         databaseApiSecond.create("livetest_db3");
      }
   }
View Full Code Here

         Instance second = utils.getWorkingInstance(zone, "second_user_trove_live_testing_" + zone, "1", 1);
         instanceList.add(first);
         instanceList.add(second);
         instancesToDelete.put(zone, instanceList);
         // create users
         User user1 = User.builder()
               .name("user1")
               .password(UUID.randomUUID().toString())
               .databases(ImmutableSet.of(
                     "u1db1",
                     "u1db2")).build();
         User user2 = User.builder()
               .name("user2")
               .password(UUID.randomUUID().toString())
               .databases(ImmutableSet.of(
                     "u2db1",
                     "u2db2")).build();
         User user3 = User.builder()
               .name("user3")
               .password(UUID.randomUUID().toString())
               .host("173.203.44.122")
               .databases(ImmutableSet.of(
                     "u3db1",
View Full Code Here

         for(Instance instance : instancesToDelete.get(zone)) {
            UserApi userApi = api.getUserApiForInstanceInZone(instance.getId(), zone);
            if(!instance.getName().contains("user_trove_live_testing"))continue;
            assertTrue(userApi.list().size() >=1);
            for(User user : userApi.list()){
               User userFromGet = userApi.get(user.getIdentifier());
               assertEquals(userFromGet.getName(), user.getName());
               assertEquals(userFromGet.getHost(), user.getHost());
               assertEquals(userFromGet.getIdentifier(), user.getIdentifier());
               assertEquals(userFromGet.getDatabases(), user.getDatabases());
               assertEquals(userFromGet, user);
            }
         } 
      }
   }
View Full Code Here

      databases2builder.add( "databaseB" );
      databases2builder.add( "databaseC" );
      Set<String> databases2 = databases2builder.build();
      Set<String> databases3 = Sets.newHashSet();
      databases3.add( "databaseD" );
      User user1 = User.builder().databases( databases1 ).name("dbuser1").password("password").build();
      User user2 = User.builder().databases( databases2 ).name("dbuser2").password("password").build();
      User user3 = User.builder().databases( databases3 ).name("dbuser3").password("password").host("192.168.64.64").build();
      Set<User> users = Sets.newHashSet();
      users.add(user1);
      users.add(user2);
      users.add(user3);
     
View Full Code Here

      databases2builder.add( "databaseB" );
      databases2builder.add( "databaseC" );
      Set<String> databases2 = databases2builder.build();
      Set<String> databases3 = Sets.newHashSet();
      databases3.add( "databaseD" );
      User user1 = User.builder().databases( databases1 ).name("dbuser1").password("password").build();
      User user2 = User.builder().databases( databases2 ).name("dbuser2").password("password").build();
      User user3 = User.builder().databases( databases3 ).name("dbuser3").password("password").host("192.168.64.64").build();
      Set<User> users = Sets.newHashSet();
      users.add(user1);
      users.add(user2);
      users.add(user3);
     
View Full Code Here

            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/user_get.json")).build()
      ).getUserApiForInstanceInZone("instanceId-1234-5678","RegionOne");

      User user = api.get("exampleuser");
      assertEquals(user.getName(), "exampleuser");
      assertEquals(user.getHost(), "%");
      assertEquals(user.getDatabases().size(), 2);
      assertEquals(user.getDatabases().iterator().next(), "databaseA");
   }
View Full Code Here

            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(404).payload(payloadFromResource("/user_get.json")).build()
      ).getUserApiForInstanceInZone("instanceId-1234-5678","RegionOne");

      User user = api.get("exampleuser");
      assertNull(user);
   }
View Full Code Here

            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/user_get_withhost.json")).build()
      ).getUserApiForInstanceInZone("instanceId-1234-5678","RegionOne");

      User user = api.get("example.user", "192.168.64.64");
      assertEquals(user.getName(), "example.user");
      assertEquals(user.getHost(), "192.168.64.64");
      assertEquals(user.getIdentifier(), "example.user@192.168.64.64");
      assertEquals(user.getDatabases().size(), 2);
      assertEquals(user.getDatabases().iterator().next(), "databaseA");
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.trove.v1.features.FlavorApi

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.