Skip to content

Commit bc5349c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bb06f841 of spec repo
1 parent 9581251 commit bc5349c

13 files changed

Lines changed: 748 additions & 5 deletions

.apigentools-info

Lines changed: 4 additions & 4 deletions
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-10-02 11:36:05.178125",
8-
"spec_repo_commit": "c09e55c6"
7+
"regenerated": "2024-10-02 14:17:23.506595",
8+
"spec_repo_commit": "bb06f841"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-02 11:36:05.192230",
13-
"spec_repo_commit": "c09e55c6"
12+
"regenerated": "2024-10-02 14:17:23.521057",
13+
"spec_repo_commit": "bb06f841"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15194,6 +15194,32 @@ components:
1519415194
- EDGE_LAPTOP_LARGE
1519515195
- EDGE_TABLET
1519615196
- EDGE_MOBILE_SMALL
15197+
SyntheticsFetchUptimesPayload:
15198+
description: Object containing IDs of Synthetic tests and a timeframe.
15199+
properties:
15200+
from_ts:
15201+
description: Timestamp in seconds (Unix epoch) for the start of uptime.
15202+
example: 0
15203+
format: int64
15204+
type: integer
15205+
public_ids:
15206+
description: An array of Synthetic test IDs you want to delete.
15207+
example: []
15208+
items:
15209+
description: A Synthetic test ID.
15210+
example: abc-def-123
15211+
type: string
15212+
type: array
15213+
to_ts:
15214+
description: Timestamp in seconds (Unix epoch) for the end of uptime.
15215+
example: 0
15216+
format: int64
15217+
type: integer
15218+
required:
15219+
- from_ts
15220+
- to_ts
15221+
- public_ids
15222+
type: object
1519715223
SyntheticsGetAPITestLatestResultsResponse:
1519815224
description: Object with the latest Synthetic API test run.
1519915225
properties:
@@ -17283,6 +17309,24 @@ components:
1728317309
description: String Port number to use when performing the test. Supports templated
1728417310
variables.
1728517311
type: string
17312+
SyntheticsTestUptime:
17313+
description: Object containing the uptime for a Synthetic test ID.
17314+
properties:
17315+
from_ts:
17316+
description: Timestamp in seconds for the start of uptime.
17317+
format: int64
17318+
type: integer
17319+
overall:
17320+
$ref: '#/components/schemas/SyntheticsUptime'
17321+
public_id:
17322+
description: A Synthetic test ID.
17323+
example: abc-def-123
17324+
type: string
17325+
to_ts:
17326+
description: Timestamp in seconds for the end of uptime.
17327+
format: int64
17328+
type: integer
17329+
type: object
1728617330
SyntheticsTiming:
1728717331
description: 'Object containing all metrics and their values collected for a
1728817332
Synthetic API test.
@@ -17406,6 +17450,62 @@ components:
1740617450
new_status:
1740717451
$ref: '#/components/schemas/SyntheticsTestPauseStatus'
1740817452
type: object
17453+
SyntheticsUptime:
17454+
description: Object containing the uptime information.
17455+
properties:
17456+
errors:
17457+
description: An array of error objects returned while querying the history
17458+
data for the service level objective.
17459+
items:
17460+
$ref: '#/components/schemas/SLOHistoryResponseErrorWithType'
17461+
nullable: true
17462+
type: array
17463+
group:
17464+
description: The location name
17465+
example: name
17466+
type: string
17467+
history:
17468+
description: 'The state transition history for the monitor, represented
17469+
as an array of
17470+
17471+
pairs. Each pair is an array where the first element is the transition
17472+
timestamp
17473+
17474+
in Unix epoch format (integer) and the second element is the state (integer).
17475+
17476+
For the state, an integer value of `0` indicates uptime, `1` indicates
17477+
downtime,
17478+
17479+
and `2` indicates no data.'
17480+
example:
17481+
- - 1579212382
17482+
- 0
17483+
items:
17484+
description: An array of transitions
17485+
example:
17486+
- 1579212382
17487+
- 0
17488+
items:
17489+
description: A timeseries data point which is a tuple of (timestamp,
17490+
value).
17491+
format: double
17492+
type: number
17493+
maxItems: 2
17494+
minItems: 2
17495+
type: array
17496+
type: array
17497+
span_precision:
17498+
description: The number of decimal places to which the SLI value is accurate
17499+
for the given from-to timestamps.
17500+
example: 2.0
17501+
format: double
17502+
type: number
17503+
uptime:
17504+
description: The overall uptime.
17505+
example: 99.99
17506+
format: double
17507+
type: number
17508+
type: object
1740917509
SyntheticsVariableParser:
1741017510
description: Details of the parser to use for the global variable.
1741117511
example:
@@ -32934,6 +33034,49 @@ paths:
3293433034
operator: OR
3293533035
permissions:
3293633036
- synthetics_write
33037+
/api/v1/synthetics/tests/uptimes:
33038+
post:
33039+
description: Fetch uptime for multiple Synthetic tests by ID.
33040+
operationId: FetchUptimes
33041+
requestBody:
33042+
content:
33043+
application/json:
33044+
schema:
33045+
$ref: '#/components/schemas/SyntheticsFetchUptimesPayload'
33046+
description: Public ID list of the Synthetic tests and timeframe.
33047+
required: true
33048+
responses:
33049+
'200':
33050+
content:
33051+
application/json:
33052+
schema:
33053+
items:
33054+
$ref: '#/components/schemas/SyntheticsTestUptime'
33055+
type: array
33056+
description: OK.
33057+
'400':
33058+
content:
33059+
application/json:
33060+
schema:
33061+
$ref: '#/components/schemas/APIErrorResponse'
33062+
description: '- JSON format is wrong'
33063+
'403':
33064+
content:
33065+
application/json:
33066+
schema:
33067+
$ref: '#/components/schemas/APIErrorResponse'
33068+
description: Forbidden
33069+
'429':
33070+
$ref: '#/components/responses/TooManyRequestsResponse'
33071+
security:
33072+
- apiKeyAuth: []
33073+
appKeyAuth: []
33074+
- AuthZ:
33075+
- synthetics_read
33076+
summary: Fetch uptime for multiple tests
33077+
tags:
33078+
- Synthetics
33079+
x-codegen-request-body-name: body
3293733080
/api/v1/synthetics/tests/{public_id}:
3293833081
get:
3293933082
description: Get the detailed configuration associated with a Synthetic test.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2024-09-11T13:09:28.349Z

