Skip to content

Commit d375a03

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d1403f5 of spec repo
1 parent d70f765 commit d375a03

File tree

13 files changed

+595
-1
lines changed

13 files changed

+595
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,16 @@ components:
346346
required: true
347347
schema:
348348
type: string
349+
DisableCorrections:
350+
description: Whether to exclude correction windows from the SLO status calculation.
351+
Defaults to false.
352+
in: query
353+
name: disable_corrections
354+
required: false
355+
schema:
356+
default: false
357+
example: false
358+
type: boolean
349359
EntityID:
350360
description: UUID or Entity Ref.
351361
in: path
@@ -457,6 +467,15 @@ components:
457467
required: false
458468
schema:
459469
$ref: '#/components/schemas/RelationType'
470+
FromTimestamp:
471+
description: The starting timestamp for the SLO status query in epoch seconds.
472+
in: query
473+
name: from_ts
474+
required: true
475+
schema:
476+
example: 1690901870
477+
format: int64
478+
type: integer
460479
GCPSTSServiceAccountID:
461480
description: Your GCP STS enabled service account's unique ID.
462481
in: path
@@ -1096,6 +1115,14 @@ components:
10961115
required: false
10971116
schema:
10981117
type: boolean
1118+
SloID:
1119+
description: The ID of the SLO.
1120+
in: path
1121+
name: slo_id
1122+
required: true
1123+
schema:
1124+
example: 00000000-0000-0000-0000-000000000000
1125+
type: string
10991126
SpansMetricIDParameter:
11001127
description: The name of the span-based metric.
11011128
in: path
@@ -1117,6 +1144,15 @@ components:
11171144
required: true
11181145
schema:
11191146
type: string
1147+
ToTimestamp:
1148+
description: The ending timestamp for the SLO status query in epoch seconds.
1149+
in: query
1150+
name: to_ts
1151+
required: true
1152+
schema:
1153+
example: 1706803070
1154+
format: int64
1155+
type: integer
11201156
UserID:
11211157
description: The ID of the user.
11221158
in: path
@@ -45865,6 +45901,22 @@ components:
4586545901
from the other indexes
4586645902
type: string
4586745903
type: object
45904+
RawErrorBudgetRemaining:
45905+
description: The raw error budget remaining for the SLO.
45906+
properties:
45907+
unit:
45908+
description: The unit of the error budget (for example, `seconds`, `requests`).
45909+
example: seconds
45910+
type: string
45911+
value:
45912+
description: The numeric value of the remaining error budget.
45913+
example: 86400.5
45914+
format: double
45915+
type: number
45916+
required:
45917+
- value
45918+
- unit
45919+
type: object
4586845920
ReadinessGate:
4586945921
description: Used to merge multiple branches into a single branch.
4587045922
properties:
@@ -56388,6 +56440,70 @@ components:
5638856440
required:
5638956441
- attributes
5639056442
type: object
56443+
SloStatusData:
56444+
description: The data portion of the SLO status response.
56445+
properties:
56446+
attributes:
56447+
$ref: '#/components/schemas/SloStatusDataAttributes'
56448+
id:
56449+
description: The ID of the SLO.
56450+
example: 00000000-0000-0000-0000-000000000000
56451+
type: string
56452+
type:
56453+
$ref: '#/components/schemas/SloStatusType'
56454+
required:
56455+
- id
56456+
- type
56457+
- attributes
56458+
type: object
56459+
SloStatusDataAttributes:
56460+
description: The attributes of the SLO status.
56461+
properties:
56462+
error_budget_remaining:
56463+
description: The percentage of error budget remaining.
56464+
example: 99.5
56465+
format: double
56466+
type: number
56467+
raw_error_budget_remaining:
56468+
$ref: '#/components/schemas/RawErrorBudgetRemaining'
56469+
sli:
56470+
description: The current Service Level Indicator (SLI) value as a percentage.
56471+
example: 99.95
56472+
format: double
56473+
type: number
56474+
span_precision:
56475+
description: The precision of the time span in seconds.
56476+
example: 2
56477+
format: int64
56478+
type: integer
56479+
state:
56480+
description: The current state of the SLO (for example, `breached`, `warning`,
56481+
`ok`).
56482+
example: ok
56483+
type: string
56484+
required:
56485+
- sli
56486+
- error_budget_remaining
56487+
- raw_error_budget_remaining
56488+
- state
56489+
- span_precision
56490+
type: object
56491+
SloStatusResponse:
56492+
description: The SLO status response.
56493+
properties:
56494+
data:
56495+
$ref: '#/components/schemas/SloStatusData'
56496+
required:
56497+
- data
56498+
type: object
56499+
SloStatusType:
56500+
description: The type of the SLO status resource.
56501+
enum:
56502+
- slo_status
56503+
example: slo_status
56504+
type: string
56505+
x-enum-varnames:
56506+
- SLO_STATUS
5639156507
SoftwareCatalogTriggerWrapper:
5639256508
description: Schema for a Software Catalog-based trigger.
5639356509
properties:
@@ -92268,6 +92384,63 @@ paths:
9226892384
x-unstable: '**Note**: This feature is in private beta. To request access, use
9226992385
the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export)
9227092386
docs.'
92387+
/api/v2/slo/{slo_id}/status:
92388+
get:
92389+
description: 'Get the status of a Service Level Objective (SLO) for a given
92390+
time period.
92391+
92392+
92393+
This endpoint returns the current SLI value, error budget remaining, and other
92394+
status information for the specified SLO.'
92395+
operationId: GetSloStatus
92396+
parameters:
92397+
- $ref: '#/components/parameters/SloID'
92398+
- $ref: '#/components/parameters/FromTimestamp'
92399+
- $ref: '#/components/parameters/ToTimestamp'
92400+
- $ref: '#/components/parameters/DisableCorrections'
92401+
responses:
92402+
'200':
92403+
content:
92404+
application/json:
92405+
schema:
92406+
$ref: '#/components/schemas/SloStatusResponse'
92407+
description: OK
92408+
'400':
92409+
content:
92410+
application/json:
92411+
schema:
92412+
$ref: '#/components/schemas/JSONAPIErrorResponse'
92413+
description: Bad Request
92414+
'403':
92415+
content:
92416+
application/json:
92417+
schema:
92418+
$ref: '#/components/schemas/JSONAPIErrorResponse'
92419+
description: Forbidden
92420+
'404':
92421+
content:
92422+
application/json:
92423+
schema:
92424+
$ref: '#/components/schemas/JSONAPIErrorResponse'
92425+
description: Not Found
92426+
'429':
92427+
$ref: '#/components/responses/TooManyRequestsResponse'
92428+
security:
92429+
- apiKeyAuth: []
92430+
appKeyAuth: []
92431+
- AuthZ:
92432+
- slos_read
92433+
summary: Get SLO status
92434+
tags:
92435+
- Service Level Objectives
92436+
x-permission:
92437+
operator: OR
92438+
permissions:
92439+
- slos_read
92440+
x-unstable: '**Note**: This endpoint is in public beta and it''s subject to
92441+
change.
92442+
92443+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
9227192444
/api/v2/spa/recommendations/{service}:
9227292445
get:
9227392446
description: This endpoint is currently experimental and restricted to Datadog

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19562,6 +19562,13 @@ datadog\_api\_client.v2.model.query\_users\_request\_data\_type module
1956219562
:members:
1956319563
:show-inheritance:
1956419564

