Skip to content

Commit 48acc50

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit cf974e8 of spec repo (#851)
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 9e8c1d5 commit 48acc50

19 files changed

+397
-53
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.2",
7-
"regenerated": "2022-02-23 09:52:55.522647",
8-
"spec_repo_commit": "c049b6d"
7+
"regenerated": "2022-02-23 10:10:09.155076",
8+
"spec_repo_commit": "cf974e8"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-02-23 09:52:55.533330",
13-
"spec_repo_commit": "c049b6d"
12+
"regenerated": "2022-02-23 10:10:09.166979",
13+
"spec_repo_commit": "cf974e8"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11874,6 +11874,10 @@ components:
1187411874
allow_insecure:
1187511875
description: Allows loading insecure content for an HTTP request.
1187611876
type: boolean
11877+
checkCertificateRevocation:
11878+
description: For SSL test, whether or not the test should fail on revoked
11879+
certificate in stapled OCSP.
11880+
type: boolean
1187711881
device_ids:
1187811882
description: For browser test, array with the different device IDs used
1187911883
to run the test.
@@ -24083,7 +24087,7 @@ paths:
2408324087
x-given:
2408424088
synthetics_api_test:
2408524089
parameters:
24086-
- file: synthetics_api_test_payload.json
24090+
- file: synthetics_api_http_test_payload.json
2408724091
name: body
2408824092
step: there is a valid "synthetics_api_test" in the system
2408924093
synthetics_api_test_with_wrong_dns:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""
2+
Create an API SSL test 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.synthetics_api_test import SyntheticsAPITest
8+
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
9+
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
10+
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
11+
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
12+
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
13+
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
14+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
15+
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
16+
17+
body = SyntheticsAPITest(
18+
config=SyntheticsAPITestConfig(
19+
assertions=[
20+
SyntheticsAssertionTarget(
21+
operator=SyntheticsAssertionOperator("isInMoreThan"),
22+
target=10,
23+
type=SyntheticsAssertionType("certificate"),
24+
)
25+
],
26+
request=SyntheticsTestRequest(host="datadoghq.com", port=443),
27+
),
28+
locations=["aws:us-east-2"],
29+
message="BDD test payload: synthetics_api_ssl_test_payload.json",
30+
name="Example-Create_an_API_SSL_test_returns_OK_Returns_the_created_test_details_response",
31+
options=SyntheticsTestOptions(accept_self_signed=True, check_certificate_revocation=True, tick_every=60),
32+
subtype=SyntheticsTestDetailsSubType("ssl"),
33+
tags=["testing:api"],
34+
type=SyntheticsAPITestType("api"),
35+
)
36+
37+
configuration = Configuration()
38+
with ApiClient(configuration) as api_client:
39+
api_instance = SyntheticsApi(api_client)
40+
response = api_instance.create_synthetics_api_test(body=body)
41+
42+
print(response)
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
"""
2+
Create an API HTTP test 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_test import SyntheticsAPITest
9+
from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig
10+
from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType
11+
from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator
12+
from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget
13+
from datadog_api_client.v1.model.synthetics_assertion_json_path_target_target import (
14+
SyntheticsAssertionJSONPathTargetTarget,
15+
)
16+
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
17+
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
18+
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
19+
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
20+
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
21+
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
22+
from datadog_api_client.v1.model.synthetics_test_headers import SyntheticsTestHeaders
23+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
24+
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
25+
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
26+
from datadog_api_client.v1.model.synthetics_test_request_certificate import SyntheticsTestRequestCertificate
27+
from datadog_api_client.v1.model.synthetics_test_request_certificate_item import SyntheticsTestRequestCertificateItem
28+
from datadog_api_client.v1.model.synthetics_test_request_proxy import SyntheticsTestRequestProxy
29+
30+
body = SyntheticsAPITest(
31+
config=SyntheticsAPITestConfig(
32+
assertions=[
33+
SyntheticsAssertionTarget(
34+
operator=SyntheticsAssertionOperator("is"),
35+
property="{{ PROPERTY }}",
36+
target="text/html",
37+
type=SyntheticsAssertionType("header"),
38+
),
39+
SyntheticsAssertionTarget(
40+
operator=SyntheticsAssertionOperator("lessThan"),
41+
target=2000,
42+
type=SyntheticsAssertionType("responseTime"),
43+
),
44+
SyntheticsAssertionJSONPathTarget(
45+
operator=SyntheticsAssertionJSONPathOperator("validatesJSONPath"),
46+
target=SyntheticsAssertionJSONPathTargetTarget(json_path="topKey", operator="isNot", target_value="0"),
47+
type=SyntheticsAssertionType("body"),
48+
),
49+
],
50+
config_variables=[
51+
SyntheticsConfigVariable(
52+
example="content-type",
53+
name="PROPERTY",
54+
pattern="content-type",
55+
type=SyntheticsConfigVariableType("text"),
56+
)
57+
],
58+
request=SyntheticsTestRequest(
59+
certificate=SyntheticsTestRequestCertificate(
60+
cert=SyntheticsTestRequestCertificateItem(
61+
content="cert-content", filename="cert-filename", updated_at="2020-10-16T09:23:24.857Z"
62+
),
63+
key=SyntheticsTestRequestCertificateItem(
64+
content="key-content", filename="key-filename", updated_at="2020-10-16T09:23:24.857Z"
65+
),
66+
),
67+
headers=SyntheticsTestHeaders(
68+
unique="examplecreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse"
69+
),
70+
method=HTTPMethod("GET"),
71+
timeout=10.0,
72+
url="https://datadoghq.com",
73+
proxy=SyntheticsTestRequestProxy(url="https://datadoghq.com", headers=SyntheticsTestHeaders()),
74+
),
75+
),
76+
locations=["aws:us-east-2"],
77+
message="BDD test payload: synthetics_api_http_test_payload.json",
78+
name="Example-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response",
79+
options=SyntheticsTestOptions(
80+
accept_self_signed=False,
81+
allow_insecure=True,
82+
follow_redirects=True,
83+
min_failure_duration=10,
84+
min_location_failed=1,
85+
monitor_name="Example-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response",
86+
monitor_priority=5,
87+
retry=SyntheticsTestOptionsRetry(count=3, interval=10.0),
88+
tick_every=60,
89+
),
90+
subtype=SyntheticsTestDetailsSubType("http"),
91+
tags=["testing:api"],
92+
type=SyntheticsAPITestType("api"),
93+
)
94+
95+
configuration = Configuration()
96+
with ApiClient(configuration) as api_client:
97+
api_instance = SyntheticsApi(api_client)
98+
response = api_instance.create_synthetics_api_test(body=body)
99+
100+
print(response)

src/datadog_api_client/v1/model/synthetics_test_options.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-02-22T17:12:29.866Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
interactions:
2+
- request:
3+
body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1645549949"},"method":"GET","proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD
4+
test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","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_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}'
5+
headers:
6+
accept:
7+
- application/json
8+
content-type:
9+
- application/json
10+
method: POST
11+
uri: https://api.datadoghq.com/api/v1/synthetics/tests/api
12+
response:
13+
body:
14+
string: '{"status":"live","public_id":"8ju-8gb-uzk","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD
15+
test payload: synthetics_api_http_test_payload.json","deleted_at":null,"name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","monitor_id":64654479,"type":"api","created_at":"2022-02-22T17:12:30.659455+00:00","modified_at":"2022-02-22T17:12:30.659455+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testcreateanapihttptestreturnsokreturnsthecreatedtestdetailsresponse1645549949"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{
16+
PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"monitor_priority":5,"monitor_name":"Test-Create_an_API_HTTP_test_returns_OK_Returns_the_created_test_details_response-1645549949","tick_every":60}}'
17+
headers:
18+
content-type:
19+
- application/json
20+
status:
21+
code: 200
22+
message: OK
23+
- request:
24+
body: '{"public_ids":["8ju-8gb-uzk"]}'
25+
headers:
26+
accept:
27+
- application/json
28+
content-type:
29+
- application/json
30+
method: POST
31+
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
32+
response:
33+
body:
34+
string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:12:31.194196+00:00","public_id":"8ju-8gb-uzk"}]}'
35+
headers:
36+
content-type:
37+
- application/json
38+
status:
39+
code: 200
40+
message: OK
41+
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-02-22T17:20:11.629Z
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
interactions:
2+
- request:
3+
body: '{"config":{"assertions":[{"operator":"isInMoreThan","target":10,"type":"certificate"}],"request":{"host":"datadoghq.com","port":443}},"locations":["aws:us-east-2"],"message":"BDD
4+
test payload: synthetics_api_ssl_test_payload.json","name":"Test-Create_an_API_SSL_test_returns_OK_Returns_the_created_test_details_response-1645550411","options":{"accept_self_signed":true,"checkCertificateRevocation":true,"tick_every":60},"subtype":"ssl","tags":["testing:api"],"type":"api"}'
5+
headers:
6+
accept:
7+
- application/json
8+
content-type:
9+
- application/json
10+
method: POST
11+
uri: https://api.datadoghq.com/api/v1/synthetics/tests/api
12+
response:
13+
body:
14+
string: '{"status":"live","public_id":"t4n-wba-ghj","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD
15+
test payload: synthetics_api_ssl_test_payload.json","deleted_at":null,"name":"Test-Create_an_API_SSL_test_returns_OK_Returns_the_created_test_details_response-1645550411","monitor_id":64655318,"type":"api","created_at":"2022-02-22T17:20:12.060843+00:00","modified_at":"2022-02-22T17:20:12.060843+00:00","subtype":"ssl","config":{"request":{"host":"datadoghq.com","port":443},"assertions":[{"operator":"isInMoreThan","type":"certificate","target":10}]},"options":{"accept_self_signed":true,"checkCertificateRevocation":true,"tick_every":60}}'
16+
headers:
17+
content-type:
18+
- application/json
19+
status:
20+
code: 200
21+
message: OK
22+
- request:
23+
body: '{"public_ids":["t4n-wba-ghj"]}'
24+
headers:
25+
accept:
26+
- application/json
27+
content-type:
28+
- application/json
29+
method: POST
30+
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
31+
response:
32+
body:
33+
string: '{"deleted_tests":[{"deleted_at":"2022-02-22T17:20:12.356340+00:00","public_id":"t4n-wba-ghj"}]}'
34+
headers:
35+
content-type:
36+
- application/json
37+
status:
38+
code: 200
39+
message: OK
40+
version: 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-02-10T12:24:16.771Z
1+
2022-02-22T17:12:31.674Z

0 commit comments

Comments
 (0)