Skip to content

Commit 7fa2ff2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 1d2b67d9 of spec repo (#1100)
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 d8ab5d3 commit 7fa2ff2

File tree

36 files changed

+310
-105
lines changed

36 files changed

+310
-105
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-08-30 12:29:08.851250",
8-
"spec_repo_commit": "47f45603"
7+
"regenerated": "2022-08-30 13:34:34.295369",
8+
"spec_repo_commit": "1d2b67d9"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-08-30 12:29:08.863371",
13-
"spec_repo_commit": "47f45603"
12+
"regenerated": "2022-08-30 13:34:34.310816",
13+
"spec_repo_commit": "1d2b67d9"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11898,25 +11898,31 @@ components:
1189811898
the value.
1189911899
example: content-type
1190011900
type: string
11901+
localVariableName:
11902+
description: When type is `local_variable`, name of the local variable to
11903+
use to extract the value.
11904+
example: LOCAL_VARIABLE
11905+
type: string
1190111906
parser:
1190211907
$ref: '#/components/schemas/SyntheticsVariableParser'
1190311908
type:
1190411909
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType'
1190511910
required:
1190611911
- type
11907-
- parser
1190811912
type: object
1190911913
SyntheticsGlobalVariableParseTestOptionsType:
1191011914
description: Property of the Synthetics Test Response to use for a Synthetics
1191111915
global variable.
1191211916
enum:
1191311917
- http_body
1191411918
- http_header
11919+
- local_variable
1191511920
example: http_body
1191611921
type: string
1191711922
x-enum-varnames:
1191811923
- HTTP_BODY
1191911924
- HTTP_HEADER
11925+
- LOCAL_VARIABLE
1192011926
SyntheticsGlobalVariableParserType:
1192111927
description: Type of parser for a Synthetics global variable from a synthetics
1192211928
test.

examples/v1/synthetics/CreateGlobalVariable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
name="MY_VARIABLE",
3030
parse_test_options=SyntheticsGlobalVariableParseTestOptions(
3131
field="content-type",
32+
local_variable_name="LOCAL_VARIABLE",
3233
parser=SyntheticsVariableParser(
3334
type=SyntheticsGlobalVariableParserType("regex"),
3435
value=".*",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
Create a global variable from test returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
8+
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable
9+
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options import (
10+
SyntheticsGlobalVariableParseTestOptions,
11+
)
12+
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options_type import (
13+
SyntheticsGlobalVariableParseTestOptionsType,
14+
)
15+
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue
16+
17+
# there is a valid "synthetics_api_test_multi_step" in the system
18+
SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID = environ["SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID"]
19+
20+
body = SyntheticsGlobalVariable(
21+
description="",
22+
name="GLOBAL_VARIABLE_PAYLOAD",
23+
tags=[],
24+
value=SyntheticsGlobalVariableValue(
25+
secure=False,
26+
value="",
27+
),
28+
parse_test_public_id=SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID,
29+
parse_test_options=SyntheticsGlobalVariableParseTestOptions(
30+
type=SyntheticsGlobalVariableParseTestOptionsType("local_variable"),
31+
local_variable_name="EXTRACTED_VALUE",
32+
),
33+
)
34+
35+
configuration = Configuration()
36+
with ApiClient(configuration) as api_client:
37+
api_instance = SyntheticsApi(api_client)
38+
response = api_instance.create_global_variable(body=body)
39+
40+
print(response)

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
1616
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
1717
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
18+
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options_type import (
19+
SyntheticsGlobalVariableParseTestOptionsType,
20+
)
21+
from datadog_api_client.v1.model.synthetics_global_variable_parser_type import SyntheticsGlobalVariableParserType
22+
from datadog_api_client.v1.model.synthetics_parsing_options import SyntheticsParsingOptions
1823
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
1924
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
2025
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
2126
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
27+
from datadog_api_client.v1.model.synthetics_variable_parser import SyntheticsVariableParser
2228

2329
body = SyntheticsAPITest(
2430
config=SyntheticsAPITestConfig(
@@ -40,6 +46,16 @@
4046
target=200,
4147
),
4248
],
49+
extracted_values=[
50+
SyntheticsParsingOptions(
51+
field="server",
52+
name="EXTRACTED_VALUE",
53+
parser=SyntheticsVariableParser(
54+
type=SyntheticsGlobalVariableParserType("raw"),
55+
),
56+
type=SyntheticsGlobalVariableParseTestOptionsType("http_header"),
57+
),
58+
],
4359
is_critical=True,
4460
name="request is sent",
4561
request=SyntheticsTestRequest(

examples/v1/synthetics/EditGlobalVariable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
name="MY_VARIABLE",
3030
parse_test_options=SyntheticsGlobalVariableParseTestOptions(
3131
field="content-type",
32+
local_variable_name="LOCAL_VARIABLE",
3233
parser=SyntheticsVariableParser(
3334
type=SyntheticsGlobalVariableParserType("regex"),
3435
value=".*",

src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,30 @@ def openapi_types(_):
1919

2020
return {
2121
"field": (str,),
22+
"local_variable_name": (str,),
2223
"parser": (SyntheticsVariableParser,),
2324
"type": (SyntheticsGlobalVariableParseTestOptionsType,),
2425
}
2526

2627
attribute_map = {
2728
"field": "field",
29+
"local_variable_name": "localVariableName",
2830
"parser": "parser",
2931
"type": "type",
3032
}
3133

32-
def __init__(self, parser, type, *args, **kwargs):
34+
def __init__(self, type, *args, **kwargs):
3335
"""
3436
Parser options to use for retrieving a Synthetics global variable from a Synthetics Test. Used in conjunction with ``parse_test_public_id``.
3537
3638
:param field: When type is ``http_header`` , name of the header to use to extract the value.
3739
:type field: str, optional
3840
41+
:param local_variable_name: When type is ``local_variable`` , name of the local variable to use to extract the value.
42+
:type local_variable_name: str, optional
43+
3944
:param parser: Details of the parser to use for the global variable.
40-
:type parser: SyntheticsVariableParser
45+
:type parser: SyntheticsVariableParser, optional
4146
4247
:param type: Property of the Synthetics Test Response to use for a Synthetics global variable.
4348
:type type: SyntheticsGlobalVariableParseTestOptionsType
@@ -46,17 +51,15 @@ def __init__(self, parser, type, *args, **kwargs):
4651

4752
self._check_pos_args(args)
4853

49-
self.parser = parser
5054
self.type = type
5155

5256
@classmethod
53-
def _from_openapi_data(cls, parser, type, *args, **kwargs):
57+
def _from_openapi_data(cls, type, *args, **kwargs):
5458
"""Helper creating a new instance from a response."""
5559

5660
self = super(SyntheticsGlobalVariableParseTestOptions, cls)._from_openapi_data(kwargs)
5761

5862
self._check_pos_args(args)
5963

60-
self.parser = parser
6164
self.type = type
6265
return self

src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options_type.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ class SyntheticsGlobalVariableParseTestOptionsType(ModelSimple):
1313
"""
1414
Property of the Synthetics Test Response to use for a Synthetics global variable.
1515
16-
:param value: Must be one of ["http_body", "http_header"].
16+
:param value: Must be one of ["http_body", "http_header", "local_variable"].
1717
:type value: str
1818
"""
1919

2020
allowed_values = {
2121
"value": {
2222
"HTTP_BODY": "http_body",
2323
"HTTP_HEADER": "http_header",
24+
"LOCAL_VARIABLE": "local_variable",
2425
},
2526
}
2627

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-08-18T09:19:30.220Z
1+
2022-08-30T12:58:36.103Z

tests/v1/cassettes/test_scenarios/test_create_a_browser_test_returns_ok_returns_saved_rumsettings_response.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"locations":["aws:us-east-2"],"message":"Test
4-
message","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1660814370","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":3,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh
4+
message","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1661864316","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":3,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh
55
page","params":{},"type":"refresh"}],"tags":["testing:browser"],"type":"browser"}'
66
headers:
77
accept:
@@ -12,8 +12,8 @@ interactions:
1212
uri: https://api.datadoghq.com/api/v1/synthetics/tests/browser
1313
response:
1414
body:
15-
string: '{"status":"paused","public_id":"3ry-tnf-fqu","tags":["testing:browser"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Test
16-
message","deleted_at":null,"name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1660814370","monitor_id":80432986,"type":"browser","created_at":"2022-08-18T09:19:30.959520+00:00","modified_at":"2022-08-18T09:19:30.959520+00:00","steps":[{"name":"Refresh
15+
string: '{"status":"paused","public_id":"jsu-a6z-5fw","tags":["testing:browser"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Test
16+
message","deleted_at":null,"name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1661864316","monitor_id":81568552,"type":"browser","created_at":"2022-08-30T12:58:36.698302+00:00","modified_at":"2022-08-30T12:58:36.698302+00:00","steps":[{"name":"Refresh
1717
page","allowFailure":false,"params":{},"isCritical":true,"type":"refresh"}],"config":{"setCookie":"name:test","request":{"url":"https://datadoghq.com","certificateDomains":["https://datadoghq.com"],"method":"GET"},"assertions":[],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"disableCsp":true,"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"ci":{"executionRule":"skipped"},"noScreenshot":true,"rumSettings":{"isEnabled":true,"applicationId":"mockApplicationId","clientTokenId":12345},"initialNavigationTimeout":200,"disableCors":true,"device_ids":["tablet"],"tick_every":300,"ignoreServerCertificateError":true}}'
1818
headers:
1919
content-type:
@@ -22,7 +22,7 @@ interactions:
2222
code: 200
2323
message: OK
2424
- request:
25-
body: '{"public_ids":["3ry-tnf-fqu"]}'
25+
body: '{"public_ids":["jsu-a6z-5fw"]}'
2626
headers:
2727
accept:
2828
- application/json
@@ -32,7 +32,7 @@ interactions:
3232
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
3333
response:
3434
body:
35-
string: '{"deleted_tests":[{"deleted_at":"2022-08-18T09:19:36.462930+00:00","public_id":"3ry-tnf-fqu"}]}'
35+
string: '{"deleted_tests":[{"deleted_at":"2022-08-30T12:58:42.293815+00:00","public_id":"jsu-a6z-5fw"}]}'
3636
headers:
3737
content-type:
3838
- application/json

0 commit comments

Comments
 (0)