From b3d34bd07734cadde47291824ef622d4992fa6f2 Mon Sep 17 00:00:00 2001 From: Sokratis Papadopoulos Date: Fri, 12 Jan 2024 14:01:02 +0100 Subject: [PATCH] add get notifications features API --- model/notifications/config.smithy | 23 +++++++++++++++++++ .../notifications/features/operations.smithy | 23 +++++++++++++++++++ .../notifications/features/structures.smithy | 18 +++++++++++++++ model/opensearch.smithy | 1 + 4 files changed, 65 insertions(+) create mode 100644 model/notifications/features/operations.smithy create mode 100644 model/notifications/features/structures.smithy diff --git a/model/notifications/config.smithy b/model/notifications/config.smithy index 42dbdc99d..7f803d665 100644 --- a/model/notifications/config.smithy +++ b/model/notifications/config.smithy @@ -35,3 +35,26 @@ structure NotificationsConfigsOutputItem { list NotificationsConfigsList { member: NotificationsConfigsOutputItem } + +@xDataType("array") +@xEnumOptions([ + "slack", + "chime", + "microsoft_teams", + "webhook", + "email", + "sns", + "ses_account", + "smtp_account", + "email_group" +]) +@documentation("Limit the information for notifications features list.") +string NotificationsFeaturesListItem + +list NotificationsFeaturesList { + member: NotificationsFeaturesListItem +} + +structure NotificationsPluginFeatures { + tooltip_support: Boolean +} diff --git a/model/notifications/features/operations.smithy b/model/notifications/features/operations.smithy new file mode 100644 index 000000000..cd467762a --- /dev/null +++ b/model/notifications/features/operations.smithy @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@externalDocumentation( + "API Reference": "https://opensearch.org/docs/latest/observing-your-data/notifications/api/" +) + +@xOperationGroup("notifications.features") +@xVersionAdded("2.2") +@readonly +@suppress(["HttpUriConflict"]) +@http(method: "GET", uri: "/_plugins/_notifications/features") +@documentation("Retrieve a list of all supported notification configuration types.") +operation NotificationsFeatures_Get { + input: NotificationsFeatures_Get_Input, + output: NotificationsFeatures_Get_Output +} diff --git a/model/notifications/features/structures.smithy b/model/notifications/features/structures.smithy new file mode 100644 index 000000000..d20f94866 --- /dev/null +++ b/model/notifications/features/structures.smithy @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +$version: "2" +namespace OpenSearch + +@input +structure NotificationsFeatures_Get_Input { +} + +@output +structure NotificationsFeatures_Get_Output { + allowed_config_type_list: NotificationsFeaturesList, + plugin_features: NotificationsPluginFeatures +} diff --git a/model/opensearch.smithy b/model/opensearch.smithy index c3b02b53d..c31b49fac 100644 --- a/model/opensearch.smithy +++ b/model/opensearch.smithy @@ -297,6 +297,7 @@ service OpenSearch { NodesUsage_WithNodeId, NotificationsConfigs_Get, NotificationsConfigs_Post, + NotificationsFeatures_Get, PatchActionGroup, PatchActionGroups, PatchAuditConfiguration,