cassettes/features/v1/synthetics/Fetch-uptime-for-multiple-tests-returns-OK-response.yml

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Fetch uptime for multiple tests returns "OK." response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new
5+
6+
body = DatadogAPIClient::V1::SyntheticsFetchUptimesPayload.new({
7+
from_ts: 1726041488,
8+
public_ids: [
9+
"p8m-9gw-nte",
10+
],
11+
to_ts: 1726055954,
12+
})
13+
p api_instance.fetch_uptimes(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,9 @@
756756
"v1.TriggerCITests" => {
757757
"body" => "SyntheticsCITestBody",
758758
},
759+
"v1.FetchUptimes" => {
760+
"body" => "SyntheticsFetchUptimesPayload",
761+
},
759762
"v1.GetTest" => {
760763
"public_id" => "String",
761764
},

features/v1/synthetics.feature

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,24 @@ Feature: Synthetics
469469
Then the response status is 200 OK
470470
And the response "name" is equal to "{{ synthetics_api_test.name }}-updated"
471471

472-
@generated @skip @team:DataDog/synthetics-ct
472+
@team:DataDog/synthetics-ct
473+
Scenario: Fetch uptime for multiple tests returns "- JSON format is wrong" response
474+
Given new "FetchUptimes" request
475+
And body with value {"from_ts": 0, "public_ids": [], "to_ts": 0}
476+
When the request is sent
477+
Then the response status is 400 - JSON format is wrong
478+
479+
@replay-only @team:DataDog/synthetics-ct
480+
Scenario: Fetch uptime for multiple tests returns "OK." response
481+
Given new "FetchUptimes" request
482+
And body with value {"from_ts": 1726041488, "public_ids": ["p8m-9gw-nte"], "to_ts": 1726055954}
483+
When the request is sent
484+
Then the response status is 200 OK
485+
And the response "[0].public_id" is equal to "p8m-9gw-nte"
486+
And the response "[0].overall.uptime" is equal to 83.05682373046875
487+
And the response "[0].overall.history" has length 2
488+
489+
@team:DataDog/synthetics-ct
473490
Scenario: Get a Mobile test returns "- Synthetic Monitoring is not activated for the user" response
474491
Given new "GetMobileTest" request
475492
And request contains "public_id" parameter from "REPLACE.ME"

features/v1/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,12 @@
12331233
"type": "idempotent"
12341234
}
12351235
},
1236+
"FetchUptimes": {
1237+
"tag": "Synthetics",
1238+
"undo": {
1239+
"type": "idempotent"
1240+
}
1241+
},
12361242
"GetTest": {
12371243
"tag": "Synthetics",
12381244
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ def overrides
619619
"v1.synthetics_delete_tests_response" => "SyntheticsDeleteTestsResponse",
620620
"v1.synthetics_device" => "SyntheticsDevice",
621621
"v1.synthetics_device_id" => "SyntheticsDeviceID",
622+
"v1.synthetics_fetch_uptimes_payload" => "SyntheticsFetchUptimesPayload",
622623
"v1.synthetics_get_api_test_latest_results_response" => "SyntheticsGetAPITestLatestResultsResponse",
623624
"v1.synthetics_get_browser_test_latest_results_response" => "SyntheticsGetBrowserTestLatestResultsResponse",
624625
"v1.synthetics_global_variable" => "SyntheticsGlobalVariable",
@@ -695,13 +696,15 @@ def overrides
695696
"v1.synthetics_test_request_certificate_item" => "SyntheticsTestRequestCertificateItem",
696697
"v1.synthetics_test_request_port" => "SyntheticsTestRequestPort",
697698
"v1.synthetics_test_request_proxy" => "SyntheticsTestRequestProxy",
699+
"v1.synthetics_test_uptime" => "SyntheticsTestUptime",
698700
"v1.synthetics_timing" => "SyntheticsTiming",
699701
"v1.synthetics_trigger_body" => "SyntheticsTriggerBody",
700702
"v1.synthetics_trigger_ci_test_location" => "SyntheticsTriggerCITestLocation",
701703
"v1.synthetics_trigger_ci_test_run_result" => "SyntheticsTriggerCITestRunResult",
702704
"v1.synthetics_trigger_ci_tests_response" => "SyntheticsTriggerCITestsResponse",
703705
"v1.synthetics_trigger_test" => "SyntheticsTriggerTest",
704706
"v1.synthetics_update_test_pause_status_payload" => "SyntheticsUpdateTestPauseStatusPayload",
707+
"v1.synthetics_uptime" => "SyntheticsUptime",
705708
"v1.synthetics_variable_parser" => "SyntheticsVariableParser",
706709
"v1.synthetics_warning_type" => "SyntheticsWarningType",
707710
"v1.table_widget_cell_display_mode" => "TableWidgetCellDisplayMode",

lib/datadog_api_client/v1/api/synthetics_api.rb

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,73 @@ def edit_global_variable_with_http_info(variable_id, body, opts = {})
627627
return data, status_code, headers
628628
end
629629

630+
# Fetch uptime for multiple tests.
631+
#
632+
# @see #fetch_uptimes_with_http_info
633+
def fetch_uptimes(body, opts = {})
634+
data, _status_code, _headers = fetch_uptimes_with_http_info(body, opts)
635+
data
636+
end
637+
638+
# Fetch uptime for multiple tests.
639+
#
640+
# Fetch uptime for multiple Synthetic tests by ID.
641+
#
642+
# @param body [SyntheticsFetchUptimesPayload] Public ID list of the Synthetic tests and timeframe.
643+
# @param opts [Hash] the optional parameters
644+
# @return [Array<(Array<SyntheticsTestUptime>, Integer, Hash)>] Array<SyntheticsTestUptime> data, response status code and response headers
645+
def fetch_uptimes_with_http_info(body, opts = {})
646+
647+
if @api_client.config.debugging
648+
@api_client.config.logger.debug 'Calling API: SyntheticsAPI.fetch_uptimes ...'
649+
end
650+
# verify the required parameter 'body' is set
651+
if @api_client.config.client_side_validation && body.nil?
652+
fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.fetch_uptimes"
653+
end
654+
# resource path
655+
local_var_path = '/api/v1/synthetics/tests/uptimes'
656+
657+
# query parameters
658+
query_params = opts[:query_params] || {}
659+
660+
# header parameters
661+
header_params = opts[:header_params] || {}
662+
# HTTP header 'Accept' (if needed)
663+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
664+
# HTTP header 'Content-Type'
665+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
666+
667+
# form parameters
668+
form_params = opts[:form_params] || {}
669+
670+
# http body (model)
671+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
672+
673+
# return_type
674+
return_type = opts[:debug_return_type] || 'Array<SyntheticsTestUptime>'
675+
676+
# auth_names
677+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
678+
679+
new_options = opts.merge(
680+
:operation => :fetch_uptimes,
681+
:header_params => header_params,
682+
:query_params => query_params,
683+
:form_params => form_params,
684+
:body => post_body,
685+
:auth_names => auth_names,
686+
:return_type => return_type,
687+
:api_version => "V1"
688+
)
689+
690+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
691+
if @api_client.config.debugging
692+
@api_client.config.logger.debug "API called: SyntheticsAPI#fetch_uptimes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
693+
end
694+
return data, status_code, headers
695+
end
696+
630697
# Get an API test.
631698
#
632699
# @see #get_api_test_with_http_info

0 commit comments

Comments
 (0)