Skip to content
Open
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
7 changes: 6 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188770,7 +188770,7 @@ paths:
- status_pages_settings_write
/api/v2/statuspages/degradations:
get:
description: Lists all degradations for the organization. Optionally filter by status and page.
description: Lists all degradations for the organization. Optionally filter by status, page, and source ID.
operationId: ListDegradations
parameters:
- description: Optional page id filter.
Expand Down Expand Up @@ -188802,6 +188802,11 @@ paths:
name: filter[status]
schema:
type: string
- description: "Optional source ID filter. Returns only degradations whose source matches this ID (e.g. an incident ID)."
in: query
name: filter[source_id]
schema:
type: string
- description: "Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, modified_at, -modified_at."
in: query
name: sort
Expand Down
11 changes: 11 additions & 0 deletions examples/v2/status-pages/ListDegradations_3179419218.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# List degradations with source ID filter returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new

# there is a valid "degradation" in the system
DEGRADATION_DATA_ID = ENV["DEGRADATION_DATA_ID"]
opts = {
filter_source_id: DEGRADATION_DATA_ID,
}
p api_instance.list_degradations(opts)
1 change: 1 addition & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5609,6 +5609,7 @@
"page_limit" => "Integer",
"include" => "String",
"filter_status" => "String",
"filter_source_id" => "String",
"sort" => "String",
},
"v2.ListMaintenances" => {
Expand Down
9 changes: 9 additions & 0 deletions features/v2/status_pages.feature
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ Feature: Status Pages
When the request is sent
Then the response status is 200 OK

@team:DataDog/incident-app
Scenario: List degradations with source ID filter returns "OK" response
Given new "ListDegradations" request
And there is a valid "status_page" in the system
And there is a valid "degradation" in the system
And request contains "filter[source_id]" parameter from "degradation.data.id"
When the request is sent
Then the response status is 200 OK

@team:DataDog/incident-app
Scenario: List maintenances returns "OK" response
Given there is a valid "status_page" in the system
Expand Down
4 changes: 3 additions & 1 deletion lib/datadog_api_client/v2/api/status_pages_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1115,14 +1115,15 @@ def list_degradations(opts = {})

# List degradations.
#
# Lists all degradations for the organization. Optionally filter by status and page.
# Lists all degradations for the organization. Optionally filter by status, page, and source ID.
#
# @param opts [Hash] the optional parameters
# @option opts [String] :filter_page_id Optional page id filter.
# @option opts [Integer] :page_offset Offset to use as the start of the page.
# @option opts [Integer] :page_limit The number of degradations to return per page.
# @option opts [String] :include Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, status_page.
# @option opts [String] :filter_status Optional degradation status filter. Supported values: investigating, identified, monitoring, resolved.
# @option opts [String] :filter_source_id Optional source ID filter. Returns only degradations whose source matches this ID (e.g. an incident ID).
# @option opts [String] :sort Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, modified_at, -modified_at.
# @return [Array<(DegradationArray, Integer, Hash)>] DegradationArray data, response status code and response headers
def list_degradations_with_http_info(opts = {})
Expand All @@ -1140,6 +1141,7 @@ def list_degradations_with_http_info(opts = {})
query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil?
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
query_params[:'filter[source_id]'] = opts[:'filter_source_id'] if !opts[:'filter_source_id'].nil?
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

# header parameters
Expand Down
Loading