Package org.jclouds.rackspace.autoscale.v1.domain

Examples of org.jclouds.rackspace.autoscale.v1.domain.GroupConfiguration


      try {
         AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides);
         GroupApi api = autoscaleApi.getGroupApiForZone("DFW");

         GroupConfiguration gc = GroupConfiguration.builder()
               .name("workers")
               .cooldown(60)
               .minEntities(5)
               .maxEntities(100)
               .metadata(ImmutableMap.of("firstkey", "this is a string", "secondkey", "1"))
View Full Code Here


      try {
         AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides);
         GroupApi api = autoscaleApi.getGroupApiForZone("DFW");

         GroupConfiguration gc = GroupConfiguration.builder()
               .name("workers")
               .cooldown(60)
               .minEntities(5)
               .maxEntities(100)
               .metadata(ImmutableMap.of("firstkey", "this is a string", "secondkey", "1"))
View Full Code Here

      for (String zone : api.getConfiguredZones()) {
         List<Group> createdGroupList = Lists.newArrayList();
         created.put(zone, createdGroupList);
         GroupApi groupApi = api.getGroupApiForZone(zone);

         GroupConfiguration groupConfiguration = GroupConfiguration.builder().maxEntities(10).cooldown(3)
               .name("testscalinggroup198547").minEntities(0)
               .metadata(ImmutableMap.of("gc_meta_key_2", "gc_meta_value_2", "gc_meta_key_1", "gc_meta_value_1"))
               .build();

         LaunchConfiguration launchConfiguration = LaunchConfiguration
View Full Code Here

      for (String zone : api.getConfiguredZones()) {
         List<Group> createdGroupList = Lists.newArrayList();
         created.put(zone, createdGroupList);
         GroupApi groupApi = api.getGroupApiForZone(zone);

         GroupConfiguration groupConfiguration = GroupConfiguration.builder().maxEntities(10).cooldown(360)
               .name("testscalinggroup198547").minEntities(0)
               .metadata(ImmutableMap.of("gc_meta_key_2", "gc_meta_value_2", "gc_meta_key_1", "gc_meta_value_1"))
               .build();

         LaunchConfiguration launchConfiguration = LaunchConfiguration
View Full Code Here

   @Test
   public void testGetGroupConfiguration() {
      for (String zone : api.getConfiguredZones()) {
         GroupApi groupApi = api.getGroupApiForZone(zone);
         String groupId = created.get(zone).get(0).getId();
         GroupConfiguration testGroupConfiguration = groupApi.getGroupConfiguration(groupId);
         assertEquals(testGroupConfiguration.getCooldown(), 360);
         assertEquals(testGroupConfiguration.getMaxEntities(), 10);
         assertEquals(testGroupConfiguration.getMinEntities(), 0);
      }
   }
View Full Code Here

   public void testUpdateGroupConfiguration() {
      for (String zone : api.getConfiguredZones()) {
         GroupApi groupApi = api.getGroupApiForZone(zone);
         String groupId = created.get(zone).get(0).getId();

         GroupConfiguration groupConfiguration = GroupConfiguration.builder().maxEntities(10).cooldown(360)
               .name("testscalinggroup198547").minEntities(0)
               .metadata(ImmutableMap.of("gc_meta_key_2", "gc_meta_value_2", "gc_meta_key_1", "gc_meta_value_1"))
               .build();

         boolean result = groupApi.updateGroupConfiguration(groupId, groupConfiguration);
View Full Code Here

      for (String zone : api.getConfiguredZones()) {
         List<Group> createdGroupList = Lists.newArrayList();
         created.put(zone, createdGroupList);
         GroupApi groupApi = api.getGroupApiForZone(zone);

         GroupConfiguration groupConfiguration = GroupConfiguration.builder().maxEntities(10).cooldown(3)
               .name("testscalinggroup198547").minEntities(0)
               .metadata(ImmutableMap.of("gc_meta_key_2", "gc_meta_value_2", "gc_meta_key_1", "gc_meta_value_1"))
               .build();

         LaunchConfiguration launchConfiguration = LaunchConfiguration
View Full Code Here

   }

   private void createPolicy() {
      System.out.format("Create Autoscale Group%n");

      GroupConfiguration groupConfiguration = GroupConfiguration.builder()
            .maxEntities(5)
            .cooldown(2)
            .name(NAME)
            .minEntities(0)
            .metadata(ImmutableMap.of("notes","This is an autoscale group for examples"))
View Full Code Here

            .personalities(personalities.build())
            .networks(networks.build())
            .type(LaunchConfigurationType.getByValue((String) launchConfigurationMap.get("type")).get())
            .build();

      GroupConfiguration groupConfiguration = GroupConfiguration.builder()
            .cooldown(((Double) groupConfigurationMap.get("cooldown")).intValue())
            .minEntities(((Double) groupConfigurationMap.get("minEntities")).intValue())
            .maxEntities(((Double) groupConfigurationMap.get("maxEntities")).intValue())
            .name((String) groupConfigurationMap.get("name"))
            .metadata((Map<String, String>) groupConfigurationMap.get("metadata"))
View Full Code Here

   @Override   
   public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {

      ImmutableMap<String, Object> launchConfigurationMap = ParseHelper.buildLaunchConfigurationRequestMap(postParams);
      GroupConfiguration groupConfiguration = (GroupConfiguration) postParams.get("groupConfiguration");
      ImmutableList<Map<String, Object>> scalingPoliciesList = ParseHelper.buildScalingPoliciesRequestList(postParams);

      return jsonBinder.bindToRequest(request, ImmutableMap.of(
            "launchConfiguration", launchConfigurationMap,
            "groupConfiguration", groupConfiguration,
View Full Code Here

TOP

Related Classes of org.jclouds.rackspace.autoscale.v1.domain.GroupConfiguration

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.