Skip to content

Commit

Permalink
Regenerate client from commit 3b4747f4 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 2, 2024
1 parent a3039dc commit 07e1ec6
Show file tree
Hide file tree
Showing 16 changed files with 504 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-02 13:39:19.776742",
"spec_repo_commit": "e02e4f4c"
"regenerated": "2024-10-02 14:33:47.623313",
"spec_repo_commit": "3b4747f4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-02 13:39:19.791012",
"spec_repo_commit": "e02e4f4c"
"regenerated": "2024-10-02 14:33:47.636722",
"spec_repo_commit": "3b4747f4"
}
}
}
143 changes: 143 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15194,6 +15194,32 @@ components:
- EDGE_LAPTOP_LARGE
- EDGE_TABLET
- EDGE_MOBILE_SMALL
SyntheticsFetchUptimesPayload:
description: Object containing IDs of Synthetic tests and a timeframe.
properties:
from_ts:
description: Timestamp in seconds (Unix epoch) for the start of uptime.
example: 0
format: int64
type: integer
public_ids:
description: An array of Synthetic test IDs you want to delete.
example: []
items:
description: A Synthetic test ID.
example: abc-def-123
type: string
type: array
to_ts:
description: Timestamp in seconds (Unix epoch) for the end of uptime.
example: 0
format: int64
type: integer
required:
- from_ts
- to_ts
- public_ids
type: object
SyntheticsGetAPITestLatestResultsResponse:
description: Object with the latest Synthetic API test run.
properties:
Expand Down Expand Up @@ -17283,6 +17309,24 @@ components:
description: String Port number to use when performing the test. Supports templated
variables.
type: string
SyntheticsTestUptime:
description: Object containing the uptime for a Synthetic test ID.
properties:
from_ts:
description: Timestamp in seconds for the start of uptime.
format: int64
type: integer
overall:
$ref: '#/components/schemas/SyntheticsUptime'
public_id:
description: A Synthetic test ID.
example: abc-def-123
type: string
to_ts:
description: Timestamp in seconds for the end of uptime.
format: int64
type: integer
type: object
SyntheticsTiming:
description: 'Object containing all metrics and their values collected for a
Synthetic API test.
Expand Down Expand Up @@ -17406,6 +17450,62 @@ components:
new_status:
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
type: object
SyntheticsUptime:
description: Object containing the uptime information.
properties:
errors:
description: An array of error objects returned while querying the history
data for the service level objective.
items:
$ref: '#/components/schemas/SLOHistoryResponseErrorWithType'
nullable: true
type: array
group:
description: The location name
example: name
type: string
history:
description: 'The state transition history for the monitor, represented
as an array of

pairs. Each pair is an array where the first element is the transition
timestamp

in Unix epoch format (integer) and the second element is the state (integer).

For the state, an integer value of `0` indicates uptime, `1` indicates
downtime,

and `2` indicates no data.'
example:
- - 1579212382
- 0
items:
description: An array of transitions
example:
- 1579212382
- 0
items:
description: A timeseries data point which is a tuple of (timestamp,
value).
format: double
type: number
maxItems: 2
minItems: 2
type: array
type: array
span_precision:
description: The number of decimal places to which the SLI value is accurate
for the given from-to timestamps.
example: 2.0
format: double
type: number
uptime:
description: The overall uptime.
example: 99.99
format: double
type: number
type: object
SyntheticsVariableParser:
description: Details of the parser to use for the global variable.
example:
Expand Down Expand Up @@ -32934,6 +33034,49 @@ paths:
operator: OR
permissions:
- synthetics_write
/api/v1/synthetics/tests/uptimes:
post:
description: Fetch uptime for multiple Synthetic tests by ID.
operationId: FetchUptimes
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsFetchUptimesPayload'
description: Public ID list of the Synthetic tests and timeframe.
required: true
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/SyntheticsTestUptime'
type: array
description: OK.
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: '- JSON format is wrong'
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- synthetics_read
summary: Fetch uptime for multiple tests
tags:
- Synthetics
x-codegen-request-body-name: body
/api/v1/synthetics/tests/{public_id}:
get:
description: Get the detailed configuration associated with a Synthetic test.
Expand Down
21 changes: 21 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4358,6 +4358,13 @@ datadog\_api\_client.v1.model.synthetics\_device\_id module
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_fetch\_uptimes\_payload module
------------------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.synthetics_fetch_uptimes_payload
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_get\_api\_test\_latest\_results\_response module
------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -4904,6 +4911,13 @@ datadog\_api\_client.v1.model.synthetics\_test\_request\_proxy module
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_test\_uptime module
-------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.synthetics_test_uptime
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_timing module
-------------------------------------------------------

