Skip to content

Commit 43980e3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Support GRPC unary calls in Synthetics (#930)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 32dbbcf commit 43980e3

File tree

9 files changed

+57
-64
lines changed

9 files changed

+57
-64
lines changed

.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.4",
7-
"regenerated": "2022-12-08 13:18:30.553175",
8-
"spec_repo_commit": "65b2053a"
7+
"regenerated": "2022-12-09 09:29:10.539503",
8+
"spec_repo_commit": "68c90324"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-12-08 13:18:30.569528",
13-
"spec_repo_commit": "65b2053a"
12+
"regenerated": "2022-12-09 09:29:10.588425",
13+
"spec_repo_commit": "68c90324"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,26 +3116,6 @@ components:
31163116
required:
31173117
- message
31183118
type: object
3119-
HTTPMethod:
3120-
description: The HTTP method.
3121-
enum:
3122-
- GET
3123-
- POST
3124-
- PATCH
3125-
- PUT
3126-
- DELETE
3127-
- HEAD
3128-
- OPTIONS
3129-
example: GET
3130-
type: string
3131-
x-enum-varnames:
3132-
- GET
3133-
- POST
3134-
- PATCH
3135-
- PUT
3136-
- DELETE
3137-
- HEAD
3138-
- OPTIONS
31393119
HeatMapWidgetDefinition:
31403120
description: The heat map visualization shows metrics aggregated across many
31413121
tags, such as hosts. The more hosts that have a particular value, the darker
@@ -13141,6 +13121,16 @@ components:
1314113121
- TYPE_TEXT
1314213122
- UPLOAD_FILES
1314313123
- WAIT
13124+
SyntheticsTestCallType:
13125+
description: The type of gRPC call to perform.
13126+
enum:
13127+
- healthcheck
13128+
- unary
13129+
example: unary
13130+
type: string
13131+
x-enum-varnames:
13132+
- HEALTHCHECK
13133+
- UNARY
1314413134
SyntheticsTestCiOptions:
1314513135
description: CI/CD options for a Synthetic test.
1314613136
properties:
@@ -13448,6 +13438,8 @@ components:
1344813438
type: string
1344913439
bodyType:
1345013440
$ref: '#/components/schemas/SyntheticsTestRequestBodyType'
13441+
callType:
13442+
$ref: '#/components/schemas/SyntheticsTestCallType'
1345113443
certificate:
1345213444
$ref: '#/components/schemas/SyntheticsTestRequestCertificate'
1345313445
certificateDomains:
@@ -13483,7 +13475,10 @@ components:
1348313475
metadata:
1348413476
$ref: '#/components/schemas/SyntheticsTestMetadata'
1348513477
method:
13486-
$ref: '#/components/schemas/HTTPMethod'
13478+
description: Either the HTTP method/verb to use or a gRPC method available
13479+
on the service set in the `service` field. Required if `subtype` is `HTTP`
13480+
or if `subtype` is `grpc` and `callType` is `unary`.
13481+
type: string
1348713482
noSavingResponseBody:
1348813483
description: Determines whether or not to save the response body.
1348913484
type: boolean
@@ -13511,7 +13506,8 @@ components:
1351113506
the same IP address and TCP port number.'
1351213507
type: string
1351313508
service:
13514-
description: gRPC service on which you want to perform the healthcheck.
13509+
description: The gRPC service on which you want to perform the gRPC call.
13510+
example: Greeter
1351513511
type: string
1351613512
shouldTrackHops:
1351713513
description: Turns on a traceroute probe to discover all gateways along

examples/v1/synthetics/UpdateBrowserTest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ const params: v1.SyntheticsApiUpdateBrowserTestRequest = {
2424
username: "my_username",
2525
},
2626
bodyType: "text/plain",
27+
callType: "unary",
2728
certificate: {
2829
cert: {},
2930
key: {},
3031
},
3132
certificateDomains: [],
32-
method: "GET",
3333
proxy: {
3434
url: "https://example.com",
3535
},
36+
service: "Greeter",
3637
url: "https://example.com",
3738
},
3839
variables: [

features/v1/synthetics.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Feature: Synthetics
3434
@generated @skip @team:DataDog/synthetics-app
3535
Scenario: Create a browser test returns "- JSON format is wrong" response
3636
Given new "CreateSyntheticsBrowserTest" request
37-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
37+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
3838
When the request is sent
3939
Then the response status is 400 - JSON format is wrong
4040

@@ -59,7 +59,7 @@ Feature: Synthetics
5959
@generated @skip @team:DataDog/synthetics-app
6060
Scenario: Create a browser test returns "Test quota is reached" response
6161
Given new "CreateSyntheticsBrowserTest" request
62-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
62+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
6363
When the request is sent
6464
Then the response status is 402 Test quota is reached
6565

@@ -249,23 +249,23 @@ Feature: Synthetics
249249
Scenario: Edit a browser test returns "- JSON format is wrong" response
250250
Given new "UpdateBrowserTest" request
251251
And request contains "public_id" parameter from "REPLACE.ME"
252-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
252+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
253253
When the request is sent
254254
Then the response status is 400 - JSON format is wrong
255255

256256
@generated @skip @team:DataDog/synthetics-app
257257
Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response
258258
Given new "UpdateBrowserTest" request
259259
And request contains "public_id" parameter from "REPLACE.ME"
260-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
260+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
261261
When the request is sent
262262
Then the response status is 404 - Synthetic Monitoring is not activated for the user
263263

264264
@generated @skip @team:DataDog/synthetics-app
265265
Scenario: Edit a browser test returns "OK" response
266266
Given new "UpdateBrowserTest" request
267267
And request contains "public_id" parameter from "REPLACE.ME"
268-
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
268+
And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "bodyType": "text/plain", "callType": "unary", "certificate": {"cert": {}, "key": {}}, "certificateDomains": [], "proxy": {"url": "https://example.com"}, "service": "Greeter", "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"ci": {"executionRule": "blocking"}, "device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "rumSettings": {"applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "clientTokenId": 12345, "isEnabled": true}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"}
269269
When the request is sent
270270
Then the response status is 200 OK
271271

packages/datadog-api-client-v1/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ export { HourlyUsageAttributionResponse } from "./models/HourlyUsageAttributionR
470470
export { HourlyUsageAttributionUsageType } from "./models/HourlyUsageAttributionUsageType";
471471
export { HTTPLogError } from "./models/HTTPLogError";
472472
export { HTTPLogItem } from "./models/HTTPLogItem";
473-
export { HTTPMethod } from "./models/HTTPMethod";
474473
export { IdpFormData } from "./models/IdpFormData";
475474
export { IdpResponse } from "./models/IdpResponse";
476475
export { IFrameWidgetDefinition } from "./models/IFrameWidgetDefinition";
@@ -868,6 +867,7 @@ export { SyntheticsStep } from "./models/SyntheticsStep";
868867
export { SyntheticsStepDetail } from "./models/SyntheticsStepDetail";
869868
export { SyntheticsStepDetailWarning } from "./models/SyntheticsStepDetailWarning";
870869
export { SyntheticsStepType } from "./models/SyntheticsStepType";
870+
export { SyntheticsTestCallType } from "./models/SyntheticsTestCallType";
871871
export { SyntheticsTestCiOptions } from "./models/SyntheticsTestCiOptions";
872872
export { SyntheticsTestConfig } from "./models/SyntheticsTestConfig";
873873
export { SyntheticsTestDetails } from "./models/SyntheticsTestDetails";

packages/datadog-api-client-v1/models/HTTPMethod.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ const enumsMap: { [key: string]: any[] } = {
671671
FunnelWidgetDefinitionType: ["funnel"],
672672
GeomapWidgetDefinitionType: ["geomap"],
673673
GroupWidgetDefinitionType: ["group"],
674-
HTTPMethod: ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS"],
675674
HeatMapWidgetDefinitionType: ["heatmap"],
676675
HostMapWidgetDefinitionType: ["hostmap"],
677676
HourlyUsageAttributionUsageType: [
@@ -1089,6 +1088,7 @@ const enumsMap: { [key: string]: any[] } = {
10891088
"uploadFiles",
10901089
"wait",
10911090
],
1091+
SyntheticsTestCallType: ["healthcheck", "unary"],
10921092
SyntheticsTestDetailsSubType: [
10931093
"http",
10941094
"ssl",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
/**
8+
* The type of gRPC call to perform.
9+
*/
10+
11+
export type SyntheticsTestCallType = typeof HEALTHCHECK | typeof UNARY;
12+
export const HEALTHCHECK = "healthcheck";
13+
export const UNARY = "unary";

packages/datadog-api-client-v1/models/SyntheticsTestRequest.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* This product includes software developed at Datadog (https://www.datadoghq.com/).
44
* Copyright 2020-Present Datadog, Inc.
55
*/
6-
import { HTTPMethod } from "./HTTPMethod";
76
import { SyntheticsBasicAuth } from "./SyntheticsBasicAuth";
7+
import { SyntheticsTestCallType } from "./SyntheticsTestCallType";
88
import { SyntheticsTestRequestBodyType } from "./SyntheticsTestRequestBodyType";
99
import { SyntheticsTestRequestCertificate } from "./SyntheticsTestRequestCertificate";
1010
import { SyntheticsTestRequestProxy } from "./SyntheticsTestRequestProxy";
@@ -31,6 +31,10 @@ export class SyntheticsTestRequest {
3131
* Type of the request body.
3232
*/
3333
"bodyType"?: SyntheticsTestRequestBodyType;
34+
/**
35+
* The type of gRPC call to perform.
36+
*/
37+
"callType"?: SyntheticsTestCallType;
3438
/**
3539
* Client certificate to use when performing the test request.
3640
*/
@@ -68,9 +72,9 @@ export class SyntheticsTestRequest {
6872
*/
6973
"metadata"?: { [key: string]: string };
7074
/**
71-
* The HTTP method.
75+
* Either the HTTP method/verb to use or a gRPC method available on the service set in the `service` field. Required if `subtype` is `HTTP` or if `subtype` is `grpc` and `callType` is `unary`.
7276
*/
73-
"method"?: HTTPMethod;
77+
"method"?: string;
7478
/**
7579
* Determines whether or not to save the response body.
7680
*/
@@ -98,7 +102,7 @@ export class SyntheticsTestRequest {
98102
*/
99103
"servername"?: string;
100104
/**
101-
* gRPC service on which you want to perform the healthcheck.
105+
* The gRPC service on which you want to perform the gRPC call.
102106
*/
103107
"service"?: string;
104108
/**
@@ -139,6 +143,10 @@ export class SyntheticsTestRequest {
139143
baseName: "bodyType",
140144
type: "SyntheticsTestRequestBodyType",
141145
},
146+
callType: {
147+
baseName: "callType",
148+
type: "SyntheticsTestCallType",
149+
},
142150
certificate: {
143151
baseName: "certificate",
144152
type: "SyntheticsTestRequestCertificate",
@@ -178,7 +186,7 @@ export class SyntheticsTestRequest {
178186
},
179187
method: {
180188
baseName: "method",
181-
type: "HTTPMethod",
189+
type: "string",
182190
},
183191
noSavingResponseBody: {
184192
baseName: "noSavingResponseBody",

0 commit comments

Comments
 (0)