Skip to content

Commit 9fc48e8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add option for wait step in multistep api tests (#159)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent b5635ae commit 9fc48e8

16 files changed

+583
-322
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.6",
7-
"regenerated": "2024-06-27 21:40:26.008823",
8-
"spec_repo_commit": "4ed44e4c"
7+
"regenerated": "2024-07-01 12:39:43.463031",
8+
"spec_repo_commit": "f54c0bf3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-27 21:40:26.026385",
13-
"spec_repo_commit": "4ed44e4c"
12+
"regenerated": "2024-07-01 12:39:43.480910",
13+
"spec_repo_commit": "f54c0bf3"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 88 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -13366,60 +13366,11 @@ components:
1336613366
$ref: '#/components/schemas/WidgetStyle'
1336713367
type: object
1336813368
SyntheticsAPIStep:
13369-
description: The steps used in a Synthetic multistep API test.
13370-
properties:
13371-
allowFailure:
13372-
description: Determines whether or not to continue with test if this step
13373-
fails.
13374-
type: boolean
13375-
assertions:
13376-
default: []
13377-
description: Array of assertions used for the test.
13378-
example:
13379-
- operator: lessThan
13380-
target: 1000
13381-
type: responseTime
13382-
items:
13383-
$ref: '#/components/schemas/SyntheticsAssertion'
13384-
type: array
13385-
extractedValues:
13386-
description: Array of values to parse and save as variables from the response.
13387-
items:
13388-
$ref: '#/components/schemas/SyntheticsParsingOptions'
13389-
type: array
13390-
isCritical:
13391-
description: 'Determines whether or not to consider the entire test as failed
13392-
if this step fails.
13393-
13394-
Can be used only if `allowFailure` is `true`.'
13395-
type: boolean
13396-
name:
13397-
description: The name of the step.
13398-
example: Example step name
13399-
type: string
13400-
request:
13401-
$ref: '#/components/schemas/SyntheticsTestRequest'
13402-
retry:
13403-
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
13404-
subtype:
13405-
$ref: '#/components/schemas/SyntheticsAPIStepSubtype'
13406-
required:
13407-
- assertions
13408-
- request
13409-
- name
13410-
- subtype
13369+
description: The steps used in a Synthetic multi-step API test.
13370+
oneOf:
13371+
- $ref: '#/components/schemas/SyntheticsAPITestStep'
13372+
- $ref: '#/components/schemas/SyntheticsAPIWaitStep'
1341113373
type: object
13412-
SyntheticsAPIStepSubtype:
13413-
description: The subtype of the Synthetic multistep API test step, currently
13414-
only supporting `http`.
13415-
enum:
13416-
- http
13417-
- grpc
13418-
example: http
13419-
type: string
13420-
x-enum-varnames:
13421-
- HTTP
13422-
- GRPC
1342313374
SyntheticsAPITest:
1342413375
description: Object containing details about a Synthetic API test.
1342513376
properties:
@@ -13608,6 +13559,60 @@ components:
1360813559
timings:
1360913560
$ref: '#/components/schemas/SyntheticsTiming'
1361013561
type: object
13562+
SyntheticsAPITestStep:
13563+
description: The Test step used in a Synthetic multi-step API test.
13564+
properties:
13565+
allowFailure:
13566+
description: Determines whether or not to continue with test if this step
13567+
fails.
13568+
type: boolean
13569+
assertions:
13570+
default: []
13571+
description: Array of assertions used for the test.
13572+
example:
13573+
- operator: lessThan
13574+
target: 1000
13575+
type: responseTime
13576+
items:
13577+
$ref: '#/components/schemas/SyntheticsAssertion'
13578+
type: array
13579+
extractedValues:
13580+
description: Array of values to parse and save as variables from the response.
13581+
items:
13582+
$ref: '#/components/schemas/SyntheticsParsingOptions'
13583+
type: array
13584+
isCritical:
13585+
description: 'Determines whether or not to consider the entire test as failed
13586+
if this step fails.
13587+
13588+
Can be used only if `allowFailure` is `true`.'
13589+
type: boolean
13590+
name:
13591+
description: The name of the step.
13592+
example: Example step name
13593+
type: string
13594+
request:
13595+
$ref: '#/components/schemas/SyntheticsTestRequest'
13596+
retry:
13597+
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
13598+
subtype:
13599+
$ref: '#/components/schemas/SyntheticsAPITestStepSubtype'
13600+
required:
13601+
- assertions
13602+
- request
13603+
- name
13604+
- subtype
13605+
type: object
13606+
SyntheticsAPITestStepSubtype:
13607+
description: The subtype of the Synthetic multi-step API test step.
13608+
enum:
13609+
- http
13610+
- grpc
13611+
example: http
13612+
type: string
13613+
x-enum-varnames:
13614+
- HTTP
13615+
- GRPC
1361113616
SyntheticsAPITestType:
1361213617
default: api
1361313618
description: Type of the Synthetic test, `api`.
@@ -13617,6 +13622,36 @@ components:
1361713622
type: string
1361813623
x-enum-varnames:
1361913624
- API
13625+
SyntheticsAPIWaitStep:
13626+
description: The Wait step used in a Synthetic multi-step API test.
13627+
properties:
13628+
name:
13629+
description: The name of the step.
13630+
example: Example step name
13631+
type: string
13632+
subtype:
13633+
$ref: '#/components/schemas/SyntheticsAPIWaitStepSubtype'
13634+
value:
13635+
description: 'The time to wait in seconds. Minimum value: 0. Maximum value:
13636+
180.'
13637+
example: 5
13638+
format: int32
13639+
maximum: 180
13640+
minimum: 0
13641+
type: integer
13642+
required:
13643+
- name
13644+
- subtype
13645+
- value
13646+
type: object
13647+
SyntheticsAPIWaitStepSubtype:
13648+
description: The subtype of the Synthetic multi-step API wait step.
13649+
enum:
13650+
- wait
13651+
example: wait
13652+
type: string
13653+
x-enum-varnames:
13654+
- WAIT
1362013655
SyntheticsApiTestFailureCode:
1362113656
description: Error code that can be returned by a Synthetic test.
1362213657
enum:

examples/v1_synthetics_create_synthetics_api_test_1279271422.rs

Lines changed: 80 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
use datadog_api_client::datadog;
44
use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
55
use datadog_api_client::datadogV1::model::SyntheticsAPIStep;
6-
use datadog_api_client::datadogV1::model::SyntheticsAPIStepSubtype;
76
use datadog_api_client::datadogV1::model::SyntheticsAPITest;
87
use datadog_api_client::datadogV1::model::SyntheticsAPITestConfig;
8+
use datadog_api_client::datadogV1::model::SyntheticsAPITestStep;
9+
use datadog_api_client::datadogV1::model::SyntheticsAPITestStepSubtype;
910
use datadog_api_client::datadogV1::model::SyntheticsAPITestType;
11+
use datadog_api_client::datadogV1::model::SyntheticsAPIWaitStep;
12+
use datadog_api_client::datadogV1::model::SyntheticsAPIWaitStepSubtype;
1013
use datadog_api_client::datadogV1::model::SyntheticsAssertion;
1114
use datadog_api_client::datadogV1::model::SyntheticsAssertionOperator;
1215
use datadog_api_client::datadogV1::model::SyntheticsAssertionTarget;
@@ -40,71 +43,86 @@ async fn main() {
4043
)
4144
.steps(
4245
vec![
43-
SyntheticsAPIStep::new(
44-
vec![
45-
SyntheticsAssertion::SyntheticsAssertionTarget(
46-
Box::new(
47-
SyntheticsAssertionTarget::new(
48-
SyntheticsAssertionOperator::IS,
49-
Value::from(200),
50-
SyntheticsAssertionType::STATUS_CODE,
51-
),
52-
),
53-
)
54-
],
55-
"request is sent".to_string(),
56-
SyntheticsTestRequest::new()
57-
.http_version(SyntheticsTestOptionsHTTPVersion::HTTP2)
58-
.method("GET".to_string())
59-
.timeout(10.0 as f64)
60-
.url("https://datadoghq.com".to_string()),
61-
SyntheticsAPIStepSubtype::HTTP,
62-
)
63-
.allow_failure(true)
64-
.extracted_values(
65-
vec![
66-
SyntheticsParsingOptions::new()
67-
.field("server".to_string())
68-
.name("EXTRACTED_VALUE".to_string())
69-
.parser(
70-
SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::RAW),
46+
SyntheticsAPIStep::SyntheticsAPITestStep(
47+
Box::new(
48+
SyntheticsAPITestStep::new(
49+
vec![
50+
SyntheticsAssertion::SyntheticsAssertionTarget(
51+
Box::new(
52+
SyntheticsAssertionTarget::new(
53+
SyntheticsAssertionOperator::IS,
54+
Value::from(200),
55+
SyntheticsAssertionType::STATUS_CODE,
56+
),
57+
),
7158
)
72-
.secure(true)
73-
.type_(SyntheticsGlobalVariableParseTestOptionsType::HTTP_HEADER)
74-
],
75-
)
76-
.is_critical(true)
77-
.retry(SyntheticsTestOptionsRetry::new().count(5).interval(1000.0 as f64)),
78-
SyntheticsAPIStep::new(
79-
vec![
80-
SyntheticsAssertion::SyntheticsAssertionTarget(
81-
Box::new(
82-
SyntheticsAssertionTarget::new(
83-
SyntheticsAssertionOperator::LESS_THAN,
84-
Value::from(1000),
85-
SyntheticsAssertionType::RESPONSE_TIME,
86-
),
87-
),
59+
],
60+
"request is sent".to_string(),
61+
SyntheticsTestRequest::new()
62+
.http_version(SyntheticsTestOptionsHTTPVersion::HTTP2)
63+
.method("GET".to_string())
64+
.timeout(10.0 as f64)
65+
.url("https://datadoghq.com".to_string()),
66+
SyntheticsAPITestStepSubtype::HTTP,
8867
)
89-
],
90-
"GRPC CALL".to_string(),
91-
SyntheticsTestRequest::new()
92-
.call_type(SyntheticsTestCallType::UNARY)
93-
.compressed_json_descriptor(
94-
"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==".to_string(),
68+
.allow_failure(true)
69+
.extracted_values(
70+
vec![
71+
SyntheticsParsingOptions::new()
72+
.field("server".to_string())
73+
.name("EXTRACTED_VALUE".to_string())
74+
.parser(
75+
SyntheticsVariableParser::new(
76+
SyntheticsGlobalVariableParserType::RAW,
77+
),
78+
)
79+
.secure(true)
80+
.type_(SyntheticsGlobalVariableParseTestOptionsType::HTTP_HEADER)
81+
],
82+
)
83+
.is_critical(true)
84+
.retry(SyntheticsTestOptionsRetry::new().count(5).interval(1000.0 as f64)),
85+
),
86+
),
87+
SyntheticsAPIStep::SyntheticsAPIWaitStep(
88+
Box::new(
89+
SyntheticsAPIWaitStep::new("Wait".to_string(), SyntheticsAPIWaitStepSubtype::WAIT, 1),
90+
),
91+
),
92+
SyntheticsAPIStep::SyntheticsAPITestStep(
93+
Box::new(
94+
SyntheticsAPITestStep::new(
95+
vec![
96+
SyntheticsAssertion::SyntheticsAssertionTarget(
97+
Box::new(
98+
SyntheticsAssertionTarget::new(
99+
SyntheticsAssertionOperator::LESS_THAN,
100+
Value::from(1000),
101+
SyntheticsAssertionType::RESPONSE_TIME,
102+
),
103+
),
104+
)
105+
],
106+
"GRPC CALL".to_string(),
107+
SyntheticsTestRequest::new()
108+
.call_type(SyntheticsTestCallType::UNARY)
109+
.compressed_json_descriptor(
110+
"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==".to_string(),
111+
)
112+
.host("grpcbin.test.k6.io".to_string())
113+
.message("{}".to_string())
114+
.metadata(BTreeMap::from([]))
115+
.method("Index".to_string())
116+
.port(9000)
117+
.service("grpcbin.GRPCBin".to_string()),
118+
SyntheticsAPITestStepSubtype::GRPC,
95119
)
96-
.host("grpcbin.test.k6.io".to_string())
97-
.message("{}".to_string())
98-
.metadata(BTreeMap::from([]))
99-
.method("Index".to_string())
100-
.port(9000)
101-
.service("grpcbin.GRPCBin".to_string()),
102-
SyntheticsAPIStepSubtype::GRPC,
120+
.allow_failure(false)
121+
.extracted_values(vec![])
122+
.is_critical(true)
123+
.retry(SyntheticsTestOptionsRetry::new().count(0).interval(300.0 as f64)),
124+
),
103125
)
104-
.allow_failure(false)
105-
.extracted_values(vec![])
106-
.is_critical(true)
107-
.retry(SyntheticsTestOptionsRetry::new().count(0).interval(300.0 as f64))
108126
],
109127
),
110128
vec!["aws:us-east-2".to_string()],

src/datadogV1/model/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,8 @@ pub mod model_synthetics_api_test;
13841384
pub use self::model_synthetics_api_test::SyntheticsAPITest;
13851385
pub mod model_synthetics_api_test_config;
13861386
pub use self::model_synthetics_api_test_config::SyntheticsAPITestConfig;
1387-
pub mod model_synthetics_api_step;
1388-
pub use self::model_synthetics_api_step::SyntheticsAPIStep;
1387+
pub mod model_synthetics_api_test_step;
1388+
pub use self::model_synthetics_api_test_step::SyntheticsAPITestStep;
13891389
pub mod model_synthetics_parsing_options;
13901390
pub use self::model_synthetics_parsing_options::SyntheticsParsingOptions;
13911391
pub mod model_synthetics_variable_parser;
@@ -1394,8 +1394,14 @@ pub mod model_synthetics_global_variable_parser_type;
13941394
pub use self::model_synthetics_global_variable_parser_type::SyntheticsGlobalVariableParserType;
13951395
pub mod model_synthetics_global_variable_parse_test_options_type;
13961396
pub use self::model_synthetics_global_variable_parse_test_options_type::SyntheticsGlobalVariableParseTestOptionsType;
1397-
pub mod model_synthetics_api_step_subtype;
1398-
pub use self::model_synthetics_api_step_subtype::SyntheticsAPIStepSubtype;
1397+
pub mod model_synthetics_api_test_step_subtype;
1398+
pub use self::model_synthetics_api_test_step_subtype::SyntheticsAPITestStepSubtype;
1399+
pub mod model_synthetics_api_wait_step;
1400+
pub use self::model_synthetics_api_wait_step::SyntheticsAPIWaitStep;
1401+
pub mod model_synthetics_api_wait_step_subtype;
1402+
pub use self::model_synthetics_api_wait_step_subtype::SyntheticsAPIWaitStepSubtype;
1403+
pub mod model_synthetics_api_step;
1404+
pub use self::model_synthetics_api_step::SyntheticsAPIStep;
13991405
pub mod model_synthetics_api_test_type;
14001406
pub use self::model_synthetics_api_test_type::SyntheticsAPITestType;
14011407
pub mod model_synthetics_browser_test;

0 commit comments

Comments
 (0)