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

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


      this.jsonBinder = checkNotNull(jsonBinder, "jsonBinder");
   }

   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
      GroupConfiguration gc = (GroupConfiguration) postParams.get("groupConfiguration");
      Map<String, Object> gcMap = Maps.newHashMap();
      gcMap.put("name", gc.getName());
      gcMap.put("cooldown", gc.getCooldown());
      gcMap.put("minEntities", gc.getMinEntities());
      gcMap.put("maxEntities", gc.getMaxEntities());
      gcMap.put("metadata", gc.getMetadata());

      request.setPayload(jsonBinder.toJson(gcMap));
      request.getPayload().getContentMetadata().setContentType("application/json");
      return request;
   }
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

      this.jsonBinder = checkNotNull(jsonBinder, "jsonBinder");
   }

   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
      GroupConfiguration gc = (GroupConfiguration) postParams.get("groupConfiguration");
      Map<String, Object> gcMap = Maps.newHashMap();
      gcMap.put("name", gc.getName());
      gcMap.put("cooldown", gc.getCooldown());
      gcMap.put("minEntities", gc.getMinEntities());
      gcMap.put("maxEntities", gc.getMaxEntities());
      gcMap.put("metadata", gc.getMetadata());

      request.setPayload(jsonBinder.toJson(gcMap));
      request.getPayload().getContentMetadata().setContentType("application/json");
      return request;
   }
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

      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

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

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

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

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

TOP

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

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.