Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mute_first_recovery_notification option to downtime #850

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-05-05 07:22:32.667619",
"spec_repo_commit": "e81df6f3"
"regenerated": "2022-05-06 08:36:09.617046",
"spec_repo_commit": "2c917de9"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-05-05 07:22:32.687224",
"spec_repo_commit": "e81df6f3"
"regenerated": "2022-05-06 08:36:09.637004",
"spec_repo_commit": "2c917de9"
}
}
}
10 changes: 10 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,11 @@ components:
description: A monitor tag.
type: string
type: array
mute_first_recovery_notification:
description: If the first recovery notification during a downtime should
be muted.
example: false
type: boolean
parent_id:
description: ID of the parent Downtime.
example: 123
Expand Down Expand Up @@ -1628,6 +1633,11 @@ components:
description: A monitor tag.
type: string
type: array
mute_first_recovery_notification:
description: If the first recovery notification during a downtime should
be muted.
example: false
type: boolean
parent_id:
description: ID of the parent Downtime.
example: 123
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-10T15:50:12.385Z
2022-04-21T06:01:10.874Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-10T15:50:13.969Z
2022-04-07T11:06:08.144Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-10T15:50:17.578Z
2022-04-22T12:40:17.655Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/v1/downtimes/CreateDowntime_2908359488.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
start: Time.now.to_i,
_end: (Time.now + 1 * 3600).to_i,
timezone: "Etc/UTC",
mute_first_recovery_notification: true,
})
p api_instance.create_downtime(body)
1 change: 1 addition & 0 deletions examples/v1/downtimes/CreateDowntime_3059354445.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
start: Time.now.to_i,
_end: (Time.now + 1 * 3600).to_i,
timezone: "Etc/UTC",
mute_first_recovery_notification: true,
})
p api_instance.create_downtime(body)
1 change: 1 addition & 0 deletions examples/v1/downtimes/UpdateDowntime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

body = DatadogAPIClient::V1::Downtime.new({
message: "Example-Update_a_downtime_returns_OK_response-updated",
mute_first_recovery_notification: true,
})
p api_instance.update_downtime(DOWNTIME_ID.to_i, body)
3 changes: 2 additions & 1 deletion features/v1/downtime_recurrence_payload_once_a_year.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"scope": ["*"],
"start": {{ timestamp("now") }},
"end": {{ timestamp("now + 1h") }},
"timezone": "Etc/UTC"
"timezone": "Etc/UTC",
"mute_first_recovery_notification": true
}
3 changes: 2 additions & 1 deletion features/v1/downtime_recurrence_payload_until_date.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"scope": ["*"],
"start": {{ timestamp("now") }},
"end": {{ timestamp("now + 1h") }},
"timezone": "Etc/UTC"
"timezone": "Etc/UTC",
"mute_first_recovery_notification": true
}
6 changes: 3 additions & 3 deletions features/v1/downtimes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ Feature: Downtimes
Scenario: Update a downtime returns "Bad Request" response
Given new "UpdateDowntime" request
And request contains "downtime_id" parameter from "REPLACE.ME"
And body with value {"disabled": false, "end": 1412793983, "message": "Message on the downtime", "monitor_id": 123456, "monitor_tags": ["*"], "parent_id": 123, "recurrence": {"period": 1, "rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1", "type": "weeks", "until_date": 1447786293, "until_occurrences": 2, "week_days": ["Mon", "Tue"]}, "scope": ["env:staging"], "start": 1412792983, "timezone": "America/New_York"}
And body with value {"disabled": false, "end": 1412793983, "message": "Message on the downtime", "monitor_id": 123456, "monitor_tags": ["*"], "mute_first_recovery_notification": false, "parent_id": 123, "recurrence": {"period": 1, "rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1", "type": "weeks", "until_date": 1447786293, "until_occurrences": 2, "week_days": ["Mon", "Tue"]}, "scope": ["env:staging"], "start": 1412792983, "timezone": "America/New_York"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/monitor-app
Scenario: Update a downtime returns "Downtime not found" response
Given new "UpdateDowntime" request
And request contains "downtime_id" parameter from "REPLACE.ME"
And body with value {"disabled": false, "end": 1412793983, "message": "Message on the downtime", "monitor_id": 123456, "monitor_tags": ["*"], "parent_id": 123, "recurrence": {"period": 1, "rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1", "type": "weeks", "until_date": 1447786293, "until_occurrences": 2, "week_days": ["Mon", "Tue"]}, "scope": ["env:staging"], "start": 1412792983, "timezone": "America/New_York"}
And body with value {"disabled": false, "end": 1412793983, "message": "Message on the downtime", "monitor_id": 123456, "monitor_tags": ["*"], "mute_first_recovery_notification": false, "parent_id": 123, "recurrence": {"period": 1, "rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1", "type": "weeks", "until_date": 1447786293, "until_occurrences": 2, "week_days": ["Mon", "Tue"]}, "scope": ["env:staging"], "start": 1412792983, "timezone": "America/New_York"}
When the request is sent
Then the response status is 404 Downtime not found

Expand All @@ -181,7 +181,7 @@ Feature: Downtimes
Given there is a valid "downtime" in the system
And new "UpdateDowntime" request
And request contains "downtime_id" parameter from "downtime.id"
And body with value {"message": "{{ unique}}-updated"}
And body with value {"message": "{{ unique}}-updated", "mute_first_recovery_notification": true}
When the request is sent
Then the response status is 200 OK
And the response "message" is equal to "{{ unique }}-updated"
12 changes: 11 additions & 1 deletion lib/datadog_api_client/v1/models/downtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class Downtime
# For example, `service:postgres` **AND** `team:frontend`.
attr_accessor :monitor_tags

# If the first recovery notification during a downtime should be muted.
attr_accessor :mute_first_recovery_notification

# ID of the parent Downtime.
attr_accessor :parent_id

Expand Down Expand Up @@ -106,6 +109,7 @@ def self.attribute_map
:'message' => :'message',
:'monitor_id' => :'monitor_id',
:'monitor_tags' => :'monitor_tags',
:'mute_first_recovery_notification' => :'mute_first_recovery_notification',
:'parent_id' => :'parent_id',
:'recurrence' => :'recurrence',
:'scope' => :'scope',
Expand Down Expand Up @@ -136,6 +140,7 @@ def self.openapi_types
:'message' => :'String',
:'monitor_id' => :'Integer',
:'monitor_tags' => :'Array<String>',
:'mute_first_recovery_notification' => :'Boolean',
:'parent_id' => :'Integer',
:'recurrence' => :'DowntimeRecurrence',
:'scope' => :'Array<String>',
Expand Down Expand Up @@ -221,6 +226,10 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'mute_first_recovery_notification')
self.mute_first_recovery_notification = attributes[:'mute_first_recovery_notification']
end

