Skip to content
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
527 changes: 477 additions & 50 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions examples/v2/status-pages/EditDegradationUpdate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Edit degradation update returns "OK" response

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

body = DatadogAPIClient::V2::PatchDegradationUpdateRequest.new({
data: DatadogAPIClient::V2::PatchDegradationUpdateRequestData.new({
attributes: DatadogAPIClient::V2::PatchDegradationUpdateRequestDataAttributes.new({
description: "We've identified the source of the latency increase and are deploying a fix.",
status: DatadogAPIClient::V2::PatchDegradationUpdateRequestDataAttributesStatus::IDENTIFIED,
}),
id: "00000000-0000-0000-0000-000000000000",
type: DatadogAPIClient::V2::PatchDegradationUpdateRequestDataType::DEGRADATION_UPDATES,
}),
})
p api_instance.edit_degradation_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)
5 changes: 5 additions & 0 deletions examples/v2/status-pages/SoftDeleteDegradationUpdate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Soft delete degradation update returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new
api_instance.soft_delete_degradation_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
data: DatadogAPIClient::V2::TestOptimizationUpdateServiceSettingsRequestData.new({
attributes: DatadogAPIClient::V2::TestOptimizationUpdateServiceSettingsRequestAttributes.new({
auto_test_retries_enabled: false,
auto_test_retries_enabled_inherit: false,
code_coverage_enabled: false,
code_coverage_enabled_inherit: false,
early_flake_detection_enabled: false,
early_flake_detection_enabled_inherit: false,
env: "prod",
failed_test_replay_enabled: false,
pr_comments_enabled: true,
failed_test_replay_enabled_inherit: false,
pr_comments_enabled: false,
repository_id: "github.com/datadog/shopist",
service_name: "shopist",
test_impact_analysis_enabled: false,
test_impact_analysis_enabled: true,
test_impact_analysis_enabled_inherit: true,
}),
type: DatadogAPIClient::V2::TestOptimizationUpdateServiceSettingsRequestDataType::TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST,
}),
Expand Down
12 changes: 12 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5550,6 +5550,18 @@
"include" => "String",
"body" => "PatchDegradationRequest",
},
"v2.SoftDeleteDegradationUpdate" => {
"degradation_id" => "UUID",
"page_id" => "UUID",
"update_id" => "UUID",
},
"v2.EditDegradationUpdate" => {
"degradation_id" => "UUID",
"include" => "String",
"page_id" => "UUID",
"update_id" => "UUID",
"body" => "PatchDegradationUpdateRequest",
},
"v2.CreateMaintenance" => {
"page_id" => "UUID",
"notify_subscribers" => "Boolean",
Expand Down
19 changes: 19 additions & 0 deletions features/v2/status_pages.feature
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ Feature: Status Pages
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/incident-app
Scenario: Edit degradation update returns "OK" response
Given new "EditDegradationUpdate" request
And request contains "degradation_id" parameter from "REPLACE.ME"
And request contains "page_id" parameter from "REPLACE.ME"
And request contains "update_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "We've identified the source of the latency increase and are deploying a fix.", "status": "identified"}, "id": "00000000-0000-0000-0000-000000000000", "type": "degradation_updates"}}
When the request is sent
Then the response status is 200 OK

@team:DataDog/incident-app
Scenario: Get component returns "OK" response
Given new "GetComponent" request
Expand Down Expand Up @@ -178,6 +188,15 @@ Feature: Status Pages
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/incident-app
Scenario: Soft delete degradation update returns "No Content" response
Given new "SoftDeleteDegradationUpdate" request
And request contains "degradation_id" parameter from "REPLACE.ME"
And request contains "page_id" parameter from "REPLACE.ME"
And request contains "update_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/incident-app
Scenario: Unpublish status page returns "No Content" response
Given new "UnpublishStatusPage" request
Expand Down
6 changes: 3 additions & 3 deletions features/v2/test_optimization.feature
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,21 @@ Feature: Test Optimization
@generated @skip @team:DataDog/ci-app-backend
Scenario: Update Test Optimization service settings returns "Bad Request" response
Given new "UpdateTestOptimizationServiceSettings" request
And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}}
And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "auto_test_retries_enabled_inherit": false, "code_coverage_enabled": false, "code_coverage_enabled_inherit": false, "early_flake_detection_enabled": false, "early_flake_detection_enabled_inherit": false, "env": "prod", "failed_test_replay_enabled": false, "failed_test_replay_enabled_inherit": false, "pr_comments_enabled": false, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": true, "test_impact_analysis_enabled_inherit": true}, "type": "test_optimization_update_service_settings_request"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ci-app-backend
Scenario: Update Test Optimization service settings returns "Not Found" response
Given new "UpdateTestOptimizationServiceSettings" request
And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}}
And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "auto_test_retries_enabled_inherit": false, "code_coverage_enabled": false, "code_coverage_enabled_inherit": false, "early_flake_detection_enabled": false, "early_flake_detection_enabled_inherit": false, "env": "prod", "failed_test_replay_enabled": false, "failed_test_replay_enabled_inherit": false, "pr_comments_enabled": false, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": true, "test_impact_analysis_enabled_inherit": true}, "type": "test_optimization_update_service_settings_request"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/ci-app-backend
Scenario: Update Test Optimization service settings returns "OK" response
Given new "UpdateTestOptimizationServiceSettings" request
And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}}
And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "auto_test_retries_enabled_inherit": false, "code_coverage_enabled": false, "code_coverage_enabled_inherit": false, "early_flake_detection_enabled": false, "early_flake_detection_enabled_inherit": false, "env": "prod", "failed_test_replay_enabled": false, "failed_test_replay_enabled_inherit": false, "pr_comments_enabled": false, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": true, "test_impact_analysis_enabled_inherit": true}, "type": "test_optimization_update_service_settings_request"}}
When the request is sent
Then the response status is 200 OK

