Class GlobalWebhooksResource
- java.lang.Object
-
- com.atlassian.confluence.plugins.restapi.resources.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.ResponsecreateWebhook(javax.ws.rs.core.UriInfo uriInfo, com.atlassian.webhooks.internal.rest.RestWebhook webhook)Create a webhook via the URL.javax.ws.rs.core.ResponsedeleteWebhook(int webhookId)Delete a webhook via the URL.javax.ws.rs.core.ResponsefindWebhooks(javax.ws.rs.core.UriInfo uriInfo, List<String> events, boolean statistics, int start, int limit)Find webhooks.javax.ws.rs.core.ResponsegetLatestInvocation(int webhookId, String eventId, Set<String> outcomes)Get the latest invocations for a specific webhook.javax.ws.rs.core.ResponsegetStatistics(int webhookId, String eventId)Get the statistics for a specific webhook.javax.ws.rs.core.ResponsegetStatisticsSummary(int webhookId)Get the statistics summary for a specific webhook.javax.ws.rs.core.ResponsegetWebhook(int webhookId, boolean statistics)Get a webhook by id.javax.ws.rs.core.ResponsetestWebhook(String url)Test connectivity to a specific endpoint.javax.ws.rs.core.ResponseupdateWebhook(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 ContentTooLongExceptionCreate 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 ofWebhookEventids to filter forstatistics-trueif 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 webhookeventId- 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 webhookeventId- 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 ContentTooLongExceptionUpdate an existing webhook.The authenticated user must be an administrator to call this resource.
- Parameters:
webhookId- the existing webhook idwebhook- the representation of the updated values for the webhook- Throws:
ContentTooLongException
-
-