Examples of WebHook


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

      try {
         AutoscaleApi autoscaleApi = api(server.getUrl("/").toString(), "rackspace-autoscale", overrides);
         WebhookApi api = autoscaleApi.getWebhookApiForZoneAndGroupAndPolicy("DFW", "1234567890", "321456");        

         Webhook webhook = api.get("5555");

         /*
          * Check request
          */
         assertAuthentication(server);
View Full Code Here

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

   @Test
   public void testCreateWebhook() {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForZoneAndGroupAndPolicy(zone, g.getId(), g.getScalingPolicies().iterator().next().getId());
         Webhook 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

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

         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForZoneAndGroupAndPolicy(zone, g.getId(), g.getScalingPolicies().iterator().next().getId());
         String webhookId = webhookApi.list().first().get().getId();
         assertTrue( webhookApi.update(webhookId, "updated_name", ImmutableMap.<String, Object>of()) );

         Webhook webhook = webhookApi.get(webhookId);
         assertEquals(webhook.getName(), "updated_name");
         assertTrue( webhook.getMetadata().isEmpty() );
      }
   }
View Full Code Here

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

         Group g = created.get(zone).get(0);
         WebhookApi webhookApi;
         boolean foundWebhook = false;
         for (ScalingPolicy sp :  g.getScalingPolicies()) {
            webhookApi = api.getWebhookApiForZoneAndGroupAndPolicy(zone, g.getId(), sp.getId());
            Webhook webhookResponse = webhookApi.list().first().get();
            if (webhookResponse != null) {
               Webhook webhookGet = webhookApi.get(webhookResponse.getId());
               assertEquals(webhookResponse, webhookGet);
               foundWebhook = true;
            }
         }
         assertTrue(foundWebhook, "No webhooks were found, and some were expected");
View Full Code Here

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

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

         assertEquals(webhook.getName(), "test1");
         assertEquals(webhook.getMetadata().get("notes"), "test metadata");
        
         assertTrue( webhookApi.delete(webhook.getId()) );
         assertNull( webhookApi.get(webhook.getId()) );
      }
   }
View Full Code Here

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

   @Test
   public void testExecuteWebhook() throws IOException {
      for (String zone : api.getConfiguredZones()) {
         Group g = created.get(zone).get(0);
         WebhookApi webhookApi = api.getWebhookApiForZoneAndGroupAndPolicy(zone, g.getId(), g.getScalingPolicies().iterator().next().getId());
         Webhook 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

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

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

Examples of org.zanata.model.WebHook

    }

    @Restrict("#{s:hasPermission(projectHome.instance, 'update')}")
    public void addWebHook(String url) {
        if (isValidUrl(url)) {
            WebHook webHook = new WebHook(this.getInstance(), url);
            getInstance().getWebHooks().add(webHook);
            update();
            FacesMessages.instance().add(StatusMessage.Severity.INFO,
                msgs.format("jsf.project.AddNewWebhook", webHook.getUrl()));
        }
    }
View Full Code Here

Examples of org.zanata.model.WebHook

        HProjectIteration version = Mockito.mock(HProjectIteration.class);
        HProject project = Mockito.mock(HProject.class);
        HDocument document = Mockito.mock(HDocument.class);

        webHooks = Lists.newArrayList();
        webHooks.add(new WebHook(project, "http://test.com"));
        webHooks.add(new WebHook(project, "http://test1.com"));

        when(projectIterationDAO.findById(versionId)).thenReturn(version);
        when(version.getProject()).thenReturn(project);
        when(version.getSlug()).thenReturn(versionSlug);
        when(project.getSlug()).thenReturn(projectSlug);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.