diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b9a63afce..b01929137 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17794,20 +17794,20 @@ components: - finished_at type: object DORADeploymentPatchRemediation: - description: Remediation details for the deployment. + description: Remediation details for the deployment. Optional, but required + to calculate failed deployment recovery time. properties: id: - description: The ID of the remediation action. + description: The ID of the remediation deployment. Required when the failed + deployment must be linked to a remediation deployment. example: eG42zNIkVjM type: string type: $ref: '#/components/schemas/DORADeploymentPatchRemediationType' - required: - - id - - type type: object DORADeploymentPatchRemediationType: - description: The type of remediation action taken. + description: The type of remediation action taken. Required when the failed + deployment must be linked to a remediation deployment. enum: - rollback - rollforward @@ -18011,13 +18011,13 @@ components: type: array type: object DORAFailureFetchResponse: - description: Response for fetching a single failure event. + description: Response for fetching a single incident event. properties: data: $ref: '#/components/schemas/DORAIncidentObject' type: object DORAFailureRequest: - description: Request to create a DORA failure event. + description: Request to create a DORA incident event. properties: data: $ref: '#/components/schemas/DORAFailureRequestData' @@ -18025,16 +18025,16 @@ components: - data type: object DORAFailureRequestAttributes: - description: Attributes to create a DORA failure event. + description: Attributes to create a DORA incident event. properties: custom_tags: $ref: '#/components/schemas/DORACustomTags' env: - description: Environment name that was impacted by the failure. + description: Environment name that was impacted by the incident. example: staging type: string finished_at: - description: Unix timestamp when the failure finished. It must be in nanoseconds, + description: Unix timestamp when the incident finished. It must be in nanoseconds, milliseconds, or seconds. example: 1693491984000000000 format: int64 @@ -18042,16 +18042,16 @@ components: git: $ref: '#/components/schemas/DORAGitInfo' id: - description: Failure ID. Must be 16-128 characters and contain only alphanumeric + description: Incident ID. Must be 16-128 characters and contain only alphanumeric characters, hyphens, underscores, periods, and colons (a-z, A-Z, 0-9, -, _, ., :). type: string name: - description: Failure name. + description: Incident name. example: Webserver is down failing all requests. type: string services: - description: Service names impacted by the failure. If possible, use names + description: Service names impacted by the incident. If possible, use names registered in the Service Catalog. Required when the team field is not provided. example: @@ -18060,11 +18060,11 @@ components: type: string type: array severity: - description: Failure severity. + description: Incident severity. example: High type: string started_at: - description: Unix timestamp when the failure started. It must be in nanoseconds, + description: Unix timestamp when the incident started. It must be in nanoseconds, milliseconds, or seconds. example: 1693491974000000000 format: int64 @@ -18091,7 +18091,7 @@ components: - attributes type: object DORAFailureResponse: - description: Response after receiving a DORA failure event. + description: Response after receiving a DORA incident event. properties: data: $ref: '#/components/schemas/DORAFailureResponseData' @@ -18099,10 +18099,10 @@ components: - data type: object DORAFailureResponseData: - description: Response after receiving a DORA failure event. + description: Response after receiving a DORA incident event. properties: id: - description: The ID of the received DORA failure event. + description: The ID of the received DORA incident event. example: 4242fcdd31586083 type: string type: @@ -18112,7 +18112,7 @@ components: type: object DORAFailureType: default: dora_failure - description: JSON:API type for DORA failure events. + description: JSON:API type for DORA incident events. enum: - dora_failure example: dora_failure @@ -18120,7 +18120,7 @@ components: x-enum-varnames: - DORA_FAILURE DORAFailuresListResponse: - description: Response for the list failures endpoint. + description: Response for the list incidents endpoint. example: data: - attributes: @@ -18254,7 +18254,7 @@ components: from: '2025-01-01T00:00:00Z' limit: 100 query: service:(shopist OR api-service) env:production team:backend - sort: -started_at + sort: -finished_at to: '2025-01-31T23:59:59Z' type: dora_deployments_list_request properties: @@ -18285,7 +18285,7 @@ components: type: string sort: description: Sort order (prefixed with `-` for descending). - example: -started_at + example: -finished_at type: string to: description: Maximum timestamp for requested events. @@ -18321,7 +18321,7 @@ components: x-enum-varnames: - DORA_DEPLOYMENTS_LIST_REQUEST DORAListFailuresRequest: - description: Request to get a list of failures. + description: Request to get a list of incidents. example: data: attributes: @@ -18338,7 +18338,7 @@ components: - data type: object DORAListFailuresRequestAttributes: - description: Attributes to get a list of failures. + description: Attributes to get a list of incidents. properties: from: description: Minimum timestamp for requested events. @@ -77825,7 +77825,9 @@ paths: - Change Lead Time - - Change Failure Rate' + - Change Failure Rate + + - Failed Deployment Recovery Time' operationId: CreateDORADeployment requestBody: content: @@ -77974,7 +77976,9 @@ paths: permissions: - dora_metrics_read patch: - description: Use this API endpoint to patch a deployment event. + description: Update a deployment's change failure status. Use this to mark a + deployment as a change failure or back to stable. You can optionally include + remediation details to enable failed deployment recovery time calculation. operationId: PatchDORADeployment parameters: - description: The ID of the deployment event. @@ -78015,14 +78019,14 @@ paths: - dora_metrics_write /api/v2/dora/failure: post: - description: 'Use this API endpoint to provide failure data. + description: 'Use this API endpoint to provide incident data for DORA Metrics. + Note that change failure rate and failed deployment recovery time are computed + from change failures detected on deployments, not from incident events sent + through this endpoint. - This is necessary for: - - - Change Failure Rate - - - Time to Restore' + Tracking incidents gives a side-by-side view of how failed deployments translate + into real-world incidents, including their severity and frequency.' operationId: CreateDORAFailure requestBody: content: @@ -78055,16 +78059,16 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] - summary: Send a failure event + summary: Send an incident event tags: - DORA Metrics x-codegen-request-body-name: body /api/v2/dora/failure/{failure_id}: delete: - description: Use this API endpoint to delete a failure event. + description: Use this API endpoint to delete an incident event. operationId: DeleteDORAFailure parameters: - - description: The ID of the failure event to delete. + - description: The ID of the incident event to delete. in: path name: failure_id required: true @@ -78086,7 +78090,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Delete a failure event + summary: Delete an incident event tags: - DORA Metrics x-permission: @@ -78095,7 +78099,7 @@ paths: - dora_metrics_write /api/v2/dora/failures: post: - description: Use this API endpoint to get a list of failure events. + description: Use this API endpoint to get a list of incident events. operationId: ListDORAFailures requestBody: content: @@ -78123,7 +78127,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get a list of failure events + summary: Get a list of incident events tags: - DORA Metrics x-codegen-request-body-name: body @@ -78133,10 +78137,10 @@ paths: - dora_metrics_read /api/v2/dora/failures/{failure_id}: get: - description: Use this API endpoint to get a failure event. + description: Use this API endpoint to get an incident event. operationId: GetDORAFailure parameters: - - description: The ID of the failure event. + - description: The ID of the incident event. in: path name: failure_id required: true @@ -78162,7 +78166,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get a failure event + summary: Get an incident event tags: - DORA Metrics x-codegen-request-body-name: body @@ -78177,14 +78181,10 @@ paths: instead. - Use this API endpoint to provide failure data. - + Use this API endpoint to provide incident data. - This is necessary for: - - - Change Failure Rate - - - Time to Restore' + Tracking incidents gives a side-by-side view of how failed deployments translate + into real-world incidents.' operationId: CreateDORAIncident requestBody: content: @@ -78217,7 +78217,7 @@ paths: $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] - summary: Send an incident event + summary: Send an incident event (legacy) tags: - DORA Metrics x-codegen-request-body-name: body diff --git a/examples/v2_dora-metrics_CreateDORAFailure.rs b/examples/v2_dora-metrics_CreateDORAFailure.rs index 85ac2097b..c5f9e245d 100644 --- a/examples/v2_dora-metrics_CreateDORAFailure.rs +++ b/examples/v2_dora-metrics_CreateDORAFailure.rs @@ -1,4 +1,4 @@ -// Send a failure event returns "OK - but delayed due to incident" response +// Send an incident event returns "OK" response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; use datadog_api_client::datadogV2::model::DORAFailureRequest; diff --git a/examples/v2_dora-metrics_CreateDORAIncident.rs b/examples/v2_dora-metrics_CreateDORAIncident.rs index 3c6f6c3f7..5e5b46dfc 100644 --- a/examples/v2_dora-metrics_CreateDORAIncident.rs +++ b/examples/v2_dora-metrics_CreateDORAIncident.rs @@ -1,4 +1,4 @@ -// Send an incident event returns "OK" response +// Send an incident event (legacy) returns "OK" response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; use datadog_api_client::datadogV2::model::DORAFailureRequest; diff --git a/examples/v2_dora-metrics_DeleteDORAFailure.rs b/examples/v2_dora-metrics_DeleteDORAFailure.rs index b61d17712..3ed2226d3 100644 --- a/examples/v2_dora-metrics_DeleteDORAFailure.rs +++ b/examples/v2_dora-metrics_DeleteDORAFailure.rs @@ -1,4 +1,4 @@ -// Delete a failure event returns "Accepted" response +// Delete an incident event returns "Accepted" response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; @@ -6,7 +6,7 @@ use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; async fn main() { let configuration = datadog::Configuration::new(); let api = DORAMetricsAPI::with_config(configuration); - let resp = api.delete_dora_failure("NO_VALUE".to_string()).await; + let resp = api.delete_dora_failure("failure_id".to_string()).await; if let Ok(value) = resp { println!("{:#?}", value); } else { diff --git a/examples/v2_dora-metrics_DeleteDORAFailure_3462074974.rs b/examples/v2_dora-metrics_DeleteDORAFailure_3462074974.rs new file mode 100644 index 000000000..b61d17712 --- /dev/null +++ b/examples/v2_dora-metrics_DeleteDORAFailure_3462074974.rs @@ -0,0 +1,15 @@ +// Delete a failure event returns "Accepted" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = DORAMetricsAPI::with_config(configuration); + let resp = api.delete_dora_failure("NO_VALUE".to_string()).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_dora-metrics_GetDORAFailure.rs b/examples/v2_dora-metrics_GetDORAFailure.rs index 6a0f420b7..c71ba1c3f 100644 --- a/examples/v2_dora-metrics_GetDORAFailure.rs +++ b/examples/v2_dora-metrics_GetDORAFailure.rs @@ -1,4 +1,4 @@ -// Get a failure event returns "OK" response +// Get an incident event returns "OK" response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; diff --git a/examples/v2_dora-metrics_ListDORAFailures.rs b/examples/v2_dora-metrics_ListDORAFailures.rs index ea7374ec1..b6ff5972b 100644 --- a/examples/v2_dora-metrics_ListDORAFailures.rs +++ b/examples/v2_dora-metrics_ListDORAFailures.rs @@ -1,4 +1,4 @@ -// Get a list of failure events returns "OK" response +// Get a list of incident events returns "OK" response use chrono::{DateTime, Utc}; use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; @@ -13,12 +13,14 @@ async fn main() { DORAListFailuresRequestData::new( DORAListFailuresRequestAttributes::new() .from( - DateTime::parse_from_rfc3339("2025-03-23T00:00:00+00:00") + DateTime::parse_from_rfc3339("2025-01-01T00:00:00+00:00") .expect("Failed to parse datetime") .with_timezone(&Utc), ) - .limit(1) - .to(DateTime::parse_from_rfc3339("2025-03-24T00:00:00+00:00") + .limit(100) + .query("severity:(SEV-1 OR SEV-2) env:production team:backend".to_string()) + .sort("-started_at".to_string()) + .to(DateTime::parse_from_rfc3339("2025-01-31T23:59:59+00:00") .expect("Failed to parse datetime") .with_timezone(&Utc)), ) diff --git a/examples/v2_dora-metrics_ListDORAFailures_3269988848.rs b/examples/v2_dora-metrics_ListDORAFailures_3269988848.rs new file mode 100644 index 000000000..ea7374ec1 --- /dev/null +++ b/examples/v2_dora-metrics_ListDORAFailures_3269988848.rs @@ -0,0 +1,35 @@ +// Get a list of failure events returns "OK" response +use chrono::{DateTime, Utc}; +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_dora_metrics::DORAMetricsAPI; +use datadog_api_client::datadogV2::model::DORAListFailuresRequest; +use datadog_api_client::datadogV2::model::DORAListFailuresRequestAttributes; +use datadog_api_client::datadogV2::model::DORAListFailuresRequestData; +use datadog_api_client::datadogV2::model::DORAListFailuresRequestDataType; + +#[tokio::main] +async fn main() { + let body = DORAListFailuresRequest::new( + DORAListFailuresRequestData::new( + DORAListFailuresRequestAttributes::new() + .from( + DateTime::parse_from_rfc3339("2025-03-23T00:00:00+00:00") + .expect("Failed to parse datetime") + .with_timezone(&Utc), + ) + .limit(1) + .to(DateTime::parse_from_rfc3339("2025-03-24T00:00:00+00:00") + .expect("Failed to parse datetime") + .with_timezone(&Utc)), + ) + .type_(DORAListFailuresRequestDataType::DORA_FAILURES_LIST_REQUEST), + ); + let configuration = datadog::Configuration::new(); + let api = DORAMetricsAPI::with_config(configuration); + let resp = api.list_dora_failures(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_dora-metrics_PatchDORADeployment.rs b/examples/v2_dora-metrics_PatchDORADeployment.rs index 95836cdc5..25bb24ef1 100644 --- a/examples/v2_dora-metrics_PatchDORADeployment.rs +++ b/examples/v2_dora-metrics_PatchDORADeployment.rs @@ -13,10 +13,11 @@ async fn main() { let body = DORADeploymentPatchRequest::new(DORADeploymentPatchRequestData::new( DORADeploymentPatchRequestAttributes::new() .change_failure(true) - .remediation(DORADeploymentPatchRemediation::new( - "eG42zNIkVjM".to_string(), - DORADeploymentPatchRemediationType::ROLLBACK, - )), + .remediation( + DORADeploymentPatchRemediation::new() + .id("eG42zNIkVjM".to_string()) + .type_(DORADeploymentPatchRemediationType::ROLLBACK), + ), "z_RwVLi7v4Y".to_string(), DORADeploymentPatchRequestDataType::DORA_DEPLOYMENT_PATCH_REQUEST, )); diff --git a/src/datadogV2/api/api_dora_metrics.rs b/src/datadogV2/api/api_dora_metrics.rs index 58d4437ab..b4a9b934f 100644 --- a/src/datadogV2/api/api_dora_metrics.rs +++ b/src/datadogV2/api/api_dora_metrics.rs @@ -173,6 +173,7 @@ impl DORAMetricsAPI { /// - Deployment Frequency /// - Change Lead Time /// - Change Failure Rate + /// - Failed Deployment Recovery Time pub async fn create_dora_deployment( &self, body: crate::datadogV2::model::DORADeploymentRequest, @@ -200,6 +201,7 @@ impl DORAMetricsAPI { /// - Deployment Frequency /// - Change Lead Time /// - Change Failure Rate + /// - Failed Deployment Recovery Time pub async fn create_dora_deployment_with_http_info( &self, body: crate::datadogV2::model::DORADeploymentRequest, @@ -324,11 +326,9 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to provide failure data. - /// - /// This is necessary for: - /// - Change Failure Rate - /// - Time to Restore + /// Use this API endpoint to provide incident data for DORA Metrics. + /// Note that change failure rate and failed deployment recovery time are computed from change failures detected on deployments, not from incident events sent through this endpoint. + /// Tracking incidents gives a side-by-side view of how failed deployments translate into real-world incidents, including their severity and frequency. pub async fn create_dora_failure( &self, body: crate::datadogV2::model::DORAFailureRequest, @@ -348,11 +348,9 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to provide failure data. - /// - /// This is necessary for: - /// - Change Failure Rate - /// - Time to Restore + /// Use this API endpoint to provide incident data for DORA Metrics. + /// Note that change failure rate and failed deployment recovery time are computed from change failures detected on deployments, not from incident events sent through this endpoint. + /// Tracking incidents gives a side-by-side view of how failed deployments translate into real-world incidents, including their severity and frequency. pub async fn create_dora_failure_with_http_info( &self, body: crate::datadogV2::model::DORAFailureRequest, @@ -479,11 +477,8 @@ impl DORAMetricsAPI { /// **Note**: This endpoint is deprecated. Please use `/api/v2/dora/failure` instead. /// - /// Use this API endpoint to provide failure data. - /// - /// This is necessary for: - /// - Change Failure Rate - /// - Time to Restore + /// Use this API endpoint to provide incident data. + /// Tracking incidents gives a side-by-side view of how failed deployments translate into real-world incidents. pub async fn create_dora_incident( &self, body: crate::datadogV2::model::DORAFailureRequest, @@ -505,11 +500,8 @@ impl DORAMetricsAPI { /// **Note**: This endpoint is deprecated. Please use `/api/v2/dora/failure` instead. /// - /// Use this API endpoint to provide failure data. - /// - /// This is necessary for: - /// - Change Failure Rate - /// - Time to Restore + /// Use this API endpoint to provide incident data. + /// Tracking incidents gives a side-by-side view of how failed deployments translate into real-world incidents. pub async fn create_dora_incident_with_http_info( &self, body: crate::datadogV2::model::DORAFailureRequest, @@ -725,7 +717,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to delete a failure event. + /// Use this API endpoint to delete an incident event. pub async fn delete_dora_failure( &self, failure_id: String, @@ -736,7 +728,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to delete a failure event. + /// Use this API endpoint to delete an incident event. pub async fn delete_dora_failure_with_http_info( &self, failure_id: String, @@ -922,7 +914,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to get a failure event. + /// Use this API endpoint to get an incident event. pub async fn get_dora_failure( &self, failure_id: String, @@ -944,7 +936,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to get a failure event. + /// Use this API endpoint to get an incident event. pub async fn get_dora_failure_with_http_info( &self, failure_id: String, @@ -1185,7 +1177,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to get a list of failure events. + /// Use this API endpoint to get a list of incident events. pub async fn list_dora_failures( &self, body: crate::datadogV2::model::DORAListFailuresRequest, @@ -1207,7 +1199,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to get a list of failure events. + /// Use this API endpoint to get a list of incident events. pub async fn list_dora_failures_with_http_info( &self, body: crate::datadogV2::model::DORAListFailuresRequest, @@ -1339,7 +1331,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to patch a deployment event. + /// Update a deployment's change failure status. Use this to mark a deployment as a change failure or back to stable. You can optionally include remediation details to enable failed deployment recovery time calculation. pub async fn patch_dora_deployment( &self, deployment_id: String, @@ -1354,7 +1346,7 @@ impl DORAMetricsAPI { } } - /// Use this API endpoint to patch a deployment event. + /// Update a deployment's change failure status. Use this to mark a deployment as a change failure or back to stable. You can optionally include remediation details to enable failed deployment recovery time calculation. pub async fn patch_dora_deployment_with_http_info( &self, deployment_id: String, diff --git a/src/datadogV2/model/model_dora_deployment_patch_remediation.rs b/src/datadogV2/model/model_dora_deployment_patch_remediation.rs index 1c8fffccf..ca69903dd 100644 --- a/src/datadogV2/model/model_dora_deployment_patch_remediation.rs +++ b/src/datadogV2/model/model_dora_deployment_patch_remediation.rs @@ -6,17 +6,17 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Remediation details for the deployment. +/// Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct DORADeploymentPatchRemediation { - /// The ID of the remediation action. + /// The ID of the remediation deployment. Required when the failed deployment must be linked to a remediation deployment. #[serde(rename = "id")] - pub id: String, - /// The type of remediation action taken. + pub id: Option, + /// The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment. #[serde(rename = "type")] - pub type_: crate::datadogV2::model::DORADeploymentPatchRemediationType, + pub type_: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -25,18 +25,28 @@ pub struct DORADeploymentPatchRemediation { } impl DORADeploymentPatchRemediation { - pub fn new( - id: String, - type_: crate::datadogV2::model::DORADeploymentPatchRemediationType, - ) -> DORADeploymentPatchRemediation { + pub fn new() -> DORADeploymentPatchRemediation { DORADeploymentPatchRemediation { - id, - type_, + id: None, + type_: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } + pub fn id(mut self, value: String) -> Self { + self.id = Some(value); + self + } + + pub fn type_( + mut self, + value: crate::datadogV2::model::DORADeploymentPatchRemediationType, + ) -> Self { + self.type_ = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -46,6 +56,12 @@ impl DORADeploymentPatchRemediation { } } +impl Default for DORADeploymentPatchRemediation { + fn default() -> Self { + Self::new() + } +} + impl<'de> Deserialize<'de> for DORADeploymentPatchRemediation { fn deserialize(deserializer: D) -> Result where @@ -75,9 +91,15 @@ impl<'de> Deserialize<'de> for DORADeploymentPatchRemediation { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { "id" => { + if v.is_null() { + continue; + } id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } "type" => { + if v.is_null() { + continue; + } type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { @@ -95,8 +117,6 @@ impl<'de> Deserialize<'de> for DORADeploymentPatchRemediation { } } } - let id = id.ok_or_else(|| M::Error::missing_field("id"))?; - let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; let content = DORADeploymentPatchRemediation { id, diff --git a/src/datadogV2/model/model_dora_deployment_patch_request_attributes.rs b/src/datadogV2/model/model_dora_deployment_patch_request_attributes.rs index 0726d1250..93f2bf0ac 100644 --- a/src/datadogV2/model/model_dora_deployment_patch_request_attributes.rs +++ b/src/datadogV2/model/model_dora_deployment_patch_request_attributes.rs @@ -14,7 +14,7 @@ pub struct DORADeploymentPatchRequestAttributes { /// Indicates whether the deployment resulted in a change failure. #[serde(rename = "change_failure")] pub change_failure: Option, - /// Remediation details for the deployment. + /// Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. #[serde(rename = "remediation")] pub remediation: Option, #[serde(flatten)] diff --git a/src/datadogV2/model/model_dora_failure_fetch_response.rs b/src/datadogV2/model/model_dora_failure_fetch_response.rs index 6beb9165f..12d547f2d 100644 --- a/src/datadogV2/model/model_dora_failure_fetch_response.rs +++ b/src/datadogV2/model/model_dora_failure_fetch_response.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Response for fetching a single failure event. +/// Response for fetching a single incident event. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_dora_failure_request.rs b/src/datadogV2/model/model_dora_failure_request.rs index fa7fa4849..2f474b724 100644 --- a/src/datadogV2/model/model_dora_failure_request.rs +++ b/src/datadogV2/model/model_dora_failure_request.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Request to create a DORA failure event. +/// Request to create a DORA incident event. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_dora_failure_request_attributes.rs b/src/datadogV2/model/model_dora_failure_request_attributes.rs index 916f16936..7e57ecb8c 100644 --- a/src/datadogV2/model/model_dora_failure_request_attributes.rs +++ b/src/datadogV2/model/model_dora_failure_request_attributes.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Attributes to create a DORA failure event. +/// Attributes to create a DORA incident event. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] @@ -18,28 +18,28 @@ pub struct DORAFailureRequestAttributes { with = "::serde_with::rust::double_option" )] pub custom_tags: Option>>, - /// Environment name that was impacted by the failure. + /// Environment name that was impacted by the incident. #[serde(rename = "env")] pub env: Option, - /// Unix timestamp when the failure finished. It must be in nanoseconds, milliseconds, or seconds. + /// Unix timestamp when the incident finished. It must be in nanoseconds, milliseconds, or seconds. #[serde(rename = "finished_at")] pub finished_at: Option, /// Git info for DORA Metrics events. #[serde(rename = "git")] pub git: Option, - /// Failure ID. Must be 16-128 characters and contain only alphanumeric characters, hyphens, underscores, periods, and colons (a-z, A-Z, 0-9, -, _, ., :). + /// Incident ID. Must be 16-128 characters and contain only alphanumeric characters, hyphens, underscores, periods, and colons (a-z, A-Z, 0-9, -, _, ., :). #[serde(rename = "id")] pub id: Option, - /// Failure name. + /// Incident name. #[serde(rename = "name")] pub name: Option, - /// Service names impacted by the failure. If possible, use names registered in the Service Catalog. Required when the team field is not provided. + /// Service names impacted by the incident. If possible, use names registered in the Service Catalog. Required when the team field is not provided. #[serde(rename = "services")] pub services: Option>, - /// Failure severity. + /// Incident severity. #[serde(rename = "severity")] pub severity: Option, - /// Unix timestamp when the failure started. It must be in nanoseconds, milliseconds, or seconds. + /// Unix timestamp when the incident started. It must be in nanoseconds, milliseconds, or seconds. #[serde(rename = "started_at")] pub started_at: i64, /// Name of the team owning the services impacted. If possible, use team handles registered in Datadog. Required when the services field is not provided. diff --git a/src/datadogV2/model/model_dora_failure_request_data.rs b/src/datadogV2/model/model_dora_failure_request_data.rs index 1948769a4..b16d49724 100644 --- a/src/datadogV2/model/model_dora_failure_request_data.rs +++ b/src/datadogV2/model/model_dora_failure_request_data.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct DORAFailureRequestData { - /// Attributes to create a DORA failure event. + /// Attributes to create a DORA incident event. #[serde(rename = "attributes")] pub attributes: crate::datadogV2::model::DORAFailureRequestAttributes, #[serde(flatten)] diff --git a/src/datadogV2/model/model_dora_failure_response.rs b/src/datadogV2/model/model_dora_failure_response.rs index b87d2fdc2..b28c9b4a8 100644 --- a/src/datadogV2/model/model_dora_failure_response.rs +++ b/src/datadogV2/model/model_dora_failure_response.rs @@ -6,12 +6,12 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Response after receiving a DORA failure event. +/// Response after receiving a DORA incident event. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct DORAFailureResponse { - /// Response after receiving a DORA failure event. + /// Response after receiving a DORA incident event. #[serde(rename = "data")] pub data: crate::datadogV2::model::DORAFailureResponseData, #[serde(flatten)] diff --git a/src/datadogV2/model/model_dora_failure_response_data.rs b/src/datadogV2/model/model_dora_failure_response_data.rs index 787ad8722..cd1869900 100644 --- a/src/datadogV2/model/model_dora_failure_response_data.rs +++ b/src/datadogV2/model/model_dora_failure_response_data.rs @@ -6,15 +6,15 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Response after receiving a DORA failure event. +/// Response after receiving a DORA incident event. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct DORAFailureResponseData { - /// The ID of the received DORA failure event. + /// The ID of the received DORA incident event. #[serde(rename = "id")] pub id: String, - /// JSON:API type for DORA failure events. + /// JSON:API type for DORA incident events. #[serde(rename = "type")] pub type_: Option, #[serde(flatten)] diff --git a/src/datadogV2/model/model_dora_failures_list_response.rs b/src/datadogV2/model/model_dora_failures_list_response.rs index bc96ce092..9c6dee7ee 100644 --- a/src/datadogV2/model/model_dora_failures_list_response.rs +++ b/src/datadogV2/model/model_dora_failures_list_response.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Response for the list failures endpoint. +/// Response for the list incidents endpoint. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_dora_incident_object.rs b/src/datadogV2/model/model_dora_incident_object.rs index 91698b8fe..9698769da 100644 --- a/src/datadogV2/model/model_dora_incident_object.rs +++ b/src/datadogV2/model/model_dora_incident_object.rs @@ -17,7 +17,7 @@ pub struct DORAIncidentObject { /// The ID of the incident event. #[serde(rename = "id")] pub id: Option, - /// JSON:API type for DORA failure events. + /// JSON:API type for DORA incident events. #[serde(rename = "type")] pub type_: Option, #[serde(flatten)] diff --git a/src/datadogV2/model/model_dora_list_failures_request.rs b/src/datadogV2/model/model_dora_list_failures_request.rs index b4fa788ac..99595bada 100644 --- a/src/datadogV2/model/model_dora_list_failures_request.rs +++ b/src/datadogV2/model/model_dora_list_failures_request.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Request to get a list of failures. +/// Request to get a list of incidents. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_dora_list_failures_request_attributes.rs b/src/datadogV2/model/model_dora_list_failures_request_attributes.rs index 4d77464ff..a4440ffeb 100644 --- a/src/datadogV2/model/model_dora_list_failures_request_attributes.rs +++ b/src/datadogV2/model/model_dora_list_failures_request_attributes.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Attributes to get a list of failures. +/// Attributes to get a list of incidents. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/model/model_dora_list_failures_request_data.rs b/src/datadogV2/model/model_dora_list_failures_request_data.rs index 93944e4b8..affa604c2 100644 --- a/src/datadogV2/model/model_dora_list_failures_request_data.rs +++ b/src/datadogV2/model/model_dora_list_failures_request_data.rs @@ -11,7 +11,7 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct DORAListFailuresRequestData { - /// Attributes to get a list of failures. + /// Attributes to get a list of incidents. #[serde(rename = "attributes")] pub attributes: crate::datadogV2::model::DORAListFailuresRequestAttributes, /// The definition of `DORAListFailuresRequestDataType` object. diff --git a/tests/scenarios/features/v2/dora_metrics.feature b/tests/scenarios/features/v2/dora_metrics.feature index 7a3275b54..768442f37 100644 --- a/tests/scenarios/features/v2/dora_metrics.feature +++ b/tests/scenarios/features/v2/dora_metrics.feature @@ -41,34 +41,34 @@ Feature: DORA Metrics Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend - Scenario: Get a deployment event returns "Bad Request" response + Scenario: Delete an incident event returns "Accepted" response Given a valid "appKeyAuth" key in the system - And new "GetDORADeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" + And new "DeleteDORAFailure" request + And request contains "failure_id" parameter from "REPLACE.ME" When the request is sent - Then the response status is 400 Bad Request + Then the response status is 202 Accepted @generated @skip @team:DataDog/ci-app-backend - Scenario: Get a deployment event returns "OK" response + Scenario: Delete an incident event returns "Bad Request" response Given a valid "appKeyAuth" key in the system - And new "GetDORADeployment" request - And request contains "deployment_id" parameter from "REPLACE.ME" + And new "DeleteDORAFailure" request + And request contains "failure_id" parameter from "REPLACE.ME" When the request is sent - Then the response status is 200 OK + Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend - Scenario: Get a failure event returns "Bad Request" response + Scenario: Get a deployment event returns "Bad Request" response Given a valid "appKeyAuth" key in the system - And new "GetDORAFailure" request - And request contains "failure_id" parameter from "REPLACE.ME" + And new "GetDORADeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend - Scenario: Get a failure event returns "OK" response + Scenario: Get a deployment event returns "OK" response Given a valid "appKeyAuth" key in the system - And new "GetDORAFailure" request - And request contains "failure_id" parameter from "REPLACE.ME" + And new "GetDORADeployment" request + And request contains "deployment_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK @@ -104,6 +104,38 @@ Feature: DORA Metrics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a list of incident events returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListDORAFailures" request + And body with value {"data": {"attributes": {"from": "2025-01-01T00:00:00Z", "limit": 100, "query": "severity:(SEV-1 OR SEV-2) env:production team:backend", "sort": "-started_at", "to": "2025-01-31T23:59:59Z"}, "type": "dora_failures_list_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get a list of incident events returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListDORAFailures" request + And body with value {"data": {"attributes": {"from": "2025-01-01T00:00:00Z", "limit": 100, "query": "severity:(SEV-1 OR SEV-2) env:production team:backend", "sort": "-started_at", "to": "2025-01-31T23:59:59Z"}, "type": "dora_failures_list_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get an incident event returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "GetDORAFailure" request + And request contains "failure_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Get an incident event returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "GetDORAFailure" request + And request contains "failure_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend Scenario: Patch a deployment event returns "Accepted" response Given a valid "appKeyAuth" key in the system @@ -150,37 +182,51 @@ Feature: DORA Metrics When the request is sent Then the response status is 400 Bad Request + @replay-only @team:DataDog/ci-app-backend + Scenario: Send a failure event returns "OK" response + Given new "CreateDORAIncident" request + And body with value {"data": {"attributes": {"finished_at": 1707842944600000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "services": ["shopist"], "severity": "High", "started_at": 1707842944500000000, "team": "backend", "version": "v1.12.07"}}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ci-app-backend - Scenario: Send a failure event returns "OK - but delayed due to incident" response - Given new "CreateDORAFailure" request + Scenario: Send an incident event (legacy) returns "Bad Request" response + Given new "CreateDORAIncident" request + And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ci-app-backend + Scenario: Send an incident event (legacy) returns "OK - but delayed due to incident" response + Given new "CreateDORAIncident" request And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 202 OK - but delayed due to incident - @replay-only @team:DataDog/ci-app-backend - Scenario: Send a failure event returns "OK" response + @generated @skip @team:DataDog/ci-app-backend + Scenario: Send an incident event (legacy) returns "OK" response Given new "CreateDORAIncident" request - And body with value {"data": {"attributes": {"finished_at": 1707842944600000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "services": ["shopist"], "severity": "High", "started_at": 1707842944500000000, "team": "backend", "version": "v1.12.07"}}} + And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/ci-app-backend Scenario: Send an incident event returns "Bad Request" response - Given new "CreateDORAIncident" request + Given new "CreateDORAFailure" request And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Send an incident event returns "OK - but delayed due to incident" response - Given new "CreateDORAIncident" request + Given new "CreateDORAFailure" request And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 202 OK - but delayed due to incident @generated @skip @team:DataDog/ci-app-backend Scenario: Send an incident event returns "OK" response - Given new "CreateDORAIncident" request + Given new "CreateDORAFailure" request And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}} When the request is sent Then the response status is 200 OK