diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4613e9536254..4b32533f7350 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -64486,6 +64486,214 @@ components: description: The direction and type of synchronization for this property. type: string type: object + SyntheticsFastTestAssertionResult: + additionalProperties: {} + description: Result of a single assertion evaluated during a fast test run. + type: object + SyntheticsFastTestResult: + description: |- + Fast test result response. Returns `null` if the result is not yet available + (the test is still running or timed out before completing). + nullable: true + properties: + data: + $ref: "#/components/schemas/SyntheticsFastTestResultData" + type: object + SyntheticsFastTestResultAttributes: + description: Attributes of the fast test result. + properties: + device: + $ref: "#/components/schemas/SyntheticsFastTestResultDevice" + location: + $ref: "#/components/schemas/SyntheticsFastTestResultLocation" + result: + $ref: "#/components/schemas/SyntheticsFastTestResultDetail" + test_sub_type: + $ref: "#/components/schemas/SyntheticsFastTestSubType" + test_type: + description: The type of the Synthetic test that produced this result (for example, `api` or `browser`). + example: api + type: string + test_version: + description: Version of the test at the time the fast test was triggered. + format: int64 + type: integer + type: object + SyntheticsFastTestResultData: + description: Fast test result data object (JSON:API format). + properties: + attributes: + $ref: "#/components/schemas/SyntheticsFastTestResultAttributes" + id: + description: The UUID of the fast test, used as the result identifier. + example: abc12345-1234-1234-1234-abc123456789 + type: string + type: + $ref: "#/components/schemas/SyntheticsFastTestResultType" + type: object + SyntheticsFastTestResultDetail: + description: |- + Detailed result data for the fast test run. The exact shape of nested fields + (`request`, `response`, `assertions`, etc.) depends on the test subtype. + properties: + assertions: + description: Results of each assertion evaluated during the test. + items: + $ref: "#/components/schemas/SyntheticsFastTestAssertionResult" + type: array + call_type: + description: gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + type: string + cert: + additionalProperties: {} + description: TLS certificate details, present for SSL tests. + type: object + duration: + description: Total duration of the test in milliseconds. + format: double + type: number + failure: + $ref: "#/components/schemas/SyntheticsFastTestResultFailure" + finished_at: + description: Unix timestamp (ms) of when the test finished. + format: int64 + type: integer + id: + description: The result ID. Set to the fast test UUID because no persistent result ID exists for fast tests. + type: string + is_fast_retry: + description: Whether this result is from an automatic fast retry. + type: boolean + request: + additionalProperties: {} + description: Details of the outgoing request made during the test. + type: object + resolved_ip: + description: IP address resolved for the target host. + example: "1.2.3.4" + type: string + response: + additionalProperties: {} + description: Details of the response received during the test. + type: object + run_type: + description: Run type indicating how this test was triggered (for example, `fast`). + type: string + started_at: + description: Unix timestamp (ms) of when the test started. + format: int64 + type: integer + status: + description: Status of the test result (`passed` or `failed`). + example: passed + type: string + steps: + description: Step results for multistep API tests. + items: + $ref: "#/components/schemas/SyntheticsFastTestStepResult" + type: array + timings: + additionalProperties: {} + description: Timing breakdown of the test request phases (for example, DNS, TCP, TLS, first byte). + type: object + traceroute: + description: Traceroute hop results, present for ICMP and TCP tests. + items: + $ref: "#/components/schemas/SyntheticsFastTestTracerouteHop" + type: array + triggered_at: + description: Unix timestamp (ms) of when the test was triggered. + format: int64 + type: integer + tunnel: + description: Whether the test was run through a Synthetics tunnel. + type: boolean + type: object + SyntheticsFastTestResultDevice: + description: Device information for browser-based fast tests. + properties: + id: + description: Device identifier. + example: chrome.laptop_large + type: string + name: + description: Display name of the device. + example: Laptop Large + type: string + type: object + SyntheticsFastTestResultFailure: + description: Failure details if the fast test did not pass. + properties: + code: + description: Error code identifying the failure type. + example: TIMEOUT + type: string + message: + description: Human-readable description of the failure. + example: Connection timed out + type: string + type: object + SyntheticsFastTestResultLocation: + description: Location from which the fast test was executed. + properties: + id: + description: ID of the location. + example: aws:us-east-1 + type: string + name: + description: Display name of the location. + example: N. Virginia (AWS) + type: string + version: + description: Agent version running at this location. + type: string + worker_id: + description: Identifier of the specific worker that ran the test. + type: string + type: object + SyntheticsFastTestResultType: + default: result + description: JSON:API type for a fast test result. + enum: + - result + example: result + type: string + x-enum-varnames: + - RESULT + SyntheticsFastTestStepResult: + additionalProperties: {} + description: Result of a single step in a multistep fast test run. + type: object + SyntheticsFastTestSubType: + description: Subtype of the Synthetic test that produced this result. + enum: + - dns + - grpc + - http + - icmp + - mcp + - multi + - ssl + - tcp + - udp + - websocket + example: http + type: string + x-enum-varnames: + - DNS + - GRPC + - HTTP + - ICMP + - MCP + - MULTI + - SSL + - TCP + - UDP + - WEBSOCKET + SyntheticsFastTestTracerouteHop: + additionalProperties: {} + description: A single traceroute hop result from a fast test run. + type: object SyntheticsGlobalVariable: description: Synthetic global variable. properties: @@ -106234,6 +106442,50 @@ paths: operator: OR permissions: - synthetics_write + /api/v2/synthetics/tests/fast/{id}: + get: + operationId: GetSyntheticsFastTestResult + parameters: + - description: The UUID of the fast test to retrieve the result for. + in: path + name: id + required: true + schema: + example: abc12345-1234-1234-1234-abc123456789 + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsFastTestResult" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a fast test result + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/tests/network: post: operationId: CreateSyntheticsNetworkTest diff --git a/examples/v2/synthetics/GetSyntheticsFastTestResult.ts b/examples/v2/synthetics/GetSyntheticsFastTestResult.ts new file mode 100644 index 000000000000..05fb4f94e930 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsFastTestResult.ts @@ -0,0 +1,21 @@ +/** + * Get a fast test result returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetSyntheticsFastTestResultRequest = { + id: "abc12345-1234-1234-1234-abc123456789", +}; + +apiInstance + .getSyntheticsFastTestResult(params) + .then((data: v2.SyntheticsFastTestResult) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 3480d54a2a2f..777bb863a27b 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -11168,6 +11168,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "DeletedTestsResponse", }, + "v2.GetSyntheticsFastTestResult": { + "id": { + "type": "string", + "format": "", + }, + "operationResponseType": "SyntheticsFastTestResult", + }, "v2.CreateSyntheticsNetworkTest": { "body": { "type": "SyntheticsNetworkTestEditRequest", diff --git a/features/v2/synthetics.feature b/features/v2/synthetics.feature index 16a842cff397..418dbf5fb3ad 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/synthetics.feature @@ -119,6 +119,20 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a fast test result returns "API error response." response + Given new "GetSyntheticsFastTestResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a fast test result returns "OK" response + Given new "GetSyntheticsFastTestResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Get a suite returns "API error response." response Given new "GetSyntheticsSuite" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 210d32399980..0406fd680e56 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5864,6 +5864,12 @@ "type": "idempotent" } }, + "GetSyntheticsFastTestResult": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "CreateSyntheticsNetworkTest": { "tag": "Synthetics", "undo": { diff --git a/packages/datadog-api-client-v2/apis/SyntheticsApi.ts b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts index 277573c4c20a..a80eddf684af 100644 --- a/packages/datadog-api-client-v2/apis/SyntheticsApi.ts +++ b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts @@ -26,6 +26,7 @@ import { GlobalVariableResponse } from "../models/GlobalVariableResponse"; import { OnDemandConcurrencyCapAttributes } from "../models/OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "../models/OnDemandConcurrencyCapResponse"; import { SuiteCreateEditRequest } from "../models/SuiteCreateEditRequest"; +import { SyntheticsFastTestResult } from "../models/SyntheticsFastTestResult"; import { SyntheticsNetworkTestEditRequest } from "../models/SyntheticsNetworkTestEditRequest"; import { SyntheticsNetworkTestResponse } from "../models/SyntheticsNetworkTestResponse"; import { SyntheticsSuiteResponse } from "../models/SyntheticsSuiteResponse"; @@ -276,6 +277,40 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getSyntheticsFastTestResult( + id: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "getSyntheticsFastTestResult"); + } + + // Path Params + const localVarPath = "/api/v2/synthetics/tests/fast/{id}".replace( + "{id}", + encodeURIComponent(String(id)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.getSyntheticsFastTestResult") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getSyntheticsNetworkTest( publicId: string, _options?: Configuration @@ -909,6 +944,68 @@ export class SyntheticsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getSyntheticsFastTestResult + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSyntheticsFastTestResult( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsFastTestResult = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsFastTestResult" + ) as SyntheticsFastTestResult; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SyntheticsFastTestResult = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsFastTestResult", + "" + ) as SyntheticsFastTestResult; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1311,6 +1408,14 @@ export interface SyntheticsApiEditSyntheticsSuiteRequest { body: SuiteCreateEditRequest; } +export interface SyntheticsApiGetSyntheticsFastTestResultRequest { + /** + * The UUID of the fast test to retrieve the result for. + * @type string + */ + id: string; +} + export interface SyntheticsApiGetSyntheticsNetworkTestRequest { /** * The public ID of the Network Path test to get details from. @@ -1527,6 +1632,26 @@ export class SyntheticsApi { }); } + /** + * @param param The request object + */ + public getSyntheticsFastTestResult( + param: SyntheticsApiGetSyntheticsFastTestResultRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getSyntheticsFastTestResult(param.id, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getSyntheticsFastTestResult( + responseContext + ); + }); + }); + } + /** * @param param The request object */ diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index aaa3b1939bab..5f7dc60a3853 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1143,6 +1143,7 @@ export { SyntheticsApiDeleteSyntheticsSuitesRequest, SyntheticsApiDeleteSyntheticsTestsRequest, SyntheticsApiEditSyntheticsSuiteRequest, + SyntheticsApiGetSyntheticsFastTestResultRequest, SyntheticsApiGetSyntheticsNetworkTestRequest, SyntheticsApiGetSyntheticsSuiteRequest, SyntheticsApiPatchGlobalVariableRequest, @@ -5403,6 +5404,15 @@ export { SuppressionVersionHistory } from "./models/SuppressionVersionHistory"; export { SuppressionVersions } from "./models/SuppressionVersions"; export { SyncProperty } from "./models/SyncProperty"; export { SyncPropertyWithMapping } from "./models/SyncPropertyWithMapping"; +export { SyntheticsFastTestResult } from "./models/SyntheticsFastTestResult"; +export { SyntheticsFastTestResultAttributes } from "./models/SyntheticsFastTestResultAttributes"; +export { SyntheticsFastTestResultData } from "./models/SyntheticsFastTestResultData"; +export { SyntheticsFastTestResultDetail } from "./models/SyntheticsFastTestResultDetail"; +export { SyntheticsFastTestResultDevice } from "./models/SyntheticsFastTestResultDevice"; +export { SyntheticsFastTestResultFailure } from "./models/SyntheticsFastTestResultFailure"; +export { SyntheticsFastTestResultLocation } from "./models/SyntheticsFastTestResultLocation"; +export { SyntheticsFastTestResultType } from "./models/SyntheticsFastTestResultType"; +export { SyntheticsFastTestSubType } from "./models/SyntheticsFastTestSubType"; export { SyntheticsGlobalVariable } from "./models/SyntheticsGlobalVariable"; export { SyntheticsGlobalVariableAttributes } from "./models/SyntheticsGlobalVariableAttributes"; export { SyntheticsGlobalVariableOptions } from "./models/SyntheticsGlobalVariableOptions"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index c86f9501b26c..c092ffd784f2 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -3161,6 +3161,13 @@ import { SuppressionVersionHistory } from "./SuppressionVersionHistory"; import { SuppressionVersions } from "./SuppressionVersions"; import { SyncProperty } from "./SyncProperty"; import { SyncPropertyWithMapping } from "./SyncPropertyWithMapping"; +import { SyntheticsFastTestResult } from "./SyntheticsFastTestResult"; +import { SyntheticsFastTestResultAttributes } from "./SyntheticsFastTestResultAttributes"; +import { SyntheticsFastTestResultData } from "./SyntheticsFastTestResultData"; +import { SyntheticsFastTestResultDetail } from "./SyntheticsFastTestResultDetail"; +import { SyntheticsFastTestResultDevice } from "./SyntheticsFastTestResultDevice"; +import { SyntheticsFastTestResultFailure } from "./SyntheticsFastTestResultFailure"; +import { SyntheticsFastTestResultLocation } from "./SyntheticsFastTestResultLocation"; import { SyntheticsGlobalVariable } from "./SyntheticsGlobalVariable"; import { SyntheticsGlobalVariableAttributes } from "./SyntheticsGlobalVariableAttributes"; import { SyntheticsGlobalVariableOptions } from "./SyntheticsGlobalVariableOptions"; @@ -5325,6 +5332,19 @@ const enumsMap: { [key: string]: any[] } = { StatusPagesComponentGroupType: ["components"], StatusPagesUserType: ["users"], SuiteSearchResponseType: ["suites_search"], + SyntheticsFastTestResultType: ["result"], + SyntheticsFastTestSubType: [ + "dns", + "grpc", + "http", + "icmp", + "mcp", + "multi", + "ssl", + "tcp", + "udp", + "websocket", + ], SyntheticsGlobalVariableParseTestOptionsType: [ "http_body", "http_header", @@ -9400,6 +9420,13 @@ const typeMap: { [index: string]: any } = { SuppressionVersions: SuppressionVersions, SyncProperty: SyncProperty, SyncPropertyWithMapping: SyncPropertyWithMapping, + SyntheticsFastTestResult: SyntheticsFastTestResult, + SyntheticsFastTestResultAttributes: SyntheticsFastTestResultAttributes, + SyntheticsFastTestResultData: SyntheticsFastTestResultData, + SyntheticsFastTestResultDetail: SyntheticsFastTestResultDetail, + SyntheticsFastTestResultDevice: SyntheticsFastTestResultDevice, + SyntheticsFastTestResultFailure: SyntheticsFastTestResultFailure, + SyntheticsFastTestResultLocation: SyntheticsFastTestResultLocation, SyntheticsGlobalVariable: SyntheticsGlobalVariable, SyntheticsGlobalVariableAttributes: SyntheticsGlobalVariableAttributes, SyntheticsGlobalVariableOptions: SyntheticsGlobalVariableOptions, diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResult.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResult.ts new file mode 100644 index 000000000000..d69b2323a860 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResult.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsFastTestResultData } from "./SyntheticsFastTestResultData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Fast test result response. Returns `null` if the result is not yet available + * (the test is still running or timed out before completing). + */ +export class SyntheticsFastTestResult { + /** + * Fast test result data object (JSON:API format). + */ + "data"?: SyntheticsFastTestResultData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SyntheticsFastTestResultData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResult.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultAttributes.ts new file mode 100644 index 000000000000..89ed4244ce40 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultAttributes.ts @@ -0,0 +1,98 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsFastTestResultDetail } from "./SyntheticsFastTestResultDetail"; +import { SyntheticsFastTestResultDevice } from "./SyntheticsFastTestResultDevice"; +import { SyntheticsFastTestResultLocation } from "./SyntheticsFastTestResultLocation"; +import { SyntheticsFastTestSubType } from "./SyntheticsFastTestSubType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the fast test result. + */ +export class SyntheticsFastTestResultAttributes { + /** + * Device information for browser-based fast tests. + */ + "device"?: SyntheticsFastTestResultDevice; + /** + * Location from which the fast test was executed. + */ + "location"?: SyntheticsFastTestResultLocation; + /** + * Detailed result data for the fast test run. The exact shape of nested fields + * (`request`, `response`, `assertions`, etc.) depends on the test subtype. + */ + "result"?: SyntheticsFastTestResultDetail; + /** + * Subtype of the Synthetic test that produced this result. + */ + "testSubType"?: SyntheticsFastTestSubType; + /** + * The type of the Synthetic test that produced this result (for example, `api` or `browser`). + */ + "testType"?: string; + /** + * Version of the test at the time the fast test was triggered. + */ + "testVersion"?: number; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + device: { + baseName: "device", + type: "SyntheticsFastTestResultDevice", + }, + location: { + baseName: "location", + type: "SyntheticsFastTestResultLocation", + }, + result: { + baseName: "result", + type: "SyntheticsFastTestResultDetail", + }, + testSubType: { + baseName: "test_sub_type", + type: "SyntheticsFastTestSubType", + }, + testType: { + baseName: "test_type", + type: "string", + }, + testVersion: { + baseName: "test_version", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResultAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultData.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultData.ts new file mode 100644 index 000000000000..742608137d18 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultData.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsFastTestResultAttributes } from "./SyntheticsFastTestResultAttributes"; +import { SyntheticsFastTestResultType } from "./SyntheticsFastTestResultType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Fast test result data object (JSON:API format). + */ +export class SyntheticsFastTestResultData { + /** + * Attributes of the fast test result. + */ + "attributes"?: SyntheticsFastTestResultAttributes; + /** + * The UUID of the fast test, used as the result identifier. + */ + "id"?: string; + /** + * JSON:API type for a fast test result. + */ + "type"?: SyntheticsFastTestResultType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsFastTestResultAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsFastTestResultType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResultData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultDetail.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultDetail.ts new file mode 100644 index 000000000000..e46c20dae568 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultDetail.ts @@ -0,0 +1,202 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsFastTestResultFailure } from "./SyntheticsFastTestResultFailure"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Detailed result data for the fast test run. The exact shape of nested fields + * (`request`, `response`, `assertions`, etc.) depends on the test subtype. + */ +export class SyntheticsFastTestResultDetail { + /** + * Results of each assertion evaluated during the test. + */ + "assertions"?: Array<{ [key: string]: any }>; + /** + * gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + */ + "callType"?: string; + /** + * TLS certificate details, present for SSL tests. + */ + "cert"?: { [key: string]: any }; + /** + * Total duration of the test in milliseconds. + */ + "duration"?: number; + /** + * Failure details if the fast test did not pass. + */ + "failure"?: SyntheticsFastTestResultFailure; + /** + * Unix timestamp (ms) of when the test finished. + */ + "finishedAt"?: number; + /** + * The result ID. Set to the fast test UUID because no persistent result ID exists for fast tests. + */ + "id"?: string; + /** + * Whether this result is from an automatic fast retry. + */ + "isFastRetry"?: boolean; + /** + * Details of the outgoing request made during the test. + */ + "request"?: { [key: string]: any }; + /** + * IP address resolved for the target host. + */ + "resolvedIp"?: string; + /** + * Details of the response received during the test. + */ + "response"?: { [key: string]: any }; + /** + * Run type indicating how this test was triggered (for example, `fast`). + */ + "runType"?: string; + /** + * Unix timestamp (ms) of when the test started. + */ + "startedAt"?: number; + /** + * Status of the test result (`passed` or `failed`). + */ + "status"?: string; + /** + * Step results for multistep API tests. + */ + "steps"?: Array<{ [key: string]: any }>; + /** + * Timing breakdown of the test request phases (for example, DNS, TCP, TLS, first byte). + */ + "timings"?: { [key: string]: any }; + /** + * Traceroute hop results, present for ICMP and TCP tests. + */ + "traceroute"?: Array<{ [key: string]: any }>; + /** + * Unix timestamp (ms) of when the test was triggered. + */ + "triggeredAt"?: number; + /** + * Whether the test was run through a Synthetics tunnel. + */ + "tunnel"?: boolean; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + assertions: { + baseName: "assertions", + type: "Array<{ [key: string]: any; }>", + }, + callType: { + baseName: "call_type", + type: "string", + }, + cert: { + baseName: "cert", + type: "{ [key: string]: any; }", + }, + duration: { + baseName: "duration", + type: "number", + format: "double", + }, + failure: { + baseName: "failure", + type: "SyntheticsFastTestResultFailure", + }, + finishedAt: { + baseName: "finished_at", + type: "number", + format: "int64", + }, + id: { + baseName: "id", + type: "string", + }, + isFastRetry: { + baseName: "is_fast_retry", + type: "boolean", + }, + request: { + baseName: "request", + type: "{ [key: string]: any; }", + }, + resolvedIp: { + baseName: "resolved_ip", + type: "string", + }, + response: { + baseName: "response", + type: "{ [key: string]: any; }", + }, + runType: { + baseName: "run_type", + type: "string", + }, + startedAt: { + baseName: "started_at", + type: "number", + format: "int64", + }, + status: { + baseName: "status", + type: "string", + }, + steps: { + baseName: "steps", + type: "Array<{ [key: string]: any; }>", + }, + timings: { + baseName: "timings", + type: "{ [key: string]: any; }", + }, + traceroute: { + baseName: "traceroute", + type: "Array<{ [key: string]: any; }>", + }, + triggeredAt: { + baseName: "triggered_at", + type: "number", + format: "int64", + }, + tunnel: { + baseName: "tunnel", + type: "boolean", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResultDetail.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultDevice.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultDevice.ts new file mode 100644 index 000000000000..565795194987 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultDevice.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Device information for browser-based fast tests. + */ +export class SyntheticsFastTestResultDevice { + /** + * Device identifier. + */ + "id"?: string; + /** + * Display name of the device. + */ + "name"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResultDevice.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultFailure.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultFailure.ts new file mode 100644 index 000000000000..c3d626b00795 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultFailure.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Failure details if the fast test did not pass. + */ +export class SyntheticsFastTestResultFailure { + /** + * Error code identifying the failure type. + */ + "code"?: string; + /** + * Human-readable description of the failure. + */ + "message"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + code: { + baseName: "code", + type: "string", + }, + message: { + baseName: "message", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResultFailure.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultLocation.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultLocation.ts new file mode 100644 index 000000000000..b064130762ab --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultLocation.ts @@ -0,0 +1,76 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Location from which the fast test was executed. + */ +export class SyntheticsFastTestResultLocation { + /** + * ID of the location. + */ + "id"?: string; + /** + * Display name of the location. + */ + "name"?: string; + /** + * Agent version running at this location. + */ + "version"?: string; + /** + * Identifier of the specific worker that ran the test. + */ + "workerId"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + version: { + baseName: "version", + type: "string", + }, + workerId: { + baseName: "worker_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsFastTestResultLocation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestResultType.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultType.ts new file mode 100644 index 000000000000..90e81febd600 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestResultType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * JSON:API type for a fast test result. + */ + +export type SyntheticsFastTestResultType = typeof RESULT | UnparsedObject; +export const RESULT = "result"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsFastTestSubType.ts b/packages/datadog-api-client-v2/models/SyntheticsFastTestSubType.ts new file mode 100644 index 000000000000..c2a76d4c8d4f --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsFastTestSubType.ts @@ -0,0 +1,34 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Subtype of the Synthetic test that produced this result. + */ + +export type SyntheticsFastTestSubType = + | typeof DNS + | typeof GRPC + | typeof HTTP + | typeof ICMP + | typeof MCP + | typeof MULTI + | typeof SSL + | typeof TCP + | typeof UDP + | typeof WEBSOCKET + | UnparsedObject; +export const DNS = "dns"; +export const GRPC = "grpc"; +export const HTTP = "http"; +export const ICMP = "icmp"; +export const MCP = "mcp"; +export const MULTI = "multi"; +export const SSL = "ssl"; +export const TCP = "tcp"; +export const UDP = "udp"; +export const WEBSOCKET = "websocket";