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
172 changes: 172 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,16 @@ components:
required: true
schema:
type: string
DisableCorrections:
description: Whether to exclude correction windows from the SLO status calculation.
Defaults to false.
in: query
name: disable_corrections
required: false
schema:
default: false
example: false
type: boolean
EntityID:
description: UUID or Entity Ref.
in: path
Expand Down Expand Up @@ -449,6 +459,15 @@ components:
required: false
schema:
$ref: '#/components/schemas/RelationType'
FromTimestamp:
description: The starting timestamp for the SLO status query in epoch seconds.
in: query
name: from_ts
required: true
schema:
example: 1690901870
format: int64
type: integer
GCPSTSServiceAccountID:
description: Your GCP STS enabled service account's unique ID.
in: path
Expand Down Expand Up @@ -1088,6 +1107,14 @@ components:
required: false
schema:
type: boolean
SloID:
description: The ID of the SLO.
in: path
name: slo_id
required: true
schema:
example: 00000000-0000-0000-0000-000000000000
type: string
SpansMetricIDParameter:
description: The name of the span-based metric.
in: path
Expand All @@ -1109,6 +1136,15 @@ components:
required: true
schema:
type: string
ToTimestamp:
description: The ending timestamp for the SLO status query in epoch seconds.
in: query
name: to_ts
required: true
schema:
example: 1706803070
format: int64
type: integer
UserID:
description: The ID of the user.
in: path
Expand Down Expand Up @@ -43787,6 +43823,22 @@ components:
from the other indexes
type: string
type: object
RawErrorBudgetRemaining:
description: The raw error budget remaining for the SLO.
properties:
unit:
description: The unit of the error budget (e.g., seconds, requests).
example: seconds
type: string
value:
description: The numeric value of the remaining error budget.
example: 86400.5
format: double
type: number
required:
- value
- unit
type: object
ReadinessGate:
description: Used to merge multiple branches into a single branch.
properties:
Expand Down Expand Up @@ -53911,6 +53963,69 @@ components:
required:
- attributes
type: object
SloStatusData:
description: The data portion of the SLO status response.
properties:
attributes:
$ref: '#/components/schemas/SloStatusDataAttributes'
id:
description: The ID of the SLO.
example: 00000000-0000-0000-0000-000000000000
type: string
type:
$ref: '#/components/schemas/SloStatusType'
required:
- id
- type
- attributes
type: object
SloStatusDataAttributes:
description: The attributes of the SLO status.
properties:
error_budget_remaining:
description: The percentage of error budget remaining.
example: 99.5
format: double
type: number
raw_error_budget_remaining:
$ref: '#/components/schemas/RawErrorBudgetRemaining'
sli:
description: The current Service Level Indicator (SLI) value as a percentage.
example: 99.95
format: double
type: number
span_precision:
description: The precision of the time span in seconds.
example: 2
format: int64
type: integer
state:
description: The current state of the SLO (e.g., breached, warning, ok).
example: ok
type: string
required:
- sli
- error_budget_remaining
- raw_error_budget_remaining
- state
- span_precision
type: object
SloStatusResponse:
description: The SLO status response.
properties:
data:
$ref: '#/components/schemas/SloStatusData'
required:
- data
type: object
SloStatusType:
description: The type of the SLO status resource.
enum:
- slo_status
example: slo_status
type: string
x-enum-varnames:
- SLO_STATUS
SoftwareCatalogTriggerWrapper:
description: Schema for a Software Catalog-based trigger.
properties:
Expand Down Expand Up @@ -88060,6 +88175,63 @@ paths:
x-unstable: '**Note**: This feature is in private beta. To request access, use
the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export)
docs.'
/api/v2/slo/{slo_id}/status:
get:
description: 'Get the status of a Service Level Objective (SLO) for a given
time period.


