diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c2aa6fb6864f..6898e0df598e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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. @@ -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 diff --git a/examples/v2/status-pages/ListDegradations_3179419218.rb b/examples/v2/status-pages/ListDegradations_3179419218.rb new file mode 100644 index 000000000000..58e90f606407 --- /dev/null +++ b/examples/v2/status-pages/ListDegradations_3179419218.rb @@ -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) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f4cb633ab3a6..57e2d8ac6fd4 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5609,6 +5609,7 @@ "page_limit" => "Integer", "include" => "String", "filter_status" => "String", + "filter_source_id" => "String", "sort" => "String", }, "v2.ListMaintenances" => { diff --git a/features/v2/status_pages.feature b/features/v2/status_pages.feature index 99cb8e3ed61b..0d8ec8972108 100644 --- a/features/v2/status_pages.feature +++ b/features/v2/status_pages.feature @@ -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 diff --git a/lib/datadog_api_client/v2/api/status_pages_api.rb b/lib/datadog_api_client/v2/api/status_pages_api.rb index 8e407eedd278..a2b6e8e427f6 100644 --- a/lib/datadog_api_client/v2/api/status_pages_api.rb +++ b/lib/datadog_api_client/v2/api/status_pages_api.rb @@ -1115,7 +1115,7 @@ 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. @@ -1123,6 +1123,7 @@ def list_degradations(opts = {}) # @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 = {}) @@ -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