From 8e65e5b1d332979ad7c1aa34b076ea7971ad2d5d Mon Sep 17 00:00:00 2001 From: 195858 <3858485+195858@users.noreply.github.com> Date: Fri, 22 Apr 2022 17:30:53 +0100 Subject: [PATCH 1/3] feat-api-change-webhook-status --- api-implementation/server/common/api.yml | 5 +++++ api-implementation/src/model/@types/api-model/index.d.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/api-implementation/server/common/api.yml b/api-implementation/server/common/api.yml index 0c93dcd..293c47e 100644 --- a/api-implementation/server/common/api.yml +++ b/api-implementation/server/common/api.yml @@ -1210,6 +1210,11 @@ components: pattern: "^https?:\\/\\/[A-Za-z\\.:0-9\\-]*.*$" minLength: 0 maxLength: 200 + name: + type: string + minLength: 3 + maxLength: 200 + pattern: ^.*$ up: description: indicates if the webhook is up and running type: boolean diff --git a/api-implementation/src/model/@types/api-model/index.d.ts b/api-implementation/src/model/@types/api-model/index.d.ts index 316b214..5a3d370 100644 --- a/api-implementation/src/model/@types/api-model/index.d.ts +++ b/api-implementation/src/model/@types/api-model/index.d.ts @@ -1093,6 +1093,7 @@ declare namespace Components { } export interface WebHookStatus { uri?: string; // ^https?:\/\/[A-Za-z\.:0-9\-]*.*$ + name?: string; // ^.*$ /** * indicates if the webhook is up and running * example: From ea2a75f26741ccda171f3d4edc6ef8876b0a8e16 Mon Sep 17 00:00:00 2001 From: 195858 <3858485+195858@users.noreply.github.com> Date: Fri, 22 Apr 2022 17:31:05 +0100 Subject: [PATCH 2/3] feat-app-webhook-status-name --- .../server/api/services/broker/statusservice.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api-implementation/server/api/services/broker/statusservice.ts b/api-implementation/server/api/services/broker/statusservice.ts index 7abce66..e720526 100644 --- a/api-implementation/server/api/services/broker/statusservice.ts +++ b/api-implementation/server/api/services/broker/statusservice.ts @@ -115,14 +115,15 @@ class StatusService { const bindingStatus: MsgVpnRestDeliveryPointQueueBindingResponse = await apiClient.getMsgVpnRestDeliveryPointQueueBinding(service.msgVpnName, app.internalName, app.internalName); const q: MsgVpnQueueResponse = await apiClient.getMsgVpnQueue(service.msgVpnName, encodeURIComponent(app.internalName)); const up: boolean = c.up && (consumerStatus.data && consumerStatus.data.up) && (bindingStatus.data && bindingStatus.data.up); - + const wh: WebHook = this.getWebHook(app, envName); const conn: WebHookStatus = { up: up, failureReason: up ? '' : `${c.lastFailureReason} (${consumerStatus.data.lastConnectionFailureReason})`, lastFailureTime: c.lastFailureTime, messagesQueued: q.collections.msgs.count, messagesQueuedMB: (q.data.msgSpoolUsage / 1048576), - uri: this.getWebHookURI(app, envName), + uri: wh.uri, + name: wh.name?wh.name:wh.uri, } webHooks.push(conn); } @@ -157,7 +158,7 @@ class StatusService { } } - private getWebHookURI(app: App, envName: string): string { + private getWebHook(app: App, envName: string): WebHook { let wh: WebHook; // try to locate specific web hook for this environment wh = app.webHooks.find(w => w.environments && w.environments.find(e => e == envName)); @@ -166,9 +167,9 @@ class StatusService { wh = app.webHooks.find(w => (w.environments === undefined || w.environments.length == 0)); } if (wh) { - return wh.uri; + return wh; } else { - return ''; + return null; } } } From 4bd3347d802d616cc02810c58a8e6822c95ae75b Mon Sep 17 00:00:00 2001 From: 195858 <3858485+195858@users.noreply.github.com> Date: Fri, 22 Apr 2022 17:38:00 +0100 Subject: [PATCH 3/3] fix-openapi-bump-version --- api-implementation/server/common/api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-implementation/server/common/api.yml b/api-implementation/server/common/api.yml index 293c47e..df35963 100644 --- a/api-implementation/server/common/api.yml +++ b/api-implementation/server/common/api.yml @@ -2,7 +2,7 @@ openapi: 3.0.0 info: title: Solace API Management Connector description: 'Solace API Management Connector API. Note: basic authentication security mechanism is deprecated.' - version: 0.7.10 + version: 0.7.11 servers: - url: /v1