Skip to content

Commit 30e120b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-specteodor2312
authored
Add option for wait step in multistep api tests (#2019)
* Regenerate client from commit 314e6caf of spec repo * Fix test for UnparsedObjects * Regenerate client from commit e68bae89 of spec repo * Regenerate client from commit fd7a64d8 of spec repo * pre-commit fixes * Regenerate client from commit f54c0bf3 of spec repo * Regenerate client from commit f54c0bf3 of spec repo --------- 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> Co-authored-by: Teodor Todorov <[email protected]>
1 parent 0713425 commit 30e120b

19 files changed

+417
-189
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:27.727114",
8-
"spec_repo_commit": "4ed44e4c"
7+
"regenerated": "2024-07-01 12:39:38.550505",
8+
"spec_repo_commit": "f54c0bf3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-06-27 21:40:27.743937",
13-
"spec_repo_commit": "4ed44e4c"
12+
"regenerated": "2024-07-01 12:39:38.567199",
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:

docs/datadog_api_client.v1.model.rst

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3774,13 +3774,6 @@ synthetics\_api\_step
37743774
:members:
37753775
:show-inheritance:
37763776

3777-
synthetics\_api\_step\_subtype
3778-
------------------------------
3779-
3780-
.. automodule:: datadog_api_client.v1.model.synthetics_api_step_subtype
3781-
:members:
3782-
:show-inheritance:
3783-
37843777
synthetics\_api\_test
37853778
---------------------
37863779

@@ -3844,13 +3837,41 @@ synthetics\_api\_test\_result\_short\_result
38443837
:members:
38453838
:show-inheritance:
38463839

3840+
synthetics\_api\_test\_step
3841+
---------------------------
3842+
3843+
.. automodule:: datadog_api_client.v1.model.synthetics_api_test_step
3844+
:members:
3845+
:show-inheritance:
3846+
3847+
synthetics\_api\_test\_step\_subtype
3848+
------------------------------------
3849+
3850+
.. automodule:: datadog_api_client.v1.model.synthetics_api_test_step_subtype
3851+
:members:
3852+
:show-inheritance:
3853+
38473854
synthetics\_api\_test\_type
38483855
---------------------------
38493856

38503857
.. automodule:: datadog_api_client.v1.model.synthetics_api_test_type
38513858
:members:
38523859
:show-inheritance:
38533860

3861+
synthetics\_api\_wait\_step
3862+
---------------------------
3863+
3864+
.. automodule:: datadog_api_client.v1.model.synthetics_api_wait_step
3865+
:members:
3866+
:show-inheritance:
3867+
3868+
synthetics\_api\_wait\_step\_subtype
3869+
------------------------------------
3870+
3871+
.. automodule:: datadog_api_client.v1.model.synthetics_api_wait_step_subtype
3872+
:members:
3873+
:show-inheritance:
3874+
38543875
synthetics\_assertion
38553876
---------------------
38563877

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
7-
from datadog_api_client.v1.model.synthetics_api_step import SyntheticsAPIStep
8-
from datadog_api_client.v1.model.synthetics_api_step_subtype import SyntheticsAPIStepSubtype
97
from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest
108
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
9+
from datadog_api_client.v1.model.synthetics_api_test_step import SyntheticsAPITestStep
10+
from datadog_api_client.v1.model.synthetics_api_test_step_subtype import SyntheticsAPITestStepSubtype
1111
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
12+
from datadog_api_client.v1.model.synthetics_api_wait_step import SyntheticsAPIWaitStep
13+
from datadog_api_client.v1.model.synthetics_api_wait_step_subtype import SyntheticsAPIWaitStepSubtype
1214
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
1315
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
1416
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
@@ -39,7 +41,7 @@
3941
),
4042
],
4143
steps=[
42-
SyntheticsAPIStep(
44+
SyntheticsAPITestStep(
4345
allow_failure=True,
4446
assertions=[
4547
SyntheticsAssertionTarget(
@@ -71,11 +73,16 @@
7173
count=5,
7274
interval=1000.0,
7375
),
74-
subtype=SyntheticsAPIStepSubtype.HTTP,
76+
subtype=SyntheticsAPITestStepSubtype.HTTP,
7577
),
76-
SyntheticsAPIStep(
78+
SyntheticsAPIWaitStep(
79+
name="Wait",
80+
subtype=SyntheticsAPIWaitStepSubtype.WAIT,
81+
value=1,
82+
),
83+
SyntheticsAPITestStep(
7784
name="GRPC CALL",
78-
subtype=SyntheticsAPIStepSubtype.GRPC,
85+
subtype=SyntheticsAPITestStepSubtype.GRPC,
7986
extracted_values=[],
8087
allow_failure=False,
8188
is_critical=True,

0 commit comments

Comments
 (0)