Skip to content

Commit 6b416fe

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spectherve
authored
Add RUM settings schema to synthetics tests (#1001)
* Regenerate client from commit da8834e1 of spec repo * pre-commit fixes 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: Thomas Hervé <[email protected]>
1 parent 3b80e43 commit 6b416fe

13 files changed

+347
-14
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-05-19 13:45:57.312769",
8-
"spec_repo_commit": "dc18f74b"
7+
"regenerated": "2022-05-19 19:13:20.804693",
8+
"spec_repo_commit": "da8834e1"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-05-19 13:45:57.324742",
13-
"spec_repo_commit": "dc18f74b"
12+
"regenerated": "2022-05-19 19:13:20.815894",
13+
"spec_repo_commit": "da8834e1"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10872,6 +10872,50 @@ components:
1087210872
format: int64
1087310873
type: integer
1087410874
type: object
10875+
SyntheticsBrowserTestRumSettings:
10876+
description: 'The RUM data collection settings for the Synthetic browser test.
10877+
10878+
**Note:** There are 3 ways to format RUM settings:
10879+
10880+
10881+
`{ isEnabled: false }`
10882+
10883+
RUM data is not collected.
10884+
10885+
10886+
`{ isEnabled: true }`
10887+
10888+
RUM data is collected from the Synthetic test''s default application.
10889+
10890+
10891+
`{ isEnabled: true, applicationId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
10892+
clientTokenId: 12345 }`
10893+
10894+
RUM data is collected using the specified application.'
10895+
example:
10896+
applicationId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
10897+
clientTokenId: 12345
10898+
isEnabled: true
10899+
properties:
10900+
applicationId:
10901+
description: RUM application ID used to collect RUM data for the browser
10902+
test.
10903+
example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
10904+
type: string
10905+
clientTokenId:
10906+
description: RUM application API key ID used to collect RUM data for the
10907+
browser test.
10908+
example: 12345
10909+
format: int64
10910+
type: integer
10911+
x-secret: true
10912+
isEnabled:
10913+
description: Determines whether RUM data is collected during test runs.
10914+
example: true
10915+
type: boolean
10916+
required:
10917+
- isEnabled
10918+
type: object
1087510919
SyntheticsBrowserTestType:
1087610920
default: browser
1087710921
description: Type of the Synthetic test, `browser`.
@@ -11967,6 +12011,8 @@ components:
1196712011
$ref: '#/components/schemas/SyntheticsRestrictedRoles'
1196812012
retry:
1196912013
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
12014+
rumSettings:
12015+
$ref: '#/components/schemas/SyntheticsBrowserTestRumSettings'
1197012016
tick_every:
1197112017
description: The frequency at which to run the Synthetic test (in seconds).
1197212018
format: int64

docs/datadog_api_client.v1.model.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,6 +3689,14 @@ synthetics\_browser\_test\_result\_short\_result
36893689
:undoc-members:
36903690
:show-inheritance:
36913691

3692+
synthetics\_browser\_test\_rum\_settings
3693+
----------------------------------------
3694+
3695+
.. automodule:: datadog_api_client.v1.model.synthetics_browser_test_rum_settings
3696+
:members:
3697+
:undoc-members:
3698+
:show-inheritance:
3699+
36923700
synthetics\_browser\_test\_type
36933701
-------------------------------
36943702

examples/v1/synthetics/CreateSyntheticsAPITest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from datadog_api_client.v1.model.synthetics_assertion_operator import SyntheticsAssertionOperator
1212
from datadog_api_client.v1.model.synthetics_assertion_target import SyntheticsAssertionTarget
1313
from datadog_api_client.v1.model.synthetics_assertion_type import SyntheticsAssertionType
14+
from datadog_api_client.v1.model.synthetics_browser_test_rum_settings import SyntheticsBrowserTestRumSettings
1415
from datadog_api_client.v1.model.synthetics_device_id import SyntheticsDeviceID
1516
from datadog_api_client.v1.model.synthetics_restricted_roles import SyntheticsRestrictedRoles
1617
from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType
@@ -50,6 +51,11 @@
5051
]
5152
),
5253
retry=SyntheticsTestOptionsRetry(),
54+
rum_settings=SyntheticsBrowserTestRumSettings(
55+
application_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
56+
client_token_id=12345,
57+
is_enabled=True,
58+
),
5359
),
5460
status=SyntheticsTestPauseStatus("live"),
5561
subtype=SyntheticsTestDetailsSubType("http"),
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
"""
2+
Create a browser test returns "OK - Returns saved rumSettings." response
3+
"""
4+
5+
from datadog_api_client 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_browser_test import SyntheticsBrowserTest
9+
from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig
10+
from datadog_api_client.v1.model.synthetics_browser_test_rum_settings import SyntheticsBrowserTestRumSettings
11+
from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType
12+
from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable
13+
from datadog_api_client.v1.model.synthetics_config_variable_type import SyntheticsConfigVariableType
14+
from datadog_api_client.v1.model.synthetics_device_id import SyntheticsDeviceID
15+
from datadog_api_client.v1.model.synthetics_step import SyntheticsStep
16+
from datadog_api_client.v1.model.synthetics_step_type import SyntheticsStepType
17+
from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions
18+
from datadog_api_client.v1.model.synthetics_test_options_retry import SyntheticsTestOptionsRetry
19+
from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest
20+
21+
body = SyntheticsBrowserTest(
22+
config=SyntheticsBrowserTestConfig(
23+
assertions=[],
24+
config_variables=[
25+
SyntheticsConfigVariable(
26+
example="content-type",
27+
name="PROPERTY",
28+
pattern="content-type",
29+
type=SyntheticsConfigVariableType("text"),
30+
),
31+
],
32+
request=SyntheticsTestRequest(
33+
method=HTTPMethod("GET"),
34+
url="https://datadoghq.com",
35+
),
36+
set_cookie="name:test",
37+
),
38+
locations=[
39+
"aws:us-east-2",
40+
],
41+
message="Test message",
42+
name="Example-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response",
43+
options=SyntheticsTestOptions(
44+
accept_self_signed=False,
45+
allow_insecure=True,
46+
device_ids=[
47+
SyntheticsDeviceID("tablet"),
48+
],
49+
disable_cors=True,
50+
follow_redirects=True,
51+
min_failure_duration=10,
52+
min_location_failed=1,
53+
no_screenshot=True,
54+
retry=SyntheticsTestOptionsRetry(
55+
count=3,
56+
interval=10.0,
57+
),
58+
rum_settings=SyntheticsBrowserTestRumSettings(
59+
is_enabled=True,
60+
application_id="mockApplicationId",
61+
client_token_id=123456,
62+
),
63+
tick_every=300,
64+
),
65+
tags=[
66+
"testing:browser",
67+
],
68+
type=SyntheticsBrowserTestType("browser"),
69+
steps=[
70+
SyntheticsStep(
71+
allow_failure=False,
72+
is_critical=True,
73+
name="Refresh page",
74+
params=dict(),
75+
type=SyntheticsStepType("refresh"),
76+
),
77+
],
78+
)
79+
80+
configuration = Configuration()
81+
with ApiClient(configuration) as api_client:
82+
api_instance = SyntheticsApi(api_client)
83+
response = api_instance.create_synthetics_browser_test(body=body)
84+
85+
print(response)

examples/v1/synthetics/UpdateBrowserTest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datadog_api_client.v1.model.synthetics_basic_auth_web_type import SyntheticsBasicAuthWebType
1010
from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest
1111
from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig
12+
from datadog_api_client.v1.model.synthetics_browser_test_rum_settings import SyntheticsBrowserTestRumSettings
1213
from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType
1314
from datadog_api_client.v1.model.synthetics_browser_variable import SyntheticsBrowserVariable
1415
from datadog_api_client.v1.model.synthetics_browser_variable_type import SyntheticsBrowserVariableType
@@ -75,6 +76,11 @@
7576
]
7677
),
7778
retry=SyntheticsTestOptionsRetry(),
79+
rum_settings=SyntheticsBrowserTestRumSettings(
80+
application_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
81+
client_token_id=12345,
82+
is_enabled=True,
83+
),
7884
),
7985
status=SyntheticsTestPauseStatus("live"),
8086
steps=[

src/datadog_api_client/v1/model/synthetics_browser_test_rum_settings.py

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

src/datadog_api_client/v1/model/synthetics_test_options.py

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

src/datadog_api_client/v1/models/__init__.py

Lines changed: 1 addition & 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-05-18T13:08:12.878Z

0 commit comments

Comments
 (0)