Skip to content

Commit

Permalink
feat: add notifierId parameter in alert configuration notifications (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBettati authored Oct 11, 2023
1 parent d023c4d commit bca25ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions mongodbatlas/alert_configurations.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ type Notification struct {
SMSEnabled *bool `json:"smsEnabled,omitempty"` // Flag indicating if text message notifications should be sent. Populated for ORG, GROUP, and USER notifications types.
TeamID string `json:"teamId,omitempty"` // Unique identifier of a team.
TeamName string `json:"teamName,omitempty"` // Label for the team that receives this notification.
NotifierID string `json:"notifierId,omitempty"` // The notifierId is a system-generated unique identifier assigned to each notification method.
TypeName string `json:"typeName,omitempty"` // Type of alert notification.
Username string `json:"username,omitempty"` // Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Populated for the USER notifications type.
VictorOpsAPIKey string `json:"victorOpsApiKey,omitempty"` // VictorOps API key. Populated for the VICTOR_OPS notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
Expand Down
6 changes: 6 additions & 0 deletions mongodbatlas/alert_configurations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
"notifications": []interface{}{
map[string]interface{}{
"typeName": "GROUP",
"notifierId": "6462742adc47d365036da07c",
"intervalMin": float64(5),
"delayMin": float64(0),
"smsEnabled": false,
Expand Down Expand Up @@ -69,6 +70,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
"intervalMin": 5,
"smsEnabled": false,
"typeName": "GROUP",
"notifierId": "6462742adc47d365036da07c",
"roles" : ["GROUP_CHARTS_ADMIN", "GROUP_CLUSTER_MANAGER"]
}
],
Expand All @@ -82,6 +84,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
Notifications: []Notification{
{
TypeName: "GROUP",
NotifierID: "6462742adc47d365036da07c",
IntervalMin: 5,
DelayMin: pointer(0),
SMSEnabled: pointer(false),
Expand Down Expand Up @@ -111,6 +114,7 @@ func TestAlertConfiguration_Create(t *testing.T) {
IntervalMin: 5,
SMSEnabled: pointer(false),
TypeName: "GROUP",
NotifierID: "6462742adc47d365036da07c",
Roles: []string{"GROUP_CHARTS_ADMIN", "GROUP_CLUSTER_MANAGER"},
},
},
Expand Down Expand Up @@ -220,6 +224,7 @@ func TestAlertConfiguration_GetAnAlertConfig(t *testing.T) {
"notifications": [
{
"typeName": "SMS",
"notifierId": "6462742adc47d365036da07c",
"intervalMin": 5,
"delayMin": 0,
"mobileNumber": "2343454567",
Expand Down Expand Up @@ -258,6 +263,7 @@ func TestAlertConfiguration_GetAnAlertConfig(t *testing.T) {
Notifications: []Notification{
{
TypeName: "SMS",
NotifierID: "6462742adc47d365036da07c",
IntervalMin: 5,
DelayMin: pointer(0),
MobileNumber: "2343454567",
Expand Down

0 comments on commit bca25ca

Please sign in to comment.