Skip to content

Commit 71c6304

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d7132162 of spec repo
1 parent c4a1f14 commit 71c6304

File tree

14 files changed

+659
-4
lines changed

14 files changed

+659
-4
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-09-18 14:45:11.842654",
8-
"spec_repo_commit": "bae57ce1"
7+
"regenerated": "2024-09-20 14:33:43.158860",
8+
"spec_repo_commit": "d7132162"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-09-18 14:45:11.862890",
13-
"spec_repo_commit": "bae57ce1"
12+
"regenerated": "2024-09-20 14:33:43.173525",
13+
"spec_repo_commit": "d7132162"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+143
Original file line numberDiff line numberDiff line change
@@ -15182,6 +15182,32 @@ components:
1518215182
- EDGE_LAPTOP_LARGE
1518315183
- EDGE_TABLET
1518415184
- EDGE_MOBILE_SMALL
15185+
SyntheticsFetchUptimesPayload:
15186+
description: Object containing IDs of Synthetic tests and a timeframe.
15187+
properties:
15188+
from_ts:
15189+
description: Timestamp in seconds (Unix epoch) for the start of uptime.
15190+
example: 0
15191+
format: int64
15192+
type: integer
15193+
public_ids:
15194+
description: An array of Synthetic test IDs you want to delete.
15195+
example: []
15196+
items:
15197+
description: A Synthetic test ID.
15198+
example: abc-def-123
15199+
type: string
15200+
type: array
15201+
to_ts:
15202+
description: Timestamp in seconds (Unix epoch) for the end of uptime.
15203+
example: 0
15204+
format: int64
15205+
type: integer
15206+
required:
15207+
- from_ts
15208+
- to_ts
15209+
- public_ids
15210+
type: object
1518515211
SyntheticsGetAPITestLatestResultsResponse:
1518615212
description: Object with the latest Synthetic API test run.
1518715213
properties:
@@ -16481,6 +16507,24 @@ components:
1648116507
description: String Port number to use when performing the test. Supports templated
1648216508
variables.
1648316509
type: string
16510+
SyntheticsTestUptime:
16511+
description: Object containing the uptime for a Synthetic test ID.
16512+
properties:
16513+
from_ts:
16514+
description: Timestamp in seconds for the start of uptime.
16515+
format: int64
16516+
type: integer
16517+
overall:
16518+
$ref: '#/components/schemas/SyntheticsUptime'
16519+
public_id:
16520+
description: A Synthetic test ID.
16521+
example: abc-def-123
16522+
type: string
16523+
to_ts:
16524+
description: Timestamp in seconds for the end of uptime.
16525+
format: int64
16526+
type: integer
16527+
type: object
1648416528
SyntheticsTiming:
1648516529
description: 'Object containing all metrics and their values collected for a
1648616530
Synthetic API test.
@@ -16604,6 +16648,62 @@ components:
1660416648
new_status:
1660516649
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
1660616650
type: object
16651+
SyntheticsUptime:
16652+
description: Object containing the uptime information.
16653+
properties:
16654+
errors:
16655+
description: An array of error objects returned while querying the history
16656+
data for the service level objective.
16657+
items:
16658+
$ref: '#/components/schemas/SLOHistoryResponseErrorWithType'
16659+
nullable: true
16660+
type: array
16661+
group:
16662+
description: The location name
16663+
example: name
16664+
type: string
16665+
history:
16666+
description: 'The state transition history for the monitor, represented
16667+
as an array of
16668+
16669+
pairs. Each pair is an array where the first element is the transition
16670+
timestamp
16671+
16672+
in Unix epoch format (integer) and the second element is the state (integer).
16673+
16674+
For the state, an integer value of `0` indicates uptime, `1` indicates
16675+
downtime,
16676+
16677+
and `2` indicates no data.'
16678+
example:
16679+
- - 1579212382
16680+
- 0
16681+
items:
16682+
description: An array of transitions
16683+
example:
16684+
- 1579212382
16685+
- 0
16686+
items:
16687+
description: A timeseries data point which is a tuple of (timestamp,
16688+
value).
16689+
format: double
16690+
type: number
16691+
maxItems: 2
16692+
minItems: 2
16693+
type: array
16694+
type: array
16695+
span_precision:
16696+
description: The number of decimal places to which the SLI value is accurate
16697+
for the given from-to timestamps.
16698+
example: 2.0
16699+
format: double
16700+
type: number
16701+
uptime:
16702+
description: The overall uptime.
16703+
example: 99.99
16704+
format: double
16705+
type: number
16706+
type: object
1660716707
SyntheticsVariableParser:
1660816708
description: Details of the parser to use for the global variable.
1660916709
example:
@@ -31307,6 +31407,49 @@ paths:
3130731407
tags:
3130831408
- Synthetics
3130931409
x-codegen-request-body-name: body
31410+
/api/v1/synthetics/tests/uptimes:
31411+
post:
31412+
description: Fetch uptime for multiple Synthetic tests by ID.
31413+
operationId: FetchUptimes
31414+
requestBody:
31415+
content:
31416+
application/json:
31417+
schema:
31418+
$ref: '#/components/schemas/SyntheticsFetchUptimesPayload'
31419+
description: Public ID list of the Synthetic tests and timeframe.
31420+
required: true
31421+
responses:
31422+
'200':
31423+
content:
31424+
application/json:
31425+
schema:
31426+
items:
31427+
$ref: '#/components/schemas/SyntheticsTestUptime'
31428+
type: array
31429+
description: OK.
31430+
'400':
31431+
content:
31432+
application/json:
31433+
schema:
31434+
$ref: '#/components/schemas/APIErrorResponse'
31435+
description: '- JSON format is wrong'
31436+
'403':
31437+
content:
31438+
application/json:
31439+
schema:
31440+
$ref: '#/components/schemas/APIErrorResponse'
31441+
description: Forbidden
31442+
'429':
31443+
$ref: '#/components/responses/TooManyRequestsResponse'
31444+
security:
31445+
- apiKeyAuth: []
31446+
appKeyAuth: []
31447+
- AuthZ:
31448+
- synthetics_read
31449+
summary: Fetch uptime for multiple tests
31450+
tags:
31451+
- Synthetics
31452+
x-codegen-request-body-name: body
3131031453
/api/v1/synthetics/tests/{public_id}:
3131131454
get:
3131231455
description: Get the detailed configuration associated with a Synthetic test.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-09-11T13:09:28.349Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"log": {
3+
"_recordingName": "Synthetics/Fetch uptime for multiple tests returns \"OK.\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "5bb349ef4e2317c9387395651078521d",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 70,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 570,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"from_ts\":1726041488,\"public_ids\":[\"p8m-9gw-nte\"],\"to_ts\":1726055954}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/uptimes"
39+
},
40+
"response": {
41+
"bodySize": 314,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 314,
45+
"text": "[{\"from_ts\":1726041488,\"to_ts\":1726055954,\"overall\":{\"name\":\"[Synthetics] Synthetics test\",\"preview\":false,\"monitor_type\":\"synthetics alert\",\"monitor_modified\":1726060063,\"errors\":null,\"span_precision\":0,\"history\":[[1726004543,0],[1726053503,1]],\"uptime\":83.05682373046875},\"public_id\":\"p8m-9gw-nte\",\"groups\":[]}]\n"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 665,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2024-09-11T13:09:28.358Z",
61+
"time": 508
62+
}
63+
],
64+
"pages": [],
65+
"version": "1.2"
66+
}
67+
}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Fetch uptime for multiple tests returns "OK." response
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.SyntheticsApi(configuration);
9+
10+
const params: v1.SyntheticsApiFetchUptimesRequest = {
11+
body: {
12+
fromTs: 1726041488,
13+
publicIds: ["p8m-9gw-nte"],
14+
toTs: 1726055954,
15+
},
16+
};
17+
18+
apiInstance
19+
.fetchUptimes(params)
20+
.then((data: v1.SyntheticsTestUptime[]) => {
21+
console.log(
22+
"API called successfully. Returned data: " + JSON.stringify(data)
23+
);
24+
})
25+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

