Class GlobalWebhooksResource
java.lang.Object
com.atlassian.jira.plugins.webhooks.rest.GlobalWebhooksResource
@Consumes("application/json")
@Produces("application/json")
@Path("webhooks")
public class GlobalWebhooksResource
extends Object
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGlobalWebhooksResource
(com.atlassian.sal.api.message.I18nResolver i18nResolver, com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer, com.atlassian.webhooks.WebhookService webhookService, com.atlassian.webhooks.history.InvocationHistoryService invocationHistoryService, WorkflowUtil workflowUtil, JqlValidator jqlValidator, JiraWebhookAuditingHandler auditingHandler) -
Method Summary
Modifier and TypeMethodDescriptionjavax.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
getTransitions
(int id, boolean statistics) javax.ws.rs.core.Response
getWebhook
(int webhookId, boolean statistics) Get a webhook by id.javax.ws.rs.core.Response
updateWebhook
(javax.ws.rs.core.UriInfo uriInfo, int webhookId, com.atlassian.webhooks.internal.rest.RestWebhook webhook) Update an existing webhook.
-
Field Details
-
PAGE_SIZE
- See Also:
-
-
Constructor Details
-
GlobalWebhooksResource
@Inject public GlobalWebhooksResource(com.atlassian.sal.api.message.I18nResolver i18nResolver, com.atlassian.sal.api.permission.PermissionEnforcer permissionEnforcer, com.atlassian.webhooks.WebhookService webhookService, com.atlassian.webhooks.history.InvocationHistoryService invocationHistoryService, WorkflowUtil workflowUtil, JqlValidator jqlValidator, JiraWebhookAuditingHandler auditingHandler)
-
-
Method Details
-
createWebhook
@POST public javax.ws.rs.core.Response createWebhook(@Context javax.ws.rs.core.UriInfo uriInfo, com.atlassian.webhooks.internal.rest.RestWebhook webhook) Create a webhook via the URL.The authenticated user must be an administrator to call this resource.
- Parameters:
webhook
- the webhook to be created
-
deleteWebhook
@DELETE @Path("/{webhookId}") public javax.ws.rs.core.Response deleteWebhook(@PathParam("webhookId") 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
@GET public javax.ws.rs.core.Response findWebhooks(@Context javax.ws.rs.core.UriInfo uriInfo, @QueryParam("event") List<String> events, @QueryParam("statistics") @DefaultValue("false") boolean statistics, @QueryParam("start") int start, @QueryParam("limit") @DefaultValue("10000") int limit) Find webhooks.The authenticated user must be an administrator to call this resource.
- Parameters:
events
- list ofWebhookEvent
ids to filter forstatistics
-true
if statistics should be provided for all found webhooks
-
getLatestInvocation
@GET @Path("/{webhookId}/latest") public javax.ws.rs.core.Response getLatestInvocation(@PathParam("webhookId") int webhookId, @QueryParam("event") String eventId, @QueryParam("outcome") 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
@GET @Path("/{webhookId}/statistics") public javax.ws.rs.core.Response getStatistics(@PathParam("webhookId") int webhookId, @QueryParam("event") 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
@GET @Path("/{webhookId}/statistics/summary") public javax.ws.rs.core.Response getStatisticsSummary(@PathParam("webhookId") 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
@GET @Path("/{webhookId}") public javax.ws.rs.core.Response getWebhook(@PathParam("webhookId") int webhookId, @QueryParam("statistics") @DefaultValue("false") boolean statistics) Get a webhook by id.The authenticated user must be an administrator to call this resource.
- Parameters:
webhookId
- id of the webhook
-
updateWebhook
@PUT @Path("/{webhookId}") public javax.ws.rs.core.Response updateWebhook(@Context javax.ws.rs.core.UriInfo uriInfo, @PathParam("webhookId") int webhookId, com.atlassian.webhooks.internal.rest.RestWebhook webhook) Update 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
-
getTransitions
@GET @Path("{id}/transitions") public javax.ws.rs.core.Response getTransitions(@PathParam("id") int id, @QueryParam("statistics") @DefaultValue("false") boolean statistics)
-