Class GlobalWebhooksResource


  • public class GlobalWebhooksResource
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GlobalWebhooksResource​(com.atlassian.sal.api.message.I18nResolver i18nResolver, com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer, OptionalServiceProvider optionalServiceProvider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response createWebhook​(javax.ws.rs.core.UriInfo uriInfo, com.atlassian.webhooks.internal.rest.RestWebhook webhook)
      Create a webhook via the URL.
      javax.ws.rs.core.Response deleteWebhook​(int webhookId)
      Delete a webhook via the URL.
      javax.ws.rs.core.Response findWebhooks​(javax.ws.rs.core.UriInfo uriInfo, List<String> events, boolean statistics, int start, int limit)
      Find webhooks.
      javax.ws.rs.core.Response getLatestInvocation​(int webhookId, String eventId, Set<String> outcomes)
      Get the latest invocations for a specific webhook.
      javax.ws.rs.core.Response getStatistics​(int webhookId, String eventId)
      Get the statistics for a specific webhook.
      javax.ws.rs.core.Response getStatisticsSummary​(int webhookId)
      Get the statistics summary for a specific webhook.
      javax.ws.rs.core.Response getWebhook​(int webhookId, boolean statistics)
      Get a webhook by id.
      javax.ws.rs.core.Response testWebhook​(String url)
      Test connectivity to a specific endpoint.
      javax.ws.rs.core.Response updateWebhook​(int webhookId, com.atlassian.webhooks.internal.rest.RestWebhook webhook)
      Update an existing webhook.
    • Constructor Detail

      • GlobalWebhooksResource

        public GlobalWebhooksResource​(com.atlassian.sal.api.message.I18nResolver i18nResolver,
                                      com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer,
                                      OptionalServiceProvider optionalServiceProvider)
    • Method Detail

      • createWebhook

        public javax.ws.rs.core.Response createWebhook​(@Context
                                                       javax.ws.rs.core.UriInfo uriInfo,
                                                       com.atlassian.webhooks.internal.rest.RestWebhook webhook)
                                                throws ContentTooLongException
        Create a webhook via the URL.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhook - the webhook to be created
        Throws:
        ContentTooLongException
      • deleteWebhook

        public javax.ws.rs.core.Response deleteWebhook​(int webhookId)
        Delete a webhook via the URL.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhookId - the id of the webhook to be deleted.
      • findWebhooks

        public javax.ws.rs.core.Response findWebhooks​(@Context
                                                      javax.ws.rs.core.UriInfo uriInfo,
                                                      List<String> events,
                                                      boolean statistics,
                                                      int start,
                                                      int limit)
        Find webhooks.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        events - list of WebhookEvent ids to filter for
        statistics - true if statistics should be provided for all found webhooks
      • getLatestInvocation

        public javax.ws.rs.core.Response getLatestInvocation​(int webhookId,
                                                             String eventId,
                                                             Set<String> outcomes)
        Get the latest invocations for a specific webhook.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhookId - id of the webhook
        eventId - the string id of a specific event to retrieve the last invocation for.
        outcomes - the outcome to filter for. Can be SUCCESS, FAILURE, ERROR. None specified means that the all will be considered
      • getStatistics

        public javax.ws.rs.core.Response getStatistics​(int webhookId,
                                                       String eventId)
        Get the statistics for a specific webhook.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhookId - id of the webhook
        eventId - the string id of a specific event to retrieve the last invocation for. May be empty, in which case all events are considered
      • getStatisticsSummary

        public javax.ws.rs.core.Response getStatisticsSummary​(int webhookId)
        Get the statistics summary for a specific webhook.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhookId - id of the webhook
      • getWebhook

        public javax.ws.rs.core.Response getWebhook​(int webhookId,
                                                    boolean statistics)
        Get a webhook by id.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhookId - id of the webhook
      • testWebhook

        public javax.ws.rs.core.Response testWebhook​(String url)
                                              throws ContentTooLongException
        Test connectivity to a specific endpoint.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        url - the url in which to connect to
        Throws:
        ContentTooLongException
      • updateWebhook

        public javax.ws.rs.core.Response updateWebhook​(int webhookId,
                                                       com.atlassian.webhooks.internal.rest.RestWebhook webhook)
                                                throws ContentTooLongException
        Update an existing webhook.

        The authenticated user must be an administrator to call this resource.

        Parameters:
        webhookId - the existing webhook id
        webhook - the representation of the updated values for the webhook
        Throws:
        ContentTooLongException