From ba0c6580d597bde773d652446131d1132f7d8e9d Mon Sep 17 00:00:00 2001 From: Siddhanttimeline Date: Tue, 1 Oct 2024 12:24:23 +0530 Subject: [PATCH] fix name --- .../bundles/changeEvent/generic/GenericPublisher.java | 2 +- .../org/openmetadata/service/util/SubscriptionUtil.java | 8 ++++---- .../main/resources/json/schema/entity/events/webhook.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java index 67de328877ab..9a280ad0c772 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/generic/GenericPublisher.java @@ -119,7 +119,7 @@ private void prepareAndSendMessage(String json, Invocation.Builder target) { headers.forEach(target::header); } - Webhook.HttpOperation httpOperation = webhook.getHttpOperation(); + Webhook.HttpMethod httpOperation = webhook.getHttpMethod(); postWebhookMessage(this, target, json, httpOperation); } } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java index e81210b6d33f..25183c8217e9 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java @@ -417,18 +417,18 @@ public static Invocation.Builder appendHeadersToTarget(Client client, String uri public static void postWebhookMessage( Destination destination, Invocation.Builder target, Object message) { - postWebhookMessage(destination, target, message, Webhook.HttpOperation.POST); + postWebhookMessage(destination, target, message, Webhook.HttpMethod.POST); } public static void postWebhookMessage( Destination destination, Invocation.Builder target, Object message, - Webhook.HttpOperation httpOperation) { + Webhook.HttpMethod httpMethod) { long attemptTime = System.currentTimeMillis(); Response response; - if (httpOperation == Webhook.HttpOperation.PUT) { + if (httpMethod == Webhook.HttpMethod.PUT) { response = target.put(javax.ws.rs.client.Entity.entity(message, MediaType.APPLICATION_JSON_TYPE)); } else { @@ -438,7 +438,7 @@ public static void postWebhookMessage( LOG.debug( "Subscription Destination HTTP Operation {}:{} received response {}", - httpOperation, + httpMethod, destination.getSubscriptionDestination().getId(), response.getStatusInfo()); diff --git a/openmetadata-spec/src/main/resources/json/schema/entity/events/webhook.json b/openmetadata-spec/src/main/resources/json/schema/entity/events/webhook.json index 2c68a82f72ae..9ab4466f5bb9 100644 --- a/openmetadata-spec/src/main/resources/json/schema/entity/events/webhook.json +++ b/openmetadata-spec/src/main/resources/json/schema/entity/events/webhook.json @@ -44,7 +44,7 @@ "description": "Optional JSON payload to be sent with the webhook request.", "type": "string" }, - "httpOperation": { + "httpMethod": { "description": "HTTP operation to send the webhook request. Supports POST or PUT.", "type": "string", "enum": ["POST", "PUT"],