Skip to content

Commit

Permalink
Regenerate client from commit 0cf3784b of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Sep 12, 2024
1 parent 6207114 commit a06d3b0
Show file tree
Hide file tree
Showing 14 changed files with 658 additions and 4 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-09-12 09:36:33.417256",
"spec_repo_commit": "7c86a87a"
"regenerated": "2024-09-12 15:58:59.820534",
"spec_repo_commit": "0cf3784b"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-12 09:36:33.436408",
"spec_repo_commit": "7c86a87a"
"regenerated": "2024-09-12 15:58:59.839363",
"spec_repo_commit": "0cf3784b"
}
}
}
143 changes: 143 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15182,6 +15182,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 @@ -16481,6 +16507,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 @@ -16604,6 +16648,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 @@ -31132,6 +31232,49 @@ paths:
tags:
- Synthetics
x-codegen-request-body-name: body
/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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-09-11T13:09:28.349Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"log": {
"_recordingName": "Synthetics/Fetch uptime for multiple tests returns \"OK.\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "5bb349ef4e2317c9387395651078521d",
"_order": 0,
"cache": {},
"request": {
"bodySize": 70,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 570,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"from_ts\":1726041488,\"public_ids\":[\"p8m-9gw-nte\"],\"to_ts\":1726055954}"
},
"queryString": [],
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/uptimes"
},
"response": {
"bodySize": 314,
"content": {
"mimeType": "application/json",
"size": 314,
"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"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 665,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-09-11T13:09:28.358Z",
"time": 508
}
],
"pages": [],
"version": "1.2"
}
}
25 changes: 25 additions & 0 deletions examples/v1/synthetics/FetchUptimes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Fetch uptime for multiple tests returns "OK." response
*/

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.SyntheticsApi(configuration);

const params: v1.SyntheticsApiFetchUptimesRequest = {
body: {
fromTs: 1726041488,
publicIds: ["p8m-9gw-nte"],
toTs: 1726055954,
},
};

apiInstance
.fetchUptimes(params)
.then((data: v1.SyntheticsTestUptime[]) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
7 changes: 7 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "SyntheticsTriggerCITestsResponse",
},
"v1.FetchUptimes": {
"body": {
"type": "SyntheticsFetchUptimesPayload",
"format": "",
},
"operationResponseType": "Array<SyntheticsTestUptime>",
},
"v1.GetTest": {
"publicId": {
"type": "string",
Expand Down
16 changes: 16 additions & 0 deletions features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,22 @@ Feature: Synthetics
Then the response status is 200 OK
And the response "name" is equal to "{{ synthetics_api_test.name }}-updated"

@generated @skip @team:DataDog/synthetics-ct
Scenario: Fetch uptime for multiple tests returns "- JSON format is wrong" response
Given new "FetchUptimes" request
And body with value {"from_ts": 0, "public_ids": [], "to_ts": 0}
When the request is sent
Then the response status is 400 - JSON format is wrong

@replay-only @team:DataDog/synthetics-ct
Scenario: Fetch uptime for multiple tests returns "OK." response
Given new "FetchUptimes" request
And body with value {"from_ts": 1726041488, "public_ids": ["p8m-9gw-nte"], "to_ts": 1726055954}
When the request is sent
Then the response status is 200 OK
And the response "[0].public_id" is equal to "p8m-9gw-nte"
And the response "[0].overall.uptime" is equal to 83.05682373046875

@generated @skip @team:DataDog/synthetics-ct
Scenario: Get a browser test result returns "- Synthetic Monitoring is not activated for the user" response
Given new "GetBrowserTestResult" request
Expand Down
6 changes: 6 additions & 0 deletions features/v1/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,12 @@
"type": "idempotent"
}
},
"FetchUptimes": {
"tag": "Synthetics",
"undo": {
"type": "idempotent"
}
},
"GetTest": {
"tag": "Synthetics",
"undo": {
Expand Down
Loading

0 comments on commit a06d3b0

Please sign in to comment.