+7
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
20832083
},
20842084
"operationResponseType": "SyntheticsTriggerCITestsResponse",
20852085
},
2086+
"v1.FetchUptimes": {
2087+
"body": {
2088+
"type": "SyntheticsFetchUptimesPayload",
2089+
"format": "",
2090+
},
2091+
"operationResponseType": "Array<SyntheticsTestUptime>",
2092+
},
20862093
"v1.GetTest": {
20872094
"publicId": {
20882095
"type": "string",

features/v1/synthetics.feature

+17
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,23 @@ Feature: Synthetics
413413
Then the response status is 200 OK
414414
And the response "name" is equal to "{{ synthetics_api_test.name }}-updated"
415415

416+
@generated @skip @team:DataDog/synthetics-ct
417+
Scenario: Fetch uptime for multiple tests returns "- JSON format is wrong" response
418+
Given new "FetchUptimes" request
419+
And body with value {"from_ts": 0, "public_ids": [], "to_ts": 0}
420+
When the request is sent
421+
Then the response status is 400 - JSON format is wrong
422+
423+
@replay-only @team:DataDog/synthetics-ct
424+
Scenario: Fetch uptime for multiple tests returns "OK." response
425+
Given new "FetchUptimes" request
426+
And body with value {"from_ts": 1726041488, "public_ids": ["p8m-9gw-nte"], "to_ts": 1726055954}
427+
When the request is sent
428+
Then the response status is 200 OK
429+
And the response "[0].public_id" is equal to "p8m-9gw-nte"
430+
And the response "[0].overall.uptime" is equal to 83.05682373046875
431+
And the response "[0].overall.history" has length 2
432+
416433
@generated @skip @team:DataDog/synthetics-ct
417434
Scenario: Get a browser test result returns "- Synthetic Monitoring is not activated for the user" response
418435
Given new "GetBrowserTestResult" request

features/v1/undo.json

+6
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,12 @@
12081208
"type": "idempotent"
12091209
}
12101210
},
1211+
"FetchUptimes": {
1212+
"tag": "Synthetics",
1213+
"undo": {
1214+
"type": "idempotent"
1215+
}
1216+
},
12111217
"GetTest": {
12121218
"tag": "Synthetics",
12131219
"undo": {

0 commit comments

Comments
 (0)