Skip to content

Commit e3d82f6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 184be3f of spec repo (#758)
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 90757f4 commit e3d82f6

10 files changed

+210
-13
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.5.1.dev2",
7-
"regenerated": "2022-01-04 09:34:44.960960",
8-
"spec_repo_commit": "6946869"
7+
"regenerated": "2022-01-04 09:53:01.523740",
8+
"spec_repo_commit": "184be3f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-04 09:34:45.416067",
13-
"spec_repo_commit": "6946869"
12+
"regenerated": "2022-01-04 09:53:02.027480",
13+
"spec_repo_commit": "184be3f"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9465,6 +9465,8 @@ components:
94659465
type: string
94669466
request:
94679467
$ref: '#/components/schemas/SyntheticsTestRequest'
9468+
retry:
9469+
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
94689470
subtype:
94699471
$ref: '#/components/schemas/SyntheticsAPIStepSubtype'
94709472
type: object

docs/v1/SyntheticsAPIStep.md

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v1/SyntheticsApi.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
"""
2+
Create an API test with multi subtype returns "OK - Returns the created test details." response
3+
"""
4+
5+
from datadog_api_client.v1 import ApiClient, Configuration
6+
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
7+
from datadog_api_client.v1.model.http_method import HTTPMethod
8+
from datadog_api_client.v1.model.synthetics_api_step import SyntheticsAPIStep
9+
from datadog_api_client.v1.model.synthetics_api_step_subtype import SyntheticsAPIStepSubtype
10+
from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest
11+
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
12+
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
13+
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
14+
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
15+
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
16+
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
17+
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
18+
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
19+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
20+
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
21+
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
22+
23+
body = SyntheticsAPITest(
24+
config=SyntheticsAPITestConfig(
25+
config_variables=[
26+
SyntheticsConfigVariable(
27+
example="content-type",
28+
name="PROPERTY",
29+
pattern="content-type",
30+
type=SyntheticsConfigVariableType("text"),
31+
)
32+
],
33+
steps=[
34+
SyntheticsAPIStep(
35+
allow_failure=True,
36+
assertions=[
37+
SyntheticsAssertionTarget(
38+
operator=SyntheticsAssertionOperator("is"),
39+
type=SyntheticsAssertionType("statusCode"),
40+
target=200,
41+
)
42+
],
43+
is_critical=True,
44+
name="request is sent",
45+
request=SyntheticsTestRequest(method=HTTPMethod("GET"), timeout=10.0, url="https://datadoghq.com"),
46+
retry=SyntheticsTestOptionsRetry(count=5, interval=1000.0),
47+
subtype=SyntheticsAPIStepSubtype("http"),
48+
)
49+
],
50+
),
51+
locations=["aws:us-east-2"],
52+
message="BDD test payload: synthetics_api_test_multi_step_payload.json",
53+
name="Example-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response",
54+
options=SyntheticsTestOptions(
55+
accept_self_signed=False,
56+
allow_insecure=True,
57+
follow_redirects=True,
58+
min_failure_duration=10,
59+
min_location_failed=1,
60+
monitor_name="Example-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response",
61+
monitor_priority=5,
62+
retry=SyntheticsTestOptionsRetry(count=3, interval=1000.0),
63+
tick_every=60,
64+
),
65+
subtype=SyntheticsTestDetailsSubType("multi"),
66+
tags=["testing:api"],
67+
type=SyntheticsAPITestType("api"),
68+
)
69+
70+
configuration = Configuration()
71+
with ApiClient(configuration) as api_client:
72+
api_instance = SyntheticsApi(api_client)
73+
response = api_instance.create_synthetics_api_test(body=body)
74+
75+
print(response)

src/datadog_api_client/v1/model/synthetics_api_step.py

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-01-03T17:01:27.947Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
interactions:
2+
- request:
3+
body: '{"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"isCritical":true,"name":"request
4+
is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"}]},"locations":["aws:us-east-2"],"message":"BDD
5+
test payload: synthetics_api_test_multi_step_payload.json","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1641229287","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1641229287","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"}'
6+
headers:
7+
accept:
8+
- application/json
9+
content-type:
10+
- application/json
11+
method: POST
12+
uri: https://api.datadoghq.com/api/v1/synthetics/tests/api
13+
response:
14+
body:
15+
string: '{"status":"live","public_id":"u62-zu8-cmw","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD
16+
test payload: synthetics_api_test_multi_step_payload.json","deleted_at":null,"name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1641229287","monitor_id":59201884,"type":"api","created_at":"2022-01-03T17:01:28.731353+00:00","modified_at":"2022-01-03T17:01:28.731353+00:00","subtype":"multi","config":{"steps":[{"retry":{"count":5,"interval":1000},"name":"request
17+
is sent","request":{"url":"https://datadoghq.com","method":"GET","timeout":10},"subtype":"http","allowFailure":true,"assertions":[{"operator":"is","type":"statusCode","target":200}],"isCritical":true,"id":"ard-2gj-3s8"}],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":1000},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"monitor_priority":5,"monitor_name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1641229287","tick_every":60}}'
18+
headers:
19+
content-type:
20+
- application/json
21+
status:
22+
code: 200
23+
message: OK
24+
- request:
25+
body: '{"public_ids":["u62-zu8-cmw"]}'
26+
headers:
27+
accept:
28+
- application/json
29+
content-type:
30+
- application/json
31+
method: POST
32+
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
33+
response:
34+
body:
35+
string: '{"deleted_tests":[{"deleted_at":"2022-01-03T17:01:29.223304+00:00","public_id":"u62-zu8-cmw"}]}'
36+
headers:
37+
content-type:
38+
- application/json
39+
status:
40+
code: 200
41+
message: OK
42+
version: 1

tests/v1/features/synthetics.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ Feature: Synthetics
126126
Then the response status is 200 OK - Returns the created test details.
127127
And the response "name" is equal to "{{ unique }}"
128128

129+
@team:DataDog/synthetics-app
130+
Scenario: Create an API test with multi subtype returns "OK - Returns the created test details." response
131+
Given new "CreateSyntheticsAPITest" request
132+
And body from file "synthetics_api_test_multi_step_payload.json"
133+
When the request is sent
134+
Then the response status is 200 OK - Returns the created test details.
135+
And the response "name" is equal to "{{ unique }}"
136+
And the response "config.steps[0].retry.count" is equal to 5
137+
And the response "config.steps[0].retry.interval" is equal to 1000
138+
129139
@generated @skip @team:DataDog/synthetics-app
130140
Scenario: Delete a global variable returns "JSON format is wrong" response
131141
Given new "DeleteGlobalVariable" request
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"config": {
3+
"configVariables": [
4+
{
5+
"example": "content-type",
6+
"name": "PROPERTY",
7+
"pattern": "content-type",
8+
"type": "text"
9+
}
10+
],
11+
"steps": [
12+
{
13+
"allowFailure": true,
14+
"assertions": [
15+
{
16+
"operator": "is",
17+
"type": "statusCode",
18+
"target": 200
19+
}
20+
],
21+
"isCritical": true,
22+
"name": "request is sent",
23+
"request": {
24+
"method": "GET",
25+
"timeout": 10,
26+
"url": "https://datadoghq.com"
27+
},
28+
"retry": {
29+
"count": 5,
30+
"interval": 1000
31+
},
32+
"subtype": "http"
33+
}
34+
]
35+
},
36+
"locations": ["aws:us-east-2"],
37+
"message": "BDD test payload: synthetics_api_test_multi_step_payload.json",
38+
"name": "{{ unique }}",
39+
"options": {
40+
"accept_self_signed": false,
41+
"allow_insecure": true,
42+
"follow_redirects": true,
43+
"min_failure_duration": 10,
44+
"min_location_failed": 1,
45+
"monitor_name": "{{ unique }}",
46+
"monitor_priority": 5,
47+
"retry": { "count": 3, "interval": 1000 },
48+
"tick_every": 60
49+
},
50+
"subtype": "multi",
51+
"tags": ["testing:api"],
52+
"type": "api"
53+
}

0 commit comments

Comments
 (0)