You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c752b02
Browse filesBrowse the repository at this point in the historyBrowse files
description: JSON:API resource type for a tag rule.
144288
+
description: JSON:API resource type for a tag rule. Requests accept `tag_rule` or `tag_policy`; responses use `tag_policy`.
144277
144289
enum:
144278
144290
- tag_rule
144279
-
example: "tag_rule"
144291
+
- tag_policy
144292
+
example: "tag_policy"
144280
144293
type: string
144281
144294
x-enum-varnames:
144282
144295
- TAG_RULE
144296
+
- TAG_POLICY
144283
144297
TagRuleResponse:
144284
144298
description: A single tag rule.
144285
144299
properties:
@@ -144360,13 +144374,15 @@ components:
144360
144374
- id
144361
144375
type: object
144362
144376
TagRuleScoreResourceType:
144363
-
description: JSON:API resource type for a tag rule compliance score.
144377
+
description: JSON:API resource type for a tag rule compliance score. Responses use `tag_policy_score`.
144364
144378
enum:
144365
144379
- tag_rule_score
144366
-
example: "tag_rule_score"
144380
+
- tag_policy_score
144381
+
example: "tag_policy_score"
144367
144382
type: string
144368
144383
x-enum-varnames:
144369
144384
- TAG_RULE_SCORE
144385
+
- TAG_POLICY_SCORE
144370
144386
TagRuleScoreResponse:
144371
144387
description: A tag rule compliance score.
144372
144388
properties:
@@ -144395,6 +144411,7 @@ components:
144395
144411
description: |-
144396
144412
How the rule is enforced. `blocking` rejects telemetry that violates the rule.
144397
144413
`surfacing` only highlights non-compliant telemetry without blocking it.
144414
+
RUM supports only `surfacing` rules.
144398
144415
enum:
144399
144416
- blocking
144400
144417
- surfacing
@@ -144406,7 +144423,9 @@ components:
144406
144423
TagRuleUpdateAttributes:
144407
144424
description: |-
144408
144425
Mutable attributes of a tag rule. Each field is optional; omitting a field leaves its
144409
-
current value unchanged. The `source` of a rule cannot be changed.
144426
+
current value unchanged. The `source` of a rule cannot be changed. Tag keys, patterns,
144427
+
and metrics scopes have the same constraints as on creation. If the effective
144428
+
`tag_value_patterns` contains `*`, set `required` and `negated` to different values.
144410
144429
properties:
144411
144430
enabled:
144412
144431
description: Whether the rule is currently enforced.
@@ -144427,12 +144446,16 @@ components:
144427
144446
type: string
144428
144447
tag_key:
144429
144448
description: The tag key that the rule governs.
144449
+
pattern: '^[A-Za-z0-9_.\/-]+$'
144430
144450
type: string
144431
144451
tag_value_patterns:
144432
144452
description: One or more patterns that valid values for the tag key must match.
144433
144453
items:
144434
144454
description: A pattern that valid tag values must match.
144455
+
pattern: '^[A-Za-z0-9_:.,\/*-]+$'
144435
144456
type: string
144457
+
maxItems: 30
144458
+
minItems: 1
144436
144459
type: array
144437
144460
type: object
144438
144461
TagRuleUpdateData:
@@ -193239,7 +193262,7 @@ paths:
193239
193262
required: false
193240
193263
schema:
193241
193264
$ref: "#/components/schemas/TagRuleSource"
193242
-
- description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to a recent window appropriate for the source.
193265
+
- description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to approximately 4 hours before the current time for metrics, or 24 hours before the current time for other sources. The API clamps earlier values to this default, regardless of `ts_end`.
193243
193266
example: 1779315066097
193244
193267
in: query
193245
193268
name: ts_start
@@ -193285,16 +193308,16 @@ paths:
193285
193308
score:
193286
193309
data:
193287
193310
id: "123-v1-1779315066097-1779401466097"
193288
-
type: "tag_rule_score"
193289
-
type: "tag_rule"
193311
+
type: "tag_policy_score"
193312
+
type: "tag_policy"
193290
193313
included:
193291
193314
- attributes:
193292
193315
score: 80
193293
193316
ts_end: 1779401466097
193294
193317
ts_start: 1779315066097
193295
193318
version: 1
193296
193319
id: "123-v1-1779315066097-1779401466097"
193297
-
type: "tag_rule_score"
193320
+
type: "tag_policy_score"
193298
193321
schema:
193299
193322
$ref: "#/components/schemas/TagRulesListResponse"
193300
193323
description: OK
@@ -193388,7 +193411,7 @@ paths:
193388
193411
- "web"
193389
193412
version: 1
193390
193413
id: "123"
193391
-
type: "tag_rule"
193414
+
type: "tag_policy"
193392
193415
schema:
193393
193416
$ref: "#/components/schemas/TagRuleResponse"
193394
193417
description: Created
@@ -193437,7 +193460,8 @@ paths:
193437
193460
description: |-
193438
193461
Delete a tag rule. By default the rule is soft-deleted so it can be recovered later
193439
193462
and so that historical score data remains queryable. Pass `hard_delete=true` to remove
193440
-
the rule permanently.
193463
+
the rule permanently. Deleting a `blocking` rule additionally requires the
193464
+
`telemetry_rules_activate` permission.
193441
193465
operationId: DeleteTagRule
193442
193466
parameters:
193443
193467
- description: The unique identifier of the tag rule to delete.
@@ -193518,7 +193542,7 @@ paths:
193518
193542
required: false
193519
193543
schema:
193520
193544
$ref: "#/components/schemas/TagRuleInclude"
193521
-
- description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds.
193545
+
- description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to approximately 4 hours before the current time for metrics, or 24 hours before the current time for other sources. The API clamps earlier values to this default, regardless of `ts_end`.
193522
193546
example: 1779315066097
193523
193547
in: query
193524
193548
name: ts_start
@@ -193564,16 +193588,16 @@ paths:
193564
193588
score:
193565
193589
data:
193566
193590
id: "123-v1-1779315066097-1779401466097"
193567
-
type: "tag_rule_score"
193568
-
type: "tag_rule"
193591
+
type: "tag_policy_score"
193592
+
type: "tag_policy"
193569
193593
included:
193570
193594
- attributes:
193571
193595
score: 80
193572
193596
ts_end: 1779401466097
193573
193597
ts_start: 1779315066097
193574
193598
version: 1
193575
193599
id: "123-v1-1779315066097-1779401466097"
193576
-
type: "tag_rule_score"
193600
+
type: "tag_policy_score"
193577
193601
schema:
193578
193602
$ref: "#/components/schemas/TagRuleResponse"
193579
193603
description: OK
@@ -193623,6 +193647,9 @@ paths:
193623
193647
Update one or more attributes of an existing tag rule. Only the fields supplied in the
193624
193648
request body are modified; omitted fields retain their current values. The rule's
193625
193649
`source` cannot be changed after creation.
193650
+
Promoting a rule from `surfacing` to `blocking` additionally requires the
193651
+
`telemetry_rules_activate` permission, and your organization must have access to
193652
+
blocking rules. You can't promote RUM rules to `blocking`.
193626
193653
operationId: UpdateTagRule
193627
193654
parameters:
193628
193655
- description: The unique identifier of the tag rule to update.
@@ -193673,7 +193700,7 @@ paths:
193673
193700
- "web"
193674
193701
version: 2
193675
193702
id: "123"
193676
-
type: "tag_rule"
193703
+
type: "tag_policy"
193677
193704
schema:
193678
193705
$ref: "#/components/schemas/TagRuleResponse"
193679
193706
description: OK
@@ -193733,7 +193760,7 @@ paths:
193733
193760
required: true
193734
193761
schema:
193735
193762
type: string
193736
-
- description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds.
193763
+
- description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to approximately 4 hours before the current time for metrics, or 24 hours before the current time for other sources. The API clamps earlier values to this default, regardless of `ts_end`.
193737
193764
example: 1779315066097
193738
193765
in: query
193739
193766
name: ts_start
@@ -193763,7 +193790,7 @@ paths:
193763
193790
ts_start: 1779315066097
193764
193791
version: 1
193765
193792
id: "123-v1-1779315066097-1779401466097"
193766
-
type: "tag_rule_score"
193793
+
type: "tag_policy_score"
193767
193794
schema:
193768
193795
$ref: "#/components/schemas/TagRuleScoreResponse"
193769
193796
description: OK
@@ -275512,7 +275539,7 @@ tags:
275512
275539
scoped to a particular telemetry source (such as logs, spans, or metrics). Rules can be
275513
275540
`blocking` (data not matching the rule is rejected) or `surfacing` (matching data is
275514
275541
highlighted but not blocked). Each rule reports a compliance `score` derived from how
275515
-
much recent telemetry adheres to the rule.
275542
+
much recent telemetry adheres to the rule. RUM supports only `surfacing` rules.
275516
275543
name: Tag Rules
275517
275544
- description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information.
Copy file name to clipboardExpand all lines: src/datadog_api_client/v2/api/tag_rules_api.py
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ class TagRulesApi:
26
26
scoped to a particular telemetry source (such as logs, spans, or metrics). Rules can be
27
27
``blocking`` (data not matching the rule is rejected) or ``surfacing`` (matching data is
28
28
highlighted but not blocked). Each rule reports a compliance ``score`` derived from how
29
-
much recent telemetry adheres to the rule.
29
+
much recent telemetry adheres to the rule. RUM supports only ``surfacing`` rules.
30
30
"""
31
31
32
32
def__init__(self, api_client=None):
@@ -254,7 +254,8 @@ def delete_tag_rule(
254
254
255
255
Delete a tag rule. By default the rule is soft-deleted so it can be recovered later
256
256
and so that historical score data remains queryable. Pass ``hard_delete=true`` to remove
257
-
the rule permanently.
257
+
the rule permanently. Deleting a ``blocking`` rule additionally requires the
258
+
``telemetry_rules_activate`` permission.
258
259
259
260
:param rule_id: The unique identifier of the tag rule to delete.
260
261
:type rule_id: str
@@ -288,7 +289,7 @@ def get_tag_rule(
288
289
:type rule_id: str
289
290
:param include: Comma-separated list of related resources to include alongside the rule. Currently the only supported value is ``score``.
290
291
:type include: TagRuleInclude, optional
291
-
:param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds.
292
+
:param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to approximately 4 hours before the current time for metrics, or 24 hours before the current time for other sources. The API clamps earlier values to this default, regardless of ``ts_end``.
292
293
:type ts_start: int, optional
293
294
:param ts_end: End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than ``ts_start``.
294
295
:type ts_end: int, optional
@@ -324,7 +325,7 @@ def get_tag_rule_score(
324
325
325
326
:param rule_id: The unique identifier of the tag rule.
326
327
:type rule_id: str
327
-
:param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds.
328
+
:param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to approximately 4 hours before the current time for metrics, or 24 hours before the current time for other sources. The API clamps earlier values to this default, regardless of ``ts_end``.
328
329
:type ts_start: int, optional
329
330
:param ts_end: End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than ``ts_start``.
330
331
:type ts_end: int, optional
@@ -365,7 +366,7 @@ def list_tag_rules(
365
366
:type include: TagRuleInclude, optional
366
367
:param filter_source: Restrict the result set to rules whose source matches the given value.
367
368
:type filter_source: TagRuleSource, optional
368
-
:param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to a recent window appropriate for the source.
369
+
:param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to approximately 4 hours before the current time for metrics, or 24 hours before the current time for other sources. The API clamps earlier values to this default, regardless of ``ts_end``.
369
370
:type ts_start: int, optional
370
371
:param ts_end: End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than ``ts_start``.
371
372
:type ts_end: int, optional
@@ -402,6 +403,9 @@ def update_tag_rule(
402
403
Update one or more attributes of an existing tag rule. Only the fields supplied in the
403
404
request body are modified; omitted fields retain their current values. The rule's
404
405
``source`` cannot be changed after creation.
406
+
Promoting a rule from ``surfacing`` to ``blocking`` additionally requires the
407
+
``telemetry_rules_activate`` permission, and your organization must have access to
408
+
blocking rules. You can't promote RUM rules to ``blocking``.
405
409
406
410
:param rule_id: The unique identifier of the tag rule to update.
0 commit comments