Expand Down Expand Up @@ -4953,6 +4967,13 @@ datadog\_api\_client.v1.model.synthetics\_update\_test\_pause\_status\_payload m
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_uptime module
-------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.synthetics_uptime
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_variable\_parser module
-----------------------------------------------------------------

Expand Down
22 changes: 22 additions & 0 deletions examples/v1/synthetics/FetchUptimes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
Fetch uptime for multiple tests returns "OK." response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_fetch_uptimes_payload import SyntheticsFetchUptimesPayload

body = SyntheticsFetchUptimesPayload(
from_ts=1726041488,
public_ids=[
"p8m-9gw-nte",
],
to_ts=1726055954,
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.fetch_uptimes(body=body)

print(response)
39 changes: 39 additions & 0 deletions src/datadog_api_client/v1/api/synthetics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
from datadog_api_client.v1.model.synthetics_trigger_ci_tests_response import SyntheticsTriggerCITestsResponse
from datadog_api_client.v1.model.synthetics_trigger_body import SyntheticsTriggerBody
from datadog_api_client.v1.model.synthetics_ci_test_body import SyntheticsCITestBody
from datadog_api_client.v1.model.synthetics_test_uptime import SyntheticsTestUptime
from datadog_api_client.v1.model.synthetics_fetch_uptimes_payload import SyntheticsFetchUptimesPayload
from datadog_api_client.v1.model.synthetics_patch_test_body import SyntheticsPatchTestBody
from datadog_api_client.v1.model.synthetics_get_api_test_latest_results_response import (
SyntheticsGetAPITestLatestResultsResponse,
Expand Down Expand Up @@ -255,6 +257,26 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._fetch_uptimes_endpoint = _Endpoint(
settings={
"response_type": ([SyntheticsTestUptime],),
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v1/synthetics/tests/uptimes",
"operation_id": "fetch_uptimes",
"http_method": "POST",
"version": "v1",
},
params_map={
"body": {
"required": True,
"openapi_types": (SyntheticsFetchUptimesPayload,),
"location": "body",
},
},
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
api_client=api_client,
)

self._get_api_test_endpoint = _Endpoint(
settings={
"response_type": (SyntheticsAPITest,),
Expand Down Expand Up @@ -981,6 +1003,23 @@ def edit_global_variable(

return self._edit_global_variable_endpoint.call_with_http_info(**kwargs)

def fetch_uptimes(
self,
body: SyntheticsFetchUptimesPayload,
) -> List[SyntheticsTestUptime]:
"""Fetch uptime for multiple tests.
Fetch uptime for multiple Synthetic tests by ID.
:param body: Public ID list of the Synthetic tests and timeframe.
:type body: SyntheticsFetchUptimesPayload
:rtype: [SyntheticsTestUptime]
"""
kwargs: Dict[str, Any] = {}
kwargs["body"] = body

return self._fetch_uptimes_endpoint.call_with_http_info(**kwargs)

def get_api_test(
self,
public_id: str,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


class SyntheticsFetchUptimesPayload(ModelNormal):
@cached_property
def openapi_types(_):
return {
"from_ts": (int,),
"public_ids": ([str],),
"to_ts": (int,),
}

attribute_map = {
"from_ts": "from_ts",
"public_ids": "public_ids",
"to_ts": "to_ts",
}

def __init__(self_, from_ts: int, public_ids: List[str], to_ts: int, **kwargs):
"""
Object containing IDs of Synthetic tests and a timeframe.
:param from_ts: Timestamp in seconds (Unix epoch) for the start of uptime.
:type from_ts: int
:param public_ids: An array of Synthetic test IDs you want to delete.
:type public_ids: [str]
:param to_ts: Timestamp in seconds (Unix epoch) for the end of uptime.
:type to_ts: int
"""
super().__init__(kwargs)

self_.from_ts = from_ts
self_.public_ids = public_ids
self_.to_ts = to_ts
Loading

0 comments on commit 07e1ec6

Please sign in to comment.