From 239e947238b9afbec8c2e6a88b1a28b665460083 Mon Sep 17 00:00:00 2001 From: Sokratis Papadopoulos Date: Fri, 19 Apr 2024 16:37:58 +0200 Subject: [PATCH 1/5] Add _plugins/_notifications/channels API Signed-off-by: Sokratis Papadopoulos --- spec/namespaces/notifications.yaml | 17 +++++++++++++++ spec/schemas/notifications._common.yaml | 28 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/spec/namespaces/notifications.yaml b/spec/namespaces/notifications.yaml index 5dd403ca4..23c2a3bb3 100644 --- a/spec/namespaces/notifications.yaml +++ b/spec/namespaces/notifications.yaml @@ -4,6 +4,17 @@ info: description: OpenSearch Notifications API version: 1.0.0 paths: + /_plugins/_notifications/channels: + get: + operationId: notifications.list_channels.0 + x-operation-group: notifications.list_channels + x-version-added: '2.0' + description: List created notification channels. + externalDocs: + url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#list-all-notification-configurations + responses: + '200': + $ref: '#/components/responses/notifications.list_channels@200' /_plugins/_notifications/configs: delete: operationId: notifications.delete_configs.0 @@ -225,6 +236,12 @@ components: application/json: schema: $ref: '../schemas/notifications._common.yaml#/components/schemas/GetConfigsResponse' + notifications.list_channels@200: + description: '' + content: + application/json: + schema: + $ref: '../schemas/notifications._common.yaml#/components/schemas/ListChannelsResponse' notifications.list_features@200: description: '' content: diff --git a/spec/schemas/notifications._common.yaml b/spec/schemas/notifications._common.yaml index e85bee4c7..1ffb9c52c 100644 --- a/spec/schemas/notifications._common.yaml +++ b/spec/schemas/notifications._common.yaml @@ -6,6 +6,34 @@ info: paths: {} components: schemas: + ChannelItem: + type: object + properties: + config_id: + type: string + name: + type: string + description: + type: string + config_type: + $ref: '#/components/schemas/NotificationConfigType' + is_enabled: + type: boolean + ListChannelsResponse: + type: object + properties: + start_index: + type: integer + format: int64 + total_hits: + type: integer + format: int64 + total_hit_relation: + $ref: '#/components/schemas/TotalHitRelation' + channel_list: + type: array + items: + $ref: '#/components/schemas/ChannelItem' DeleteConfigsResponse: type: object properties: From 7921a09e344840f40852bbc601455dbc61e8534b Mon Sep 17 00:00:00 2001 From: Sokratis Papadopoulos Date: Fri, 19 Apr 2024 16:49:27 +0200 Subject: [PATCH 2/5] add new list notification channels API on core spec Signed-off-by: Sokratis Papadopoulos --- spec/opensearch-openapi.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/opensearch-openapi.yaml b/spec/opensearch-openapi.yaml index c835abf89..1673d43af 100644 --- a/spec/opensearch-openapi.yaml +++ b/spec/opensearch-openapi.yaml @@ -412,6 +412,8 @@ paths: $ref: 'namespaces/knn.yaml#/paths/~1_plugins~1_knn~1{node_id}~1stats' /_plugins/_knn/{node_id}/stats/{stat}: $ref: 'namespaces/knn.yaml#/paths/~1_plugins~1_knn~1{node_id}~1stats~1{stat}' + /_plugins/_notifications/channels: + $ref: 'namespaces/notifications.yaml#/paths/~1_plugins~1_notifications~1channels' /_plugins/_notifications/configs: $ref: 'namespaces/notifications.yaml#/paths/~1_plugins~1_notifications~1configs' /_plugins/_notifications/configs/{config_id}: From 78d09279e9fca9b23fea8b22feae29958f9bffe2 Mon Sep 17 00:00:00 2001 From: Sokratis Papadopoulos Date: Tue, 23 Apr 2024 09:16:28 +0200 Subject: [PATCH 3/5] Remove reference for list_channels schema Signed-off-by: Sokratis Papadopoulos --- spec/namespaces/notifications.yaml | 15 ++++++++++++++- spec/schemas/notifications._common.yaml | 15 --------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/spec/namespaces/notifications.yaml b/spec/namespaces/notifications.yaml index 23c2a3bb3..30f3104eb 100644 --- a/spec/namespaces/notifications.yaml +++ b/spec/namespaces/notifications.yaml @@ -241,7 +241,20 @@ components: content: application/json: schema: - $ref: '../schemas/notifications._common.yaml#/components/schemas/ListChannelsResponse' + type: object + properties: + start_index: + type: integer + format: int64 + total_hits: + type: integer + format: int64 + total_hit_relation: + $ref: '#/components/schemas/TotalHitRelation' + channel_list: + type: array + items: + $ref: '#/components/schemas/ChannelItem' notifications.list_features@200: description: '' content: diff --git a/spec/schemas/notifications._common.yaml b/spec/schemas/notifications._common.yaml index 1ffb9c52c..484568c66 100644 --- a/spec/schemas/notifications._common.yaml +++ b/spec/schemas/notifications._common.yaml @@ -19,21 +19,6 @@ components: $ref: '#/components/schemas/NotificationConfigType' is_enabled: type: boolean - ListChannelsResponse: - type: object - properties: - start_index: - type: integer - format: int64 - total_hits: - type: integer - format: int64 - total_hit_relation: - $ref: '#/components/schemas/TotalHitRelation' - channel_list: - type: array - items: - $ref: '#/components/schemas/ChannelItem' DeleteConfigsResponse: type: object properties: From 75a4fa0d868814a25f958c4926ef4d197947fcce Mon Sep 17 00:00:00 2001 From: Sokratis Papadopoulos Date: Tue, 23 Apr 2024 09:28:55 +0200 Subject: [PATCH 4/5] Remove reference for list_channels schema Signed-off-by: Sokratis Papadopoulos --- spec/namespaces/notifications.yaml | 15 +++++++++++++-- spec/schemas/notifications._common.yaml | 13 ------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/spec/namespaces/notifications.yaml b/spec/namespaces/notifications.yaml index 30f3104eb..ade4b1d14 100644 --- a/spec/namespaces/notifications.yaml +++ b/spec/namespaces/notifications.yaml @@ -250,11 +250,22 @@ components: type: integer format: int64 total_hit_relation: - $ref: '#/components/schemas/TotalHitRelation' + $ref: '../schemas/notifications._common.yaml#/components/schemas/TotalHitRelation' channel_list: type: array items: - $ref: '#/components/schemas/ChannelItem' + type: object + properties: + config_id: + type: string + name: + type: string + description: + type: string + config_type: + $ref: '../schemas/notifications._common.yaml#/components/schemas/NotificationConfigType' + is_enabled: + type: boolean notifications.list_features@200: description: '' content: diff --git a/spec/schemas/notifications._common.yaml b/spec/schemas/notifications._common.yaml index 484568c66..e85bee4c7 100644 --- a/spec/schemas/notifications._common.yaml +++ b/spec/schemas/notifications._common.yaml @@ -6,19 +6,6 @@ info: paths: {} components: schemas: - ChannelItem: - type: object - properties: - config_id: - type: string - name: - type: string - description: - type: string - config_type: - $ref: '#/components/schemas/NotificationConfigType' - is_enabled: - type: boolean DeleteConfigsResponse: type: object properties: From aeb66f7073a69fe1422d06ef7d7bb84f7104803c Mon Sep 17 00:00:00 2001 From: Sokratis Papadopoulos Date: Tue, 23 Apr 2024 09:32:02 +0200 Subject: [PATCH 5/5] Add todo for externalDocs of list_channels Signed-off-by: Sokratis Papadopoulos --- spec/namespaces/notifications.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/namespaces/notifications.yaml b/spec/namespaces/notifications.yaml index ade4b1d14..42eb5fe1e 100644 --- a/spec/namespaces/notifications.yaml +++ b/spec/namespaces/notifications.yaml @@ -10,6 +10,7 @@ paths: x-operation-group: notifications.list_channels x-version-added: '2.0' description: List created notification channels. + # TODO: Update url when this one is merged: https://github.com/opensearch-project/documentation-website/pull/6982 externalDocs: url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#list-all-notification-configurations responses: