Skip to content

Commit

Permalink
Regenerate client from commit f8ce4f65 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 0a9461f commit 5f485b6
Show file tree
Hide file tree
Showing 13 changed files with 746 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-11 19:15:19.299554",
"spec_repo_commit": "3288a6f0"
"regenerated": "2024-09-12 09:24:52.360923",
"spec_repo_commit": "f8ce4f65"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-11 19:15:19.317665",
"spec_repo_commit": "3288a6f0"
"regenerated": "2024-09-12 09:24:52.379067",
"spec_repo_commit": "f8ce4f65"
}
}
}
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 @@ -31129,6 +31229,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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::SyntheticsAPI.new

body = DatadogAPIClient::V1::SyntheticsFetchUptimesPayload.new({
from_ts: 1726041488,
public_ids: [
"p8m-9gw-nte",
],
to_ts: 1726055954,
})
p api_instance.fetch_uptimes(body)
3 changes: 3 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,9 @@
"v1.TriggerCITests" => {
"body" => "SyntheticsCITestBody",
},
"v1.FetchUptimes" => {
"body" => "SyntheticsFetchUptimesPayload",
},
"v1.GetTest" => {
"public_id" => "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
3 changes: 3 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ def overrides
"v1.synthetics_delete_tests_response" => "SyntheticsDeleteTestsResponse",
"v1.synthetics_device" => "SyntheticsDevice",
"v1.synthetics_device_id" => "SyntheticsDeviceID",
"v1.synthetics_fetch_uptimes_payload" => "SyntheticsFetchUptimesPayload",
"v1.synthetics_get_api_test_latest_results_response" => "SyntheticsGetAPITestLatestResultsResponse",
"v1.synthetics_get_browser_test_latest_results_response" => "SyntheticsGetBrowserTestLatestResultsResponse",
"v1.synthetics_global_variable" => "SyntheticsGlobalVariable",
Expand Down Expand Up @@ -678,13 +679,15 @@ def overrides
"v1.synthetics_test_request_certificate_item" => "SyntheticsTestRequestCertificateItem",
"v1.synthetics_test_request_port" => "SyntheticsTestRequestPort",
"v1.synthetics_test_request_proxy" => "SyntheticsTestRequestProxy",
"v1.synthetics_test_uptime" => "SyntheticsTestUptime",
"v1.synthetics_timing" => "SyntheticsTiming",
"v1.synthetics_trigger_body" => "SyntheticsTriggerBody",
"v1.synthetics_trigger_ci_test_location" => "SyntheticsTriggerCITestLocation",
"v1.synthetics_trigger_ci_test_run_result" => "SyntheticsTriggerCITestRunResult",
"v1.synthetics_trigger_ci_tests_response" => "SyntheticsTriggerCITestsResponse",
"v1.synthetics_trigger_test" => "SyntheticsTriggerTest",
"v1.synthetics_update_test_pause_status_payload" => "SyntheticsUpdateTestPauseStatusPayload",
"v1.synthetics_uptime" => "SyntheticsUptime",
"v1.synthetics_variable_parser" => "SyntheticsVariableParser",
"v1.synthetics_warning_type" => "SyntheticsWarningType",
"v1.table_widget_cell_display_mode" => "TableWidgetCellDisplayMode",
Expand Down
67 changes: 67 additions & 0 deletions lib/datadog_api_client/v1/api/synthetics_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,73 @@ def edit_global_variable_with_http_info(variable_id, body, opts = {})
return data, status_code, headers
end

# Fetch uptime for multiple tests.
#
# @see #fetch_uptimes_with_http_info
def fetch_uptimes(body, opts = {})
data, _status_code, _headers = fetch_uptimes_with_http_info(body, opts)
data
end

# Fetch uptime for multiple tests.
#
# Fetch uptime for multiple Synthetic tests by ID.
#
# @param body [SyntheticsFetchUptimesPayload] Public ID list of the Synthetic tests and timeframe.
# @param opts [Hash] the optional parameters
# @return [Array<(Array<SyntheticsTestUptime>, Integer, Hash)>] Array<SyntheticsTestUptime> data, response status code and response headers
def fetch_uptimes_with_http_info(body, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SyntheticsAPI.fetch_uptimes ...'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.fetch_uptimes"
end
# resource path
local_var_path = '/api/v1/synthetics/tests/uptimes'

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

# return_type
return_type = opts[:debug_return_type] || 'Array<SyntheticsTestUptime>'

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :fetch_uptimes,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V1"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: SyntheticsAPI#fetch_uptimes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Get an API test.
#
# @see #get_api_test_with_http_info
Expand Down
Loading

0 comments on commit 5f485b6

Please sign in to comment.