if attributes.key?(:'parent_id')
self.parent_id = attributes[:'parent_id']
end
Expand Down Expand Up @@ -305,6 +314,7 @@ def ==(o)
message == o.message &&
monitor_id == o.monitor_id &&
monitor_tags == o.monitor_tags &&
mute_first_recovery_notification == o.mute_first_recovery_notification &&
parent_id == o.parent_id &&
recurrence == o.recurrence &&
scope == o.scope &&
Expand All @@ -324,7 +334,7 @@ def eql?(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[active, active_child, canceled, creator_id, disabled, downtime_type, _end, id, message, monitor_id, monitor_tags, parent_id, recurrence, scope, start, timezone, updater_id].hash
[active, active_child, canceled, creator_id, disabled, downtime_type, _end, id, message, monitor_id, monitor_tags, mute_first_recovery_notification, parent_id, recurrence, scope, start, timezone, updater_id].hash
end
end
end
12 changes: 11 additions & 1 deletion lib/datadog_api_client/v1/models/downtime_child.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class DowntimeChild
# For example, `service:postgres` **AND** `team:frontend`.
attr_accessor :monitor_tags

# If the first recovery notification during a downtime should be muted.
attr_accessor :mute_first_recovery_notification

# ID of the parent Downtime.
attr_accessor :parent_id

Expand Down Expand Up @@ -99,6 +102,7 @@ def self.attribute_map
:'message' => :'message',
:'monitor_id' => :'monitor_id',
:'monitor_tags' => :'monitor_tags',
:'mute_first_recovery_notification' => :'mute_first_recovery_notification',
:'parent_id' => :'parent_id',
:'recurrence' => :'recurrence',
:'scope' => :'scope',
Expand Down Expand Up @@ -128,6 +132,7 @@ def self.openapi_types
:'message' => :'String',
:'monitor_id' => :'Integer',
:'monitor_tags' => :'Array<String>',
:'mute_first_recovery_notification' => :'Boolean',
:'parent_id' => :'Integer',
:'recurrence' => :'DowntimeRecurrence',
:'scope' => :'Array<String>',
Expand Down Expand Up @@ -208,6 +213,10 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'mute_first_recovery_notification')
self.mute_first_recovery_notification = attributes[:'mute_first_recovery_notification']
end

if attributes.key?(:'parent_id')
self.parent_id = attributes[:'parent_id']
end
Expand Down Expand Up @@ -291,6 +300,7 @@ def ==(o)
message == o.message &&
monitor_id == o.monitor_id &&
monitor_tags == o.monitor_tags &&
mute_first_recovery_notification == o.mute_first_recovery_notification &&
parent_id == o.parent_id &&
recurrence == o.recurrence &&
scope == o.scope &&
Expand All @@ -310,7 +320,7 @@ def eql?(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[active, canceled, creator_id, disabled, downtime_type, _end, id, message, monitor_id, monitor_tags, parent_id, recurrence, scope, start, timezone, updater_id].hash
[active, canceled, creator_id, disabled, downtime_type, _end, id, message, monitor_id, monitor_tags, mute_first_recovery_notification, parent_id, recurrence, scope, start, timezone, updater_id].hash
end
end
end