Skip to content

Commit 04b0b6b

Browse files
author
Sokratis Papadopoulos
committed
Add notifications configs API
Signed-off-by: Sokratis Papadopoulos <[email protected]>
1 parent b42000c commit 04b0b6b

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
lines changed

model/notifications/config.smithy

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// The OpenSearch Contributors require contributions made to
4+
// this file be licensed under the Apache-2.0 license or a
5+
// compatible open source license.
6+
7+
$version: "2"
8+
namespace OpenSearch
9+
10+
structure NotificationsConfig {
11+
config_id: String,
12+
name: String,
13+
config: NotificationsConfigItem
14+
}
15+
16+
structure NotificationsConfigItem {
17+
name: String,
18+
description: String,
19+
config_type: String,
20+
is_enabled: Boolean,
21+
slack: SlackItem
22+
}
23+
24+
structure SlackItem {
25+
url: String
26+
}
27+
28+
structure NotificationsConfigsOutputItem {
29+
config_id: String,
30+
last_updated_time_ms: Integer,
31+
created_time_ms: Integer,
32+
config: NotificationsConfigItem
33+
}
34+
35+
list NotificationsConfigsList {
36+
member: NotificationsConfigsOutputItem
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// The OpenSearch Contributors require contributions made to
4+
// this file be licensed under the Apache-2.0 license or a
5+
// compatible open source license.
6+
7+
$version: "2"
8+
namespace OpenSearch
9+
10+
@externalDocumentation(
11+
"API Reference": "https://opensearch.org/docs/latest/observing-your-data/notifications/api/"
12+
)
13+
14+
@xOperationGroup("notifications.configs")
15+
@xVersionAdded("2.2")
16+
@readonly
17+
@suppress(["HttpUriConflict"])
18+
@http(method: "GET", uri: "/_plugins/_notifications/configs")
19+
@documentation("Retrieves all notification configurations.")
20+
operation NotificationsConfigs_Get {
21+
input: NotificationsConfigs_Get_Input,
22+
output: NotificationsConfigs_Get_Output
23+
}
24+
25+
@xOperationGroup("notifications.configs")
26+
@xVersionAdded("2.2")
27+
@suppress(["HttpUriConflict"])
28+
@http(method: "POST", uri: "/_plugins/_notifications/configs")
29+
@documentation("Creates a notification channel configuration.")
30+
operation NotificationsConfigs_Post {
31+
input: NotificationsConfigs_Post_Input,
32+
output: NotificationsConfigs_Post_Output
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// The OpenSearch Contributors require contributions made to
4+
// this file be licensed under the Apache-2.0 license or a
5+
// compatible open source license.
6+
7+
$version: "2"
8+
namespace OpenSearch
9+
10+
@input
11+
structure NotificationsConfigs_Get_Input {
12+
}
13+
14+
@output
15+
structure NotificationsConfigs_Get_Output {
16+
start_index: Integer,
17+
total_hits: Integer,
18+
total_hit_relation: String,
19+
config_list: NotificationsConfigsList
20+
}
21+
22+
@input
23+
structure NotificationsConfigs_Post_Input {
24+
@required
25+
@httpPayload
26+
content: NotificationsConfig
27+
}
28+
29+
@output
30+
structure NotificationsConfigs_Post_Output {
31+
config_id: String
32+
}

model/opensearch.smithy

+2
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ service OpenSearch {
295295
NodesUsage_WithMetric,
296296
NodesUsage_WithMetricNodeId,
297297
NodesUsage_WithNodeId,
298+
NotificationsConfigs_Get,
299+
NotificationsConfigs_Post,
298300
PatchActionGroup,
299301
PatchActionGroups,
300302
PatchAuditConfiguration,

0 commit comments

Comments
 (0)