Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102052,6 +102052,14 @@ components:
RUMApplicationCreateAttributes:
description: RUM application creation attributes.
properties:
create_default_retention_filters:
default: true
description: |-
Whether to create the default retention filters when the application is created: `Sessions with errors` and `Sessions`, each with a 100% retention rate.
Set to `false` to create the application without them, for example when you add your own retention filters right after creating it. Until you add retention filters, the application only retains sessions matched by its [permanent retention filters](https://docs.datadoghq.com/real_user_monitoring/rum_without_limits/retention_filters/#permanent-retention-filters).
This setting doesn't affect permanent retention filters (sessions with forced replays, Synthetics sessions and RUM-APM flat sampling).
example: false
type: boolean
name:
description: Name of the RUM application.
example: my_new_rum_application
Expand Down Expand Up @@ -219711,7 +219719,7 @@ paths:
$ref: "#/components/schemas/RUMApplicationCreateRequest"
required: true
responses:
"200":
"201":
content:
application/json:
examples:
Expand All @@ -219732,7 +219740,7 @@ paths:
type: rum_application
schema:
$ref: "#/components/schemas/RUMApplicationResponse"
description: OK
description: Created
"400":
$ref: "#/components/responses/BadRequestResponse"
"429":
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/rum/CreateRUMApplication.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Create a new RUM application returns "OK" response
Create a new RUM application returns "Created" response
"""

from os import environ
Expand Down
30 changes: 30 additions & 0 deletions examples/v2/rum/CreateRUMApplication_3241419056.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
Create a new RUM application without default retention filters returns "Created" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_api import RUMApi
from datadog_api_client.v2.model.rum_application_create import RUMApplicationCreate
from datadog_api_client.v2.model.rum_application_create_attributes import RUMApplicationCreateAttributes
from datadog_api_client.v2.model.rum_application_create_request import RUMApplicationCreateRequest
from datadog_api_client.v2.model.rum_application_create_type import RUMApplicationCreateType

body = RUMApplicationCreateRequest(
data=RUMApplicationCreate(
attributes=RUMApplicationCreateAttributes(
name="test-rum-no-default-rf-5c67ebb32077e1d9",
type="browser",
create_default_retention_filters=False,
),
type=RUMApplicationCreateType.RUM_APPLICATION_CREATE,
),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = RUMApi(api_client)
response = api_instance.create_rum_application(body=body)

print(response)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Create a new RUM application with Product Scales returns "OK" response
Create a new RUM application with Product Scales returns "Created" response
"""

from os import environ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ def openapi_types(_):
from datadog_api_client.v2.model.rum_event_processing_state import RUMEventProcessingState

return {
"create_default_retention_filters": (bool,),
"name": (str,),
"product_analytics_retention_state": (RUMProductAnalyticsRetentionState,),
"rum_event_processing_state": (RUMEventProcessingState,),
"type": (str,),
}

attribute_map = {
"create_default_retention_filters": "create_default_retention_filters",
"name": "name",
"product_analytics_retention_state": "product_analytics_retention_state",
"rum_event_processing_state": "rum_event_processing_state",
Expand All @@ -41,6 +43,7 @@ def openapi_types(_):
def __init__(
self_,
name: str,
create_default_retention_filters: Union[bool, UnsetType] = unset,
product_analytics_retention_state: Union[RUMProductAnalyticsRetentionState, UnsetType] = unset,
rum_event_processing_state: Union[RUMEventProcessingState, UnsetType] = unset,
type: Union[str, UnsetType] = unset,
Expand All @@ -49,6 +52,11 @@ def __init__(
"""
RUM application creation attributes.

:param create_default_retention_filters: Whether to create the default retention filters when the application is created: ``Sessions with errors`` and ``Sessions`` , each with a 100% retention rate.
Set to ``false`` to create the application without them, for example when you add your own retention filters right after creating it. Until you add retention filters, the application only retains sessions matched by its `permanent retention filters <https://docs.datadoghq.com/real_user_monitoring/rum_without_limits/retention_filters/#permanent-retention-filters>`_.
This setting doesn't affect permanent retention filters (sessions with forced replays, Synthetics sessions and RUM-APM flat sampling).
:type create_default_retention_filters: bool, optional

:param name: Name of the RUM application.
:type name: str

Expand All @@ -61,6 +69,8 @@ def __init__(
:param type: Type of the RUM application. Supported values are ``browser`` , ``ios`` , ``android`` , ``react-native`` , ``flutter`` , ``roku`` , ``electron`` , ``unity`` , ``kotlin-multiplatform``.
:type type: str, optional
"""
if create_default_retention_filters is not unset:
kwargs["create_default_retention_filters"] = create_default_retention_filters
if product_analytics_retention_state is not unset:
kwargs["product_analytics_retention_state"] = product_analytics_retention_state
if rum_event_processing_state is not unset:
Expand Down
15 changes: 11 additions & 4 deletions tests/generated-test/test-runner-data/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9586,15 +9586,22 @@
{
"feature": "RUM",
"feature_file": "../../v2/features/rum.feature",
"file": "v2/rum/create-a-new-rum-application-returns-ok-response.json",
"scenario": "Create a new RUM application returns \"OK\" response",
"file": "v2/rum/create-a-new-rum-application-returns-created-response.json",
"scenario": "Create a new RUM application returns \"Created\" response",
"version": "v2"
},
{
"feature": "RUM",
"feature_file": "../../v2/features/rum.feature",
"file": "v2/rum/create-a-new-rum-application-with-product-scales-returns-ok-response.json",
"scenario": "Create a new RUM application with Product Scales returns \"OK\" response",
"file": "v2/rum/create-a-new-rum-application-with-product-scales-returns-created-response.json",
"scenario": "Create a new RUM application with Product Scales returns \"Created\" response",
"version": "v2"
},
{
"feature": "RUM",
"feature_file": "../../v2/features/rum.feature",
"file": "v2/rum/create-a-new-rum-application-without-default-retention-filters-returns-created-response.json",
"scenario": "Create a new RUM application without default retention filters returns \"Created\" response",
"version": "v2"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"api": "RUM",
"expected_status": 200,
"expected_status": 201,
"feature": "RUM",
"id": "v2/RUM/Create a new RUM application returns \"OK\" response",
"id": "v2/RUM/Create a new RUM application returns \"Created\" response",
"operation_id": "CreateRUMApplication",
"request": {
"body": {
Expand All @@ -28,7 +28,7 @@
"parameters": [],
"path": "/api/v2/rum/applications"
},
"scenario": "Create a new RUM application returns \"OK\" response",
"scenario": "Create a new RUM application returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"api": "RUM",
"expected_status": 200,
"expected_status": 201,
"feature": "RUM",
"id": "v2/RUM/Create a new RUM application with Product Scales returns \"OK\" response",
"id": "v2/RUM/Create a new RUM application with Product Scales returns \"Created\" response",
"operation_id": "CreateRUMApplication",
"request": {
"body": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"parameters": [],
"path": "/api/v2/rum/applications"
},
"scenario": "Create a new RUM application with Product Scales returns \"OK\" response",
"scenario": "Create a new RUM application with Product Scales returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"api": "RUM",
"expected_status": 201,
"feature": "RUM",
"id": "v2/RUM/Create a new RUM application without default retention filters returns \"Created\" response",
"operation_id": "CreateRUMApplication",
"request": {
"body": {
"schema": {
"format": null,
"ref": "RUMApplicationCreateRequest",
"type": "object"
},
"source": "inline",
"value": {
"data": {
"attributes": {
"create_default_retention_filters": false,
"name": "test-rum-no-default-rf-{{ unique_hash }}",
"type": "browser"
},
"type": "rum_application_create"
}
}
},
"content_type": "application/json",
"method": "POST",
"pagination": false,
"parameters": [],
"path": "/api/v2/rum/applications"
},
"scenario": "Create a new RUM application without default retention filters returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Loading
Loading