From 564fca44405012a51c4b2ae01e3732e71c70ccff Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 10 Nov 2016 20:23:27 +0100 Subject: SONAR-8353 add WS api/webhooks/delivery --- .../java/org/sonarqube/ws/client/webhook/WebhooksService.java | 9 +++++++++ sonar-ws/src/main/protobuf/ws-webhooks.proto | 7 +++++++ 2 files changed, 16 insertions(+) (limited to 'sonar-ws') diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java index 67ee10aaf57..77cfa1eec94 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/webhook/WebhooksService.java @@ -24,12 +24,21 @@ import org.sonarqube.ws.client.BaseService; import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.WsConnector; +/** + * @since 6.2 + */ public class WebhooksService extends BaseService { public WebhooksService(WsConnector wsConnector) { super(wsConnector, "api/webhooks"); } + public Webhooks.DeliveryWsResponse delivery(String deliveryId) { + GetRequest httpRequest = new GetRequest(path("delivery")) + .setParam("deliveryId", deliveryId); + return call(httpRequest, Webhooks.DeliveryWsResponse.parser()); + } + /** * @throws org.sonarqube.ws.client.HttpException if HTTP status code is not 2xx. */ diff --git a/sonar-ws/src/main/protobuf/ws-webhooks.proto b/sonar-ws/src/main/protobuf/ws-webhooks.proto index 4ef519c3b9b..a7ef3a9ab2b 100644 --- a/sonar-ws/src/main/protobuf/ws-webhooks.proto +++ b/sonar-ws/src/main/protobuf/ws-webhooks.proto @@ -29,6 +29,11 @@ message DeliveriesWsResponse { repeated Delivery deliveries = 1; } +// WS api/webhooks/delivery +message DeliveryWsResponse { + optional Delivery delivery = 1; +} + message Delivery { optional string id = 1; optional string componentKey = 2; @@ -39,4 +44,6 @@ message Delivery { optional bool success = 7; optional int32 httpStatus = 8; optional int32 durationMs = 9; + optional string payload = 10; + optional string errorStacktrace = 11; } -- cgit v1.2.3