Expand Down
12 changes: 12 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8521,6 +8521,18 @@
"type": "idempotent"
}
},
"SoftDeleteDegradationUpdate": {
"tag": "Status Pages",
"undo": {
"type": "idempotent"
}
},
"EditDegradationUpdate": {
"tag": "Status Pages",
"undo": {
"type": "idempotent"
}
},
"CreateMaintenance": {
"tag": "Status Pages",
"undo": {
Expand Down
17 changes: 17 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,18 @@ def overrides
"v2.degradation_data_relationships_status_page" => "DegradationDataRelationshipsStatusPage",
"v2.degradation_data_relationships_status_page_data" => "DegradationDataRelationshipsStatusPageData",
"v2.degradation_included" => "DegradationIncluded",
"v2.degradation_update" => "DegradationUpdate",
"v2.degradation_update_data" => "DegradationUpdateData",
"v2.degradation_update_data_attributes" => "DegradationUpdateDataAttributes",
"v2.degradation_update_data_attributes_components_affected_items" => "DegradationUpdateDataAttributesComponentsAffectedItems",
"v2.degradation_update_data_relationships" => "DegradationUpdateDataRelationships",
"v2.degradation_update_data_relationships_degradation" => "DegradationUpdateDataRelationshipsDegradation",
"v2.degradation_update_data_relationships_degradation_data" => "DegradationUpdateDataRelationshipsDegradationData",
"v2.degradation_update_data_relationships_status_page" => "DegradationUpdateDataRelationshipsStatusPage",
"v2.degradation_update_data_relationships_status_page_data" => "DegradationUpdateDataRelationshipsStatusPageData",
"v2.degradation_update_data_relationships_user" => "DegradationUpdateDataRelationshipsUser",
"v2.degradation_update_data_relationships_user_data" => "DegradationUpdateDataRelationshipsUserData",
"v2.degradation_update_included" => "DegradationUpdateIncluded",
"v2.delete_app_response" => "DeleteAppResponse",
"v2.delete_app_response_data" => "DeleteAppResponseData",
"v2.delete_apps_datastore_item_request" => "DeleteAppsDatastoreItemRequest",
Expand Down Expand Up @@ -5433,6 +5445,11 @@ def overrides
"v2.patch_degradation_request_data_attributes_components_affected_items" => "PatchDegradationRequestDataAttributesComponentsAffectedItems",
"v2.patch_degradation_request_data_attributes_status" => "PatchDegradationRequestDataAttributesStatus",
"v2.patch_degradation_request_data_type" => "PatchDegradationRequestDataType",
"v2.patch_degradation_update_request" => "PatchDegradationUpdateRequest",
"v2.patch_degradation_update_request_data" => "PatchDegradationUpdateRequestData",
"v2.patch_degradation_update_request_data_attributes" => "PatchDegradationUpdateRequestDataAttributes",
"v2.patch_degradation_update_request_data_attributes_status" => "PatchDegradationUpdateRequestDataAttributesStatus",
"v2.patch_degradation_update_request_data_type" => "PatchDegradationUpdateRequestDataType",
"v2.patch_incident_notification_template_request" => "PatchIncidentNotificationTemplateRequest",
"v2.patch_maintenance_request" => "PatchMaintenanceRequest",
"v2.patch_maintenance_request_data" => "PatchMaintenanceRequestData",
Expand Down
159 changes: 159 additions & 0 deletions lib/datadog_api_client/v2/api/status_pages_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,90 @@ def delete_status_page_with_http_info(page_id, opts = {})
return data, status_code, headers
end

# Edit degradation update.
#
# @see #edit_degradation_update_with_http_info
def edit_degradation_update(degradation_id, page_id, update_id, body, opts = {})
data, _status_code, _headers = edit_degradation_update_with_http_info(degradation_id, page_id, update_id, body, opts)
data
end

# Edit degradation update.
#
# Edits a specific degradation update.
#
# @param degradation_id [UUID] The ID of the degradation.
# @param page_id [UUID] The ID of the status page.
# @param update_id [UUID] The ID of the degradation update.
# @param body [PatchDegradationUpdateRequest]
# @param opts [Hash] the optional parameters
# @option opts [String] :include Comma-separated list of resources to include. Supported values: created_by_user, last_modified_by_user, degradation, status_page.
# @return [Array<(DegradationUpdate, Integer, Hash)>] DegradationUpdate data, response status code and response headers
def edit_degradation_update_with_http_info(degradation_id, page_id, update_id, body, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: StatusPagesAPI.edit_degradation_update ...'
end
# verify the required parameter 'degradation_id' is set
if @api_client.config.client_side_validation && degradation_id.nil?
fail ArgumentError, "Missing the required parameter 'degradation_id' when calling StatusPagesAPI.edit_degradation_update"
end
# verify the required parameter 'page_id' is set
if @api_client.config.client_side_validation && page_id.nil?
fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.edit_degradation_update"
end
# verify the required parameter 'update_id' is set
if @api_client.config.client_side_validation && update_id.nil?
fail ArgumentError, "Missing the required parameter 'update_id' when calling StatusPagesAPI.edit_degradation_update"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling StatusPagesAPI.edit_degradation_update"
end
# resource path
local_var_path = '/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}'.sub('{degradation_id}', CGI.escape(degradation_id.to_s).gsub('%2F', '/')).sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')).sub('{update_id}', CGI.escape(update_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}
query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

# return_type
return_type = opts[:debug_return_type] || 'DegradationUpdate'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :edit_degradation_update,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: StatusPagesAPI#edit_degradation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get component.
#
# @see #get_component_with_http_info
Expand Down Expand Up @@ -1298,6 +1382,81 @@ def publish_status_page_with_http_info(page_id, opts = {})
return data, status_code, headers
end

# Soft delete degradation update.
#
# @see #soft_delete_degradation_update_with_http_info
def soft_delete_degradation_update(degradation_id, page_id, update_id, opts = {})
soft_delete_degradation_update_with_http_info(degradation_id, page_id, update_id, opts)
nil
end

# Soft delete degradation update.
#
# Soft-deletes a degradation update.
#
# @param degradation_id [UUID] The ID of the degradation.
# @param page_id [UUID] The ID of the status page.
# @param update_id [UUID] The ID of the degradation update.
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def soft_delete_degradation_update_with_http_info(degradation_id, page_id, update_id, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: StatusPagesAPI.soft_delete_degradation_update ...'
end
# verify the required parameter 'degradation_id' is set
if @api_client.config.client_side_validation && degradation_id.nil?
fail ArgumentError, "Missing the required parameter 'degradation_id' when calling StatusPagesAPI.soft_delete_degradation_update"
end
# verify the required parameter 'page_id' is set
if @api_client.config.client_side_validation && page_id.nil?
fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.soft_delete_degradation_update"
end
# verify the required parameter 'update_id' is set
if @api_client.config.client_side_validation && update_id.nil?
fail ArgumentError, "Missing the required parameter 'update_id' when calling StatusPagesAPI.soft_delete_degradation_update"
end
# resource path
local_var_path = '/api/v2/statuspages/{page_id}/degradations/{degradation_id}/updates/{update_id}'.sub('{degradation_id}', CGI.escape(degradation_id.to_s).gsub('%2F', '/')).sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')).sub('{update_id}', CGI.escape(update_id.to_s).gsub('%2F', '/'))

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type]

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :soft_delete_degradation_update,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: StatusPagesAPI#soft_delete_degradation_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Unpublish status page.
#
# @see #unpublish_status_page_with_http_info
Expand Down
Loading
Loading