Skip to content

Commit

Permalink
Regenerate client from commit 507d0354 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Sep 26, 2024
1 parent 517452e commit de62b17
Show file tree
Hide file tree
Showing 12 changed files with 934 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-25 18:39:36.323908",
"spec_repo_commit": "1fa8186c"
"regenerated": "2024-09-26 16:23:50.422526",
"spec_repo_commit": "507d0354"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-25 18:39:36.338632",
"spec_repo_commit": "1fa8186c"
"regenerated": "2024-09-26 16:23:50.437223",
"spec_repo_commit": "507d0354"
}
}
}
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 @@ -31950,6 +32050,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
73 changes: 73 additions & 0 deletions api/datadogV1/api_synthetics.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,79 @@ func (a *SyntheticsApi) EditGlobalVariable(ctx _context.Context, variableId stri
return localVarReturnValue, localVarHTTPResponse, nil
}

// FetchUptimes Fetch uptime for multiple tests.
// Fetch uptime for multiple Synthetic tests by ID.
func (a *SyntheticsApi) FetchUptimes(ctx _context.Context, body SyntheticsFetchUptimesPayload) ([]SyntheticsTestUptime, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
localVarReturnValue []SyntheticsTestUptime
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v1.SyntheticsApi.FetchUptimes")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v1/synthetics/tests/uptimes"

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Content-Type"] = "application/json"
localVarHeaderParams["Accept"] = "application/json"

// body params
localVarPostBody = &body
datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// GetAPITest Get an API test.
// Get the detailed configuration associated with
// a Synthetic API test.
Expand Down
1 change: 1 addition & 0 deletions api/datadogV1/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
// - [SyntheticsApi.DeletePrivateLocation]
// - [SyntheticsApi.DeleteTests]
// - [SyntheticsApi.EditGlobalVariable]
// - [SyntheticsApi.FetchUptimes]
// - [SyntheticsApi.GetAPITest]
// - [SyntheticsApi.GetAPITestLatestResults]
// - [SyntheticsApi.GetAPITestResult]
Expand Down
Loading

0 comments on commit de62b17

Please sign in to comment.