This endpoint returns the current SLI value, error budget remaining, and other
status information for the specified SLO.'
operationId: GetSloStatus
parameters:
- $ref: '#/components/parameters/SloID'
- $ref: '#/components/parameters/FromTimestamp'
- $ref: '#/components/parameters/ToTimestamp'
- $ref: '#/components/parameters/DisableCorrections'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/SloStatusResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- slos_read
summary: Get SLO status
tags:
- Service Level Objectives
x-permission:
operator: OR
permissions:
- slos_read
x-unstable: '**Note**: This endpoint is in public beta and it''s subject to
change.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/spa/recommendations/{service}:
get:
description: This endpoint is currently experimental and restricted to Datadog
Expand Down
8 changes: 8 additions & 0 deletions examples/v2/service-level-objectives/GetSloStatus.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get SLO status returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_slo_status".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceLevelObjectivesAPI.new
p api_instance.get_slo_status("00000000-0000-0000-0000-000000000000", 1690901870, 1706803070)
6 changes: 6 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,12 @@
"v2.GetSLOReportJobStatus" => {
"report_id" => "String",
},
"v2.GetSloStatus" => {
"slo_id" => "String",
"from_ts" => "Integer",
"to_ts" => "Integer",
"disable_corrections" => "Boolean",
},
"v2.GetSPARecommendations" => {
"bypass_cache" => "String",
"service" => "String",
Expand Down
30 changes: 30 additions & 0 deletions features/v2/service_level_objectives.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,33 @@ Feature: Service Level Objectives
When the request is sent
Then the response status is 200 OK
And the response "data.type" is equal to "report_id"

@generated @skip @team:DataDog/slo-app
Scenario: Get SLO status returns "Bad Request" response
Given operation "GetSloStatus" enabled
And new "GetSloStatus" request
And request contains "slo_id" parameter from "REPLACE.ME"
And request contains "from_ts" parameter from "REPLACE.ME"
And request contains "to_ts" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/slo-app
Scenario: Get SLO status returns "Not Found" response
Given operation "GetSloStatus" enabled
And new "GetSloStatus" request
And request contains "slo_id" parameter from "REPLACE.ME"
And request contains "from_ts" parameter from "REPLACE.ME"
And request contains "to_ts" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/slo-app
Scenario: Get SLO status returns "OK" response
Given operation "GetSloStatus" enabled
And new "GetSloStatus" request
And request contains "slo_id" parameter from "REPLACE.ME"
And request contains "from_ts" parameter from "REPLACE.ME"
And request contains "to_ts" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4521,6 +4521,12 @@
"type": "safe"
}
},
"GetSloStatus": {
"tag": "Service Level Objectives",
"undo": {
"type": "safe"
}
},
"GetSPARecommendations": {
"tag": "Spa",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ def initialize
"v2.create_slo_report_job": false,
"v2.get_slo_report": false,
"v2.get_slo_report_job_status": false,
"v2.get_slo_status": false,
"v2.get_spa_recommendations": false,
"v2.get_spa_recommendations_with_shard": false,
"v2.create_sca_resolve_vulnerable_symbols": false,
Expand Down
5 changes: 5 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3633,6 +3633,7 @@ def overrides
"v2.query_users_request_data_attributes" => "QueryUsersRequestDataAttributes",
"v2.query_users_request_data_attributes_sort" => "QueryUsersRequestDataAttributesSort",
"v2.query_users_request_data_type" => "QueryUsersRequestDataType",
"v2.raw_error_budget_remaining" => "RawErrorBudgetRemaining",
"v2.readiness_gate" => "ReadinessGate",
"v2.readiness_gate_threshold_type" => "ReadinessGateThresholdType",
"v2.recommendation_attributes" => "RecommendationAttributes",
Expand Down Expand Up @@ -4331,6 +4332,10 @@ def overrides
"v2.slo_report_status_get_response" => "SLOReportStatusGetResponse",
"v2.slo_report_status_get_response_attributes" => "SLOReportStatusGetResponseAttributes",
"v2.slo_report_status_get_response_data" => "SLOReportStatusGetResponseData",
"v2.slo_status_data" => "SloStatusData",
"v2.slo_status_data_attributes" => "SloStatusDataAttributes",
"v2.slo_status_response" => "SloStatusResponse",
"v2.slo_status_type" => "SloStatusType",
"v2.software_catalog_trigger_wrapper" => "SoftwareCatalogTriggerWrapper",
"v2.sort_direction" => "SortDirection",
"v2.span" => "Span",
Expand Down
Loading
Loading