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

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


   }

   @Test
   public void testUpdateWebhook() {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForGroupAndPolicyInZone(g.getId(), g.getScalingPolicies().iterator().next().getId(), zone);
         String webhookId = webhookApi.list().first().get().getId();
         assertTrue( webhookApi.update(webhookId, "updated_name", ImmutableMap.<String, Object>of()) );

         WebhookResponse webhook= webhookApi.get(webhookId);
         assertEquals(webhook.getName(), "updated_name");
View Full Code Here


   }

   @Test
   public void testGetWebhook() {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForGroupAndPolicyInZone(g.getId(), g.getScalingPolicies().iterator().next().getId(), zone);
         WebhookResponse webhookList = webhookApi.list().first().get();
         WebhookResponse webhookGet = webhookApi.get(webhookList.getId());
         assertNotNull(webhookList);
         assertNotNull(webhookGet);
         assertEquals(webhookList, webhookGet);
View Full Code Here

   }

   @Test
   public void testListWebhook() {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForGroupAndPolicyInZone(g.getId(), g.getScalingPolicies().iterator().next().getId(), zone);
         assertFalse( webhookApi.list().isEmpty() );
      }
   }
View Full Code Here

   }

   @Test
   public void testDeleteWebhook() {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForGroupAndPolicyInZone(g.getId(), g.getScalingPolicies().iterator().next().getId(), zone);
         WebhookResponse webhook = webhookApi.create("test1", ImmutableMap.<String, Object>of("notes", "test metadata")).first().get();

         assertEquals(webhook.getName(), "test1");
         assertEquals(webhook.getMetadata().get("notes"), "test metadata");
        
View Full Code Here

   }

   @Test
   public void testExecuteWebhook() throws IOException {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForGroupAndPolicyInZone(g.getId(), g.getScalingPolicies().iterator().next().getId(), zone);
         WebhookResponse webhook = webhookApi.create("test_execute", ImmutableMap.<String, Object>of("notes", "test metadata")).first().get();
        
         assertTrue( AutoscaleUtils.execute(webhook.getAnonymousExecutionURI().get()) , " for " + webhook + " in " + zone);
      }
   }
View Full Code Here

   }

   @Test
   public void testExecuteWebhookFail() throws IOException, URISyntaxException {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForGroupAndPolicyInZone(g.getId(), g.getScalingPolicies().iterator().next().getId(), zone);
         WebhookResponse webhook = webhookApi.create("test_execute_fail", ImmutableMap.<String, Object>of("notes", "test metadata")).first().get();
        
         URI uri = new URI(webhook.getAnonymousExecutionURI().toString() + "123");
         assertFalse( AutoscaleUtils.execute(uri) );
      }
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

      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

TOP

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

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.