19565+
datadog\_api\_client.v2.model.raw\_error\_budget\_remaining module
19566+
------------------------------------------------------------------
19567+
19568+
.. automodule:: datadog_api_client.v2.model.raw_error_budget_remaining
19569+
:members:
19570+
:show-inheritance:
19571+
1956519572
datadog\_api\_client.v2.model.readiness\_gate module
1956619573
----------------------------------------------------
1956719574

@@ -24602,6 +24609,34 @@ datadog\_api\_client.v2.model.slo\_report\_status\_get\_response\_data module
2460224609
:members:
2460324610
:show-inheritance:
2460424611

24612+
datadog\_api\_client.v2.model.slo\_status\_data module
24613+
------------------------------------------------------
24614+
24615+
.. automodule:: datadog_api_client.v2.model.slo_status_data
24616+
:members:
24617+
:show-inheritance:
24618+
24619+
datadog\_api\_client.v2.model.slo\_status\_data\_attributes module
24620+
------------------------------------------------------------------
24621+
24622+
.. automodule:: datadog_api_client.v2.model.slo_status_data_attributes
24623+
:members:
24624+
:show-inheritance:
24625+
24626+
datadog\_api\_client.v2.model.slo\_status\_response module
24627+
----------------------------------------------------------
24628+
24629+
.. automodule:: datadog_api_client.v2.model.slo_status_response
24630+
:members:
24631+
:show-inheritance:
24632+
24633+
datadog\_api\_client.v2.model.slo\_status\_type module
24634+
------------------------------------------------------
24635+
24636+
.. automodule:: datadog_api_client.v2.model.slo_status_type
24637+
:members:
24638+
:show-inheritance:
24639+
2460524640
datadog\_api\_client.v2.model.software\_catalog\_trigger\_wrapper module
2460624641
------------------------------------------------------------------------
2460724642

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Get SLO status returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.service_level_objectives_api import ServiceLevelObjectivesApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_slo_status"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = ServiceLevelObjectivesApi(api_client)
12+
response = api_instance.get_slo_status(
13+
slo_id="00000000-0000-0000-0000-000000000000",
14+
from_ts=1690901870,
15+
to_ts=1706803070,
16+
)
17+
18+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ def __init__(
398398
"v2.create_slo_report_job": False,
399399
"v2.get_slo_report": False,
400400
"v2.get_slo_report_job_status": False,
401+
"v2.get_slo_status": False,
401402
"v2.get_spa_recommendations": False,
402403
"v2.get_spa_recommendations_with_shard": False,
403404
"v2.create_custom_rule": False,

0 commit comments

Comments
 (0)