public class GlobalWebhooksResource extends Object
Constructor and Description |
---|
GlobalWebhooksResource(com.atlassian.sal.api.message.I18nResolver i18nResolver,
com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer,
OptionalServiceProvider optionalServiceProvider) |
Modifier and Type | Method and 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.
|
public GlobalWebhooksResource(com.atlassian.sal.api.message.I18nResolver i18nResolver, com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer, OptionalServiceProvider optionalServiceProvider)
public javax.ws.rs.core.Response createWebhook(@Context javax.ws.rs.core.UriInfo uriInfo, com.atlassian.webhooks.internal.rest.RestWebhook webhook) throws ContentTooLongException
The authenticated user must be an administrator to call this resource.
webhook
- the webhook to be createdContentTooLongException
public javax.ws.rs.core.Response deleteWebhook(int webhookId)
The authenticated user must be an administrator to call this resource.
webhookId
- the id of the webhook to be deleted.public javax.ws.rs.core.Response findWebhooks(@Context javax.ws.rs.core.UriInfo uriInfo, List<String> events, boolean statistics, int start, int limit)
The authenticated user must be an administrator to call this resource.
events
- list of WebhookEvent
ids to filter forstatistics
- true
if statistics should be provided for all found webhookspublic javax.ws.rs.core.Response getLatestInvocation(int webhookId, String eventId, Set<String> outcomes)
The authenticated user must be an administrator to call this resource.
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 consideredpublic javax.ws.rs.core.Response getStatistics(int webhookId, String eventId)
The authenticated user must be an administrator to call this resource.
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 consideredpublic javax.ws.rs.core.Response getStatisticsSummary(int webhookId)
The authenticated user must be an administrator to call this resource.
webhookId
- id of the webhookpublic javax.ws.rs.core.Response getWebhook(int webhookId, boolean statistics)
The authenticated user must be an administrator to call this resource.
webhookId
- id of the webhookpublic javax.ws.rs.core.Response testWebhook(String url) throws ContentTooLongException
The authenticated user must be an administrator to call this resource.
url
- the url in which to connect toContentTooLongException
public javax.ws.rs.core.Response updateWebhook(int webhookId, com.atlassian.webhooks.internal.rest.RestWebhook webhook) throws ContentTooLongException
The authenticated user must be an administrator to call this resource.
webhookId
- the existing webhook idwebhook
- the representation of the updated values for the webhookContentTooLongException
Copyright © 2003–2021 Atlassian. All rights reserved.