Skip to content

Commit b77629c

Browse files
authored
Merge pull request #60 from netdata/fix/notification-rsc
fix: rename attribute in the notification channels
2 parents f481ae4 + 557bf44 commit b77629c

17 files changed

+112
-72
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.4.0
2+
3+
BREAKING CHANGES:
4+
5+
- resource/netdata_notification_discord_channel: renamed attribute from `alarms` to `notifications` with new values
6+
- resource/netdata_notification_pagerduty_channel: renamed attribute from `alarms` to `notifications` with new values
7+
- resource/netdata_notification_slack_channel: renamed attribute from `alarms` to `notifications` with new values
8+
19
## 0.3.0
210

311
FEATURES:

docs/resources/node_room_member.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ resource "netdata_node_room_member" "test" {
6262

6363
Required:
6464

65-
- `action` (String) Determines whether matching nodes will be included or excluded from the room. EXCLUDE action always takes precedence against INCLUDE. Valid values: INCLUDE or EXCLUDE.
65+
- `action` (String) Determines whether matching nodes will be included or excluded from the room. Valid values: INCLUDE or EXCLUDE. EXCLUDE action always takes precedence against INCLUDE.
6666

6767
Optional:
6868

docs/resources/notification_discord_channel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ resource "netdata_notification_discord_channel" "test" {
3131

3232
### Required
3333

34-
- `alarms` (String) The alarms setting to set the Discord notification. Valid values are: `ALARMS_SETTING_ALL`, `ALARMS_SETTING_CRITICAL`, `ALARMS_SETTING_ALL_BUT_UNREACHABLE`, `ALARMS_SETTING_UNREACHABLE`
3534
- `channel_type` (String) Discord channel type. Valid values are: `text`, `forum`
3635
- `enabled` (Boolean) The enabled status of the Discord notification
3736
- `name` (String) The name of the Discord notification
37+
- `notifications` (List of String) The notification options for the Discord. Valid values are: `CRITICAL`, `WARNING`, `CLEAR`, `REACHABLE`, `UNREACHABLE`
3838
- `space_id` (String) The ID of the space for the Discord notification
3939
- `webhook_url` (String, Sensitive) Discord webhook URL
4040

docs/resources/notification_pagerduty_channel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ resource "netdata_notification_pagerduty_channel" "test" {
3131

3232
### Required
3333

34-
- `alarms` (String) The alarms setting to set the Pagerduty notification. Valid values are: `ALARMS_SETTING_ALL`, `ALARMS_SETTING_CRITICAL`, `ALARMS_SETTING_ALL_BUT_UNREACHABLE`, `ALARMS_SETTING_UNREACHABLE`
3534
- `alert_events_url` (String) URL for alert events
3635
- `enabled` (Boolean) The enabled status of the Pagerduty notification
3736
- `integration_key` (String, Sensitive) Integration key
3837
- `name` (String) The name of the Pagerduty notification
38+
- `notifications` (List of String) The notification options for the Pagerduty. Valid values are: `CRITICAL`, `WARNING`, `CLEAR`, `REACHABLE`, `UNREACHABLE`
3939
- `space_id` (String) The ID of the space for the Pagerduty notification
4040

4141
### Optional

docs/resources/notification_slack_channel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ resource "netdata_notification_slack_channel" "test" {
3030

3131
### Required
3232

33-
- `alarms` (String) The alarms setting to set the Slack notification. Valid values are: `ALARMS_SETTING_ALL`, `ALARMS_SETTING_CRITICAL`, `ALARMS_SETTING_ALL_BUT_UNREACHABLE`, `ALARMS_SETTING_UNREACHABLE`
3433
- `enabled` (Boolean) The enabled status of the Slack notification
3534
- `name` (String) The name of the Slack notification
35+
- `notifications` (List of String) The notification options for the Slack. Valid values are: `CRITICAL`, `WARNING`, `CLEAR`, `REACHABLE`, `UNREACHABLE`
3636
- `space_id` (String) The ID of the space for the Slack notification
3737
- `webhook_url` (String, Sensitive) Slack webhook URL
3838

internal/client/models.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type NotificationChannel struct {
3737
Enabled bool `json:"enabled"`
3838
Name string `json:"name"`
3939
Integration NotificationIntegration `json:"integration"`
40-
Alarms string `json:"alarms"`
40+
NotificationOptions []string `json:"notification_options"`
4141
Rooms []string `json:"rooms"`
4242
Secrets json.RawMessage `json:"secrets"`
4343
RepeatNotificationMinute int64 `json:"repeat_notification_min,omitempty"`
@@ -68,7 +68,7 @@ type NotificationPagerdutyChannel struct {
6868
type notificationRequestPayload struct {
6969
Name string `json:"name"`
7070
IntegrationID string `json:"integrationID"`
71-
Alarms string `json:"alarms"`
71+
NotificationOptions []string `json:"notification_options"`
7272
Rooms []string `json:"rooms"`
7373
Secrets json.RawMessage `json:"secrets"`
7474
RepeatNotificationMinute int64 `json:"repeat_notification_min,omitempty"`

internal/client/notification_discord.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (c *Client) CreateDiscordChannel(spaceID string, commonParams NotificationC
1717
Name: commonParams.Name,
1818
IntegrationID: commonParams.Integration.ID,
1919
Rooms: commonParams.Rooms,
20-
Alarms: commonParams.Alarms,
20+
NotificationOptions: commonParams.NotificationOptions,
2121
RepeatNotificationMinute: commonParams.RepeatNotificationMinute,
2222
}
2323

@@ -73,7 +73,7 @@ func (c *Client) UpdateDiscordChannelByID(spaceID string, commonParams Notificat
7373
reqBody := notificationRequestPayload{
7474
Name: commonParams.Name,
7575
Rooms: commonParams.Rooms,
76-
Alarms: commonParams.Alarms,
76+
NotificationOptions: commonParams.NotificationOptions,
7777
RepeatNotificationMinute: commonParams.RepeatNotificationMinute,
7878
}
7979

internal/client/notification_pagerduty.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (c *Client) CreatePagerdutyChannel(spaceID string, commonParams Notificatio
1717
Name: commonParams.Name,
1818
IntegrationID: commonParams.Integration.ID,
1919
Rooms: commonParams.Rooms,
20-
Alarms: commonParams.Alarms,
20+
NotificationOptions: commonParams.NotificationOptions,
2121
RepeatNotificationMinute: commonParams.RepeatNotificationMinute,
2222
}
2323

@@ -72,7 +72,7 @@ func (c *Client) UpdatePagerdutyChannelByID(spaceID string, commonParams Notific
7272
reqBody := notificationRequestPayload{
7373
Name: commonParams.Name,
7474
Rooms: commonParams.Rooms,
75-
Alarms: commonParams.Alarms,
75+
NotificationOptions: commonParams.NotificationOptions,
7676
RepeatNotificationMinute: commonParams.RepeatNotificationMinute,
7777
}
7878

internal/client/notification_slack.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func (c *Client) CreateSlackChannel(spaceID string, commonParams NotificationCha
1717
Name: commonParams.Name,
1818
IntegrationID: commonParams.Integration.ID,
1919
Rooms: commonParams.Rooms,
20-
Alarms: commonParams.Alarms,
20+
NotificationOptions: commonParams.NotificationOptions,
2121
RepeatNotificationMinute: commonParams.RepeatNotificationMinute,
2222
}
2323

@@ -71,7 +71,7 @@ func (c *Client) UpdateSlackChannelByID(spaceID string, commonParams Notificatio
7171
reqBody := notificationRequestPayload{
7272
Name: commonParams.Name,
7373
Rooms: commonParams.Rooms,
74-
Alarms: commonParams.Alarms,
74+
NotificationOptions: commonParams.NotificationOptions,
7575
RepeatNotificationMinute: commonParams.RepeatNotificationMinute,
7676
}
7777
secretsJson, err := json.Marshal(slackParams)

internal/provider/node_room_member.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ There are two options to add nodes to the room:
103103
},
104104
},
105105
"action": schema.StringAttribute{
106-
Description: "Determines whether matching nodes will be included or excluded from the room. EXCLUDE action always takes precedence against INCLUDE. Valid values: INCLUDE or EXCLUDE.",
106+
Description: "Determines whether matching nodes will be included or excluded from the room. Valid values: INCLUDE or EXCLUDE. EXCLUDE action always takes precedence against INCLUDE.",
107107
Required: true,
108108
Validators: []validator.String{
109109
stringvalidator.OneOf([]string{"INCLUDE", "EXCLUDE"}...),

0 commit comments

Comments
 (0)