From 6cdac6073fb66811bec6f058128f918af49d427d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 13 Nov 2026 21:23:53 +0000 Subject: [PATCH] Regenerate client from commit 7be7b03 of spec repo --- .generator/schemas/v2/openapi.yaml | 184 +++++++++++++----- examples/v2/tag-rules/CreateTagRule.py | 4 +- examples/v2/tag-rules/UpdateTagRule.py | 2 +- .../v2/api/tag_rules_api.py | 14 +- .../v2/model/gcp_project_filter_config.py | 60 ++++++ .../model/gcp_project_filter_config_type.py | 38 ++++ .../gcpsts_service_account_attributes.py | 14 ++ .../v2/model/tag_rule_attributes.py | 1 + .../v2/model/tag_rule_create_attributes.py | 23 ++- .../v2/model/tag_rule_create_data.py | 6 +- .../v2/model/tag_rule_data.py | 2 +- .../v2/model/tag_rule_resource_type.py | 7 +- .../v2/model/tag_rule_score_data.py | 2 +- .../model/tag_rule_score_relationship_data.py | 2 +- .../v2/model/tag_rule_score_resource_type.py | 7 +- .../v2/model/tag_rule_type.py | 1 + .../v2/model/tag_rule_update_attributes.py | 13 +- .../v2/model/tag_rule_update_data.py | 6 +- src/datadog_api_client/v2/models/__init__.py | 4 + tests/v2/features/gcp_integration.feature | 8 +- tests/v2/features/tag_rules.feature | 14 +- 21 files changed, 323 insertions(+), 89 deletions(-) create mode 100644 src/datadog_api_client/v2/model/gcp_project_filter_config.py create mode 100644 src/datadog_api_client/v2/model/gcp_project_filter_config_type.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e2de898d9c..5dfa97f771 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -33587,7 +33587,7 @@ components: example: data: attributes: - company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAIKMMMM + company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== components: - name: API position: 0 @@ -33606,10 +33606,10 @@ components: position: 2 type: component domain_prefix: status-page-us1 - email_header_image: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF - favicon: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA + email_header_image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + favicon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== name: Status Page US1 - slack_app_icon: data:image/png;base64,mXRTqw0KGgoAAAANSUhEUgAAAEAAAABACA + slack_app_icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== subscriptions_enabled: true type: public visualization_type: bars_and_uptime_percentage @@ -33634,7 +33634,7 @@ components: properties: company_logo: description: The base64-encoded image data displayed on the status page. - example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAIKMMMM + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string components: description: The components displayed on the status page. @@ -33664,14 +33664,14 @@ components: type: string email_header_image: description: Base64-encoded image data included in email notifications sent to status page subscribers. - example: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string email_notifications_enabled: description: Whether email notifications are enabled for the status page. Must be enabled when `subscriptions_enabled` is `true`. type: boolean favicon: description: Base64-encoded image data displayed in the browser tab. - example: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string ms_teams_subscriptions_enabled: description: Whether Microsoft Teams subscriptions are enabled for the status page. @@ -33685,7 +33685,7 @@ components: type: boolean slack_app_icon: description: The base64-encoded image data used as the Slack app icon. - example: data:image/png;base64,mXRTqw0KGgoAAAANSUhEUgAAAEAAAABACA + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string slack_subscriptions_enabled: description: Whether Slack subscriptions are enabled for the status page. @@ -62643,6 +62643,34 @@ components: - CLOUD_FUNCTION - CLOUD_RUN_REVISION - GCE_INSTANCE + GCPProjectFilterConfig: + description: Configuration for filtering the GCP projects that Datadog monitors by project ID or by project label. + properties: + filters: + description: |- + List of filters matched against the project field set by `type`. Filters support the `*` and `?` + wildcards, and a leading `!` makes a filter an exclusion. A project is skipped if it matches any + exclusion filter. When inclusion filters are set, a project must also match at least one of them. + For `project_id`, each filter is a project ID pattern, such as `prod-*`. You can set up to 15,000 + filters. For `project_label`, each filter is a label in the form `key:value`, such as `env:prod*`. + You can set up to 100 filters. Keys are matched exactly, and wildcards apply only to values, so + `key:*` matches any value. + example: ["prod-*", "!prod-legacy"] + items: + description: A project filter. + type: string + type: array + type: + $ref: "#/components/schemas/GCPProjectFilterConfigType" + type: object + GCPProjectFilterConfigType: + description: The GCP project field that the filters are matched against. + enum: ["project_id", "project_label"] + example: "project_id" + type: string + x-enum-varnames: + - PROJECT_ID + - PROJECT_LABEL GCPSTSDelegateAccount: description: Datadog principal service account info. properties: @@ -62777,6 +62805,17 @@ components: items: $ref: "#/components/schemas/GCPMonitoredResourceConfig" type: array + project_filter_configs: + description: |- + Configurations that limit which GCP projects Datadog monitors, out of the projects this service + account can access. Each type can have at most one configuration. A project is monitored only if + it passes the filters of every configured type. By default, Datadog monitors every project the + service account can access. When updating a service account, omit this field to keep the current + filters, or send an empty list to remove them. + example: [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}] + items: + $ref: "#/components/schemas/GCPProjectFilterConfig" + type: array region_filter_configs: description: Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations. example: ["nam4", "europe-north1"] @@ -106156,12 +106195,12 @@ components: example: data: attributes: - company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAIKMMMM + company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== domain_prefix: status-page-us1-east - email_header_image: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF - favicon: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA + email_header_image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + favicon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== name: Status Page US1 East - slack_app_icon: data:image/png;base64,mXRTqw0KGgoAAAANSUhEUgAAAEAAAABACA + slack_app_icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== subscriptions_enabled: false type: internal visualization_type: bars_only @@ -106193,7 +106232,7 @@ components: properties: company_logo: description: The base64-encoded image data displayed on the status page. - example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAIKMMMM + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string domain_prefix: description: The subdomain of the status page URL. Public pages use `https://{domain_prefix}.statuspage.datadoghq.com`, while private pages use `https://{domain_prefix}.private.statuspage.datadoghq.com`. Globally unique across Datadog Status Pages. @@ -106201,14 +106240,14 @@ components: type: string email_header_image: description: The base64-encoded image data displayed in email notifications sent to status page subscribers. - example: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string email_notifications_enabled: description: Whether email notifications are enabled for the status page. Must be enabled when `subscriptions_enabled` is `true`. type: boolean favicon: description: The base64-encoded image data displayed in the browser tab. - example: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string ms_teams_subscriptions_enabled: description: Whether Microsoft Teams subscriptions are enabled for the status page. @@ -106222,7 +106261,7 @@ components: type: boolean slack_app_icon: description: The base64-encoded image data used as the Slack app icon. - example: data:image/png;base64,mXRTqw0KGgoAAAANSUhEUgAAAEAAAABACA + example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== type: string slack_subscriptions_enabled: description: Whether Slack subscriptions are enabled for the status page. @@ -144149,10 +144188,13 @@ components: - modified_by type: object TagRuleCreateAttributes: - description: Attributes that can be supplied when creating a tag rule. + description: |- + Attributes that can be supplied when creating a tag rule. If `tag_value_patterns` + contains `*`, set `required` and `negated` to different values. If both are `false`, + the rule has no effect. If both are `true`, no value can satisfy the rule. properties: enabled: - description: Whether the rule is currently enforced. Defaults to `true` for newly created rules. + description: The API ignores this value on creation and always enables new rules. To disable a rule, use the "Update a tag rule" endpoint. example: true type: boolean name: @@ -144171,26 +144213,35 @@ components: $ref: "#/components/schemas/TagRuleCreateType" scope: description: |- - The scope the rule applies within. Typically an environment, team, or - organization-level identifier used to limit where the rule is enforced. - example: "env" + The scope the rule applies within. For logs and spans, use a search query, such + as `env:prod`, or `*` to match all telemetry. For metrics, use a metric selector + with an optional tag filter, such as `system.cpu.*{env:prod}`. A metric wildcard + is allowed only once, at the end of the metric selector. + example: "env:prod" type: string source: $ref: "#/components/schemas/TagRuleSource" tag_key: - description: The tag key that the rule governs (for example, `service`). + description: |- + The tag key that the rule governs (for example, `service`). Allowed characters + are ASCII letters, digits, underscores, hyphens, periods, and slashes. The keys + `host` and `device` are not supported in any letter case. example: "service" + pattern: '^[A-Za-z0-9_.\/-]+$' type: string tag_value_patterns: description: |- - One or more patterns that valid values for the tag key must match. At least one - pattern is required. + Between 1 and 30 non-empty patterns that valid values for the tag key must match. + Allowed characters are ASCII letters, digits, underscores, colons, hyphens, + periods, commas, slashes, and asterisks. example: - "api" - "web" items: description: A pattern that valid tag values must match. + pattern: '^[A-Za-z0-9_:.,\/*-]+$' type: string + maxItems: 30 minItems: 1 type: array required: @@ -144273,13 +144324,15 @@ components: $ref: "#/components/schemas/TagRuleScoreRelationship" type: object TagRuleResourceType: - description: JSON:API resource type for a tag rule. + description: JSON:API resource type for a tag rule. Requests accept `tag_rule` or `tag_policy`; responses use `tag_policy`. enum: - tag_rule - example: "tag_rule" + - tag_policy + example: "tag_policy" type: string x-enum-varnames: - TAG_RULE + - TAG_POLICY TagRuleResponse: description: A single tag rule. properties: @@ -144360,13 +144413,15 @@ components: - id type: object TagRuleScoreResourceType: - description: JSON:API resource type for a tag rule compliance score. + description: JSON:API resource type for a tag rule compliance score. Responses use `tag_policy_score`. enum: - tag_rule_score - example: "tag_rule_score" + - tag_policy_score + example: "tag_policy_score" type: string x-enum-varnames: - TAG_RULE_SCORE + - TAG_POLICY_SCORE TagRuleScoreResponse: description: A tag rule compliance score. properties: @@ -144395,6 +144450,7 @@ components: description: |- How the rule is enforced. `blocking` rejects telemetry that violates the rule. `surfacing` only highlights non-compliant telemetry without blocking it. + RUM supports only `surfacing` rules. enum: - blocking - surfacing @@ -144406,7 +144462,9 @@ components: TagRuleUpdateAttributes: description: |- Mutable attributes of a tag rule. Each field is optional; omitting a field leaves its - current value unchanged. The `source` of a rule cannot be changed. + current value unchanged. The `source` of a rule cannot be changed. Tag keys, patterns, + and metrics scopes have the same constraints as on creation. If the effective + `tag_value_patterns` contains `*`, set `required` and `negated` to different values. properties: enabled: description: Whether the rule is currently enforced. @@ -144427,12 +144485,16 @@ components: type: string tag_key: description: The tag key that the rule governs. + pattern: '^[A-Za-z0-9_.\/-]+$' type: string tag_value_patterns: description: One or more patterns that valid values for the tag key must match. items: description: A pattern that valid tag values must match. + pattern: '^[A-Za-z0-9_:.,\/*-]+$' type: string + maxItems: 30 + minItems: 1 type: array type: object TagRuleUpdateData: @@ -193239,7 +193301,7 @@ paths: required: false schema: $ref: "#/components/schemas/TagRuleSource" - - 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. + - 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`. example: 1779315066097 in: query name: ts_start @@ -193285,8 +193347,8 @@ paths: score: data: id: "123-v1-1779315066097-1779401466097" - type: "tag_rule_score" - type: "tag_rule" + type: "tag_policy_score" + type: "tag_policy" included: - attributes: score: 80 @@ -193294,7 +193356,7 @@ paths: ts_start: 1779315066097 version: 1 id: "123-v1-1779315066097-1779401466097" - type: "tag_rule_score" + type: "tag_policy_score" schema: $ref: "#/components/schemas/TagRulesListResponse" description: OK @@ -193388,7 +193450,7 @@ paths: - "web" version: 1 id: "123" - type: "tag_rule" + type: "tag_policy" schema: $ref: "#/components/schemas/TagRuleResponse" description: Created @@ -193437,7 +193499,8 @@ paths: description: |- Delete a tag rule. By default the rule is soft-deleted so it can be recovered later and so that historical score data remains queryable. Pass `hard_delete=true` to remove - the rule permanently. + the rule permanently. Deleting a `blocking` rule additionally requires the + `telemetry_rules_activate` permission. operationId: DeleteTagRule parameters: - description: The unique identifier of the tag rule to delete. @@ -193518,7 +193581,7 @@ paths: required: false schema: $ref: "#/components/schemas/TagRuleInclude" - - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + - 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`. example: 1779315066097 in: query name: ts_start @@ -193564,8 +193627,8 @@ paths: score: data: id: "123-v1-1779315066097-1779401466097" - type: "tag_rule_score" - type: "tag_rule" + type: "tag_policy_score" + type: "tag_policy" included: - attributes: score: 80 @@ -193573,7 +193636,7 @@ paths: ts_start: 1779315066097 version: 1 id: "123-v1-1779315066097-1779401466097" - type: "tag_rule_score" + type: "tag_policy_score" schema: $ref: "#/components/schemas/TagRuleResponse" description: OK @@ -193623,6 +193686,9 @@ paths: Update one or more attributes of an existing tag rule. Only the fields supplied in the request body are modified; omitted fields retain their current values. The rule's `source` cannot be changed after creation. + Promoting a rule from `surfacing` to `blocking` additionally requires the + `telemetry_rules_activate` permission, and your organization must have access to + blocking rules. You can't promote RUM rules to `blocking`. operationId: UpdateTagRule parameters: - description: The unique identifier of the tag rule to update. @@ -193673,7 +193739,7 @@ paths: - "web" version: 2 id: "123" - type: "tag_rule" + type: "tag_policy" schema: $ref: "#/components/schemas/TagRuleResponse" description: OK @@ -193733,7 +193799,7 @@ paths: required: true schema: type: string - - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + - 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`. example: 1779315066097 in: query name: ts_start @@ -193763,7 +193829,7 @@ paths: ts_start: 1779315066097 version: 1 id: "123-v1-1779315066097-1779401466097" - type: "tag_rule_score" + type: "tag_policy_score" schema: $ref: "#/components/schemas/TagRuleScoreResponse" description: OK @@ -202243,6 +202309,14 @@ paths: - filters: - $KEY:$VALUE type: gce_instance + project_filter_configs: + - filters: + - prod-* + - "!prod-legacy" + type: project_id + - filters: + - "env:prod*" + type: project_label region_filter_configs: - nam4 - europe-north1 @@ -202341,6 +202415,14 @@ paths: - filters: - $KEY:$VALUE type: gce_instance + project_filter_configs: + - filters: + - prod-* + - "!prod-legacy" + type: project_id + - filters: + - "env:prod*" + type: project_label region_filter_configs: - nam4 - europe-north1 @@ -261082,7 +261164,7 @@ paths: value: data: attributes: - company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAIKMMMM + company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== components: - name: API position: 0 @@ -261101,10 +261183,10 @@ paths: position: 2 type: component domain_prefix: status-page-us1 - email_header_image: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF - favicon: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA + email_header_image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + favicon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== name: Status Page US1 - slack_app_icon: data:image/png;base64,mXRTqw0KGgoAAAANSUhEUgAAAEAAAABACA + slack_app_icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== subscriptions_enabled: true type: public visualization_type: bars_and_uptime_percentage @@ -261414,12 +261496,12 @@ paths: value: data: attributes: - company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAIKMMMM + company_logo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== domain_prefix: status-page-us1-east - email_header_image: data:image/png;base64,pQSLAw0KGgoAAAANSUhEUgAAAQ4AASJKFF - favicon: data:image/png;base64,kWMRNw0KGgoAAAANSUhEUgAAAEAAAABACA + email_header_image: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + favicon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== name: Status Page US1 East - slack_app_icon: data:image/png;base64,mXRTqw0KGgoAAAANSUhEUgAAAEAAAABACA + slack_app_icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== subscriptions_enabled: false type: internal visualization_type: bars_only @@ -275512,7 +275594,7 @@ tags: scoped to a particular telemetry source (such as logs, spans, or metrics). Rules can be `blocking` (data not matching the rule is rejected) or `surfacing` (matching data is highlighted but not blocked). Each rule reports a compliance `score` derived from how - much recent telemetry adheres to the rule. + much recent telemetry adheres to the rule. RUM supports only `surfacing` rules. name: Tag Rules - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams diff --git a/examples/v2/tag-rules/CreateTagRule.py b/examples/v2/tag-rules/CreateTagRule.py index d5abba88c4..b377d54cca 100644 --- a/examples/v2/tag-rules/CreateTagRule.py +++ b/examples/v2/tag-rules/CreateTagRule.py @@ -20,7 +20,7 @@ negated=False, required=True, rule_type=TagRuleCreateType.SURFACING, - scope="env", + scope="env:prod", source=TagRuleSource.LOGS, tag_key="service", tag_value_patterns=[ @@ -28,7 +28,7 @@ "web", ], ), - type=TagRuleResourceType.TAG_RULE, + type=TagRuleResourceType.TAG_POLICY, ), ) diff --git a/examples/v2/tag-rules/UpdateTagRule.py b/examples/v2/tag-rules/UpdateTagRule.py index b23592dcfe..5e3d05b825 100644 --- a/examples/v2/tag-rules/UpdateTagRule.py +++ b/examples/v2/tag-rules/UpdateTagRule.py @@ -18,7 +18,7 @@ tag_value_patterns=[], ), id="123", - type=TagRuleResourceType.TAG_RULE, + type=TagRuleResourceType.TAG_POLICY, ), ) diff --git a/src/datadog_api_client/v2/api/tag_rules_api.py b/src/datadog_api_client/v2/api/tag_rules_api.py index d9795c19fe..9ac31830c5 100644 --- a/src/datadog_api_client/v2/api/tag_rules_api.py +++ b/src/datadog_api_client/v2/api/tag_rules_api.py @@ -26,7 +26,7 @@ class TagRulesApi: scoped to a particular telemetry source (such as logs, spans, or metrics). Rules can be ``blocking`` (data not matching the rule is rejected) or ``surfacing`` (matching data is highlighted but not blocked). Each rule reports a compliance ``score`` derived from how - much recent telemetry adheres to the rule. + much recent telemetry adheres to the rule. RUM supports only ``surfacing`` rules. """ def __init__(self, api_client=None): @@ -254,7 +254,8 @@ def delete_tag_rule( Delete a tag rule. By default the rule is soft-deleted so it can be recovered later and so that historical score data remains queryable. Pass ``hard_delete=true`` to remove - the rule permanently. + the rule permanently. Deleting a ``blocking`` rule additionally requires the + ``telemetry_rules_activate`` permission. :param rule_id: The unique identifier of the tag rule to delete. :type rule_id: str @@ -288,7 +289,7 @@ def get_tag_rule( :type rule_id: str :param include: Comma-separated list of related resources to include alongside the rule. Currently the only supported value is ``score``. :type include: TagRuleInclude, optional - :param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + :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``. :type ts_start: int, optional :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``. :type ts_end: int, optional @@ -324,7 +325,7 @@ def get_tag_rule_score( :param rule_id: The unique identifier of the tag rule. :type rule_id: str - :param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + :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``. :type ts_start: int, optional :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``. :type ts_end: int, optional @@ -365,7 +366,7 @@ def list_tag_rules( :type include: TagRuleInclude, optional :param filter_source: Restrict the result set to rules whose source matches the given value. :type filter_source: TagRuleSource, optional - :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. + :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``. :type ts_start: int, optional :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``. :type ts_end: int, optional @@ -402,6 +403,9 @@ def update_tag_rule( Update one or more attributes of an existing tag rule. Only the fields supplied in the request body are modified; omitted fields retain their current values. The rule's ``source`` cannot be changed after creation. + Promoting a rule from ``surfacing`` to ``blocking`` additionally requires the + ``telemetry_rules_activate`` permission, and your organization must have access to + blocking rules. You can't promote RUM rules to ``blocking``. :param rule_id: The unique identifier of the tag rule to update. :type rule_id: str diff --git a/src/datadog_api_client/v2/model/gcp_project_filter_config.py b/src/datadog_api_client/v2/model/gcp_project_filter_config.py new file mode 100644 index 0000000000..6fced9abff --- /dev/null +++ b/src/datadog_api_client/v2/model/gcp_project_filter_config.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.gcp_project_filter_config_type import GCPProjectFilterConfigType + + +class GCPProjectFilterConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.gcp_project_filter_config_type import GCPProjectFilterConfigType + + return { + "filters": ([str],), + "type": (GCPProjectFilterConfigType,), + } + + attribute_map = { + "filters": "filters", + "type": "type", + } + + def __init__( + self_, + filters: Union[List[str], UnsetType] = unset, + type: Union[GCPProjectFilterConfigType, UnsetType] = unset, + **kwargs, + ): + """ + Configuration for filtering the GCP projects that Datadog monitors by project ID or by project label. + + :param filters: List of filters matched against the project field set by ``type``. Filters support the ``*`` and ``?`` + wildcards, and a leading ``!`` makes a filter an exclusion. A project is skipped if it matches any + exclusion filter. When inclusion filters are set, a project must also match at least one of them. + For ``project_id`` , each filter is a project ID pattern, such as ``prod-*``. You can set up to 15,000 + filters. For ``project_label`` , each filter is a label in the form ``key:value`` , such as ``env:prod*``. + You can set up to 100 filters. Keys are matched exactly, and wildcards apply only to values, so + ``key:*`` matches any value. + :type filters: [str], optional + + :param type: The GCP project field that the filters are matched against. + :type type: GCPProjectFilterConfigType, optional + """ + if filters is not unset: + kwargs["filters"] = filters + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/gcp_project_filter_config_type.py b/src/datadog_api_client/v2/model/gcp_project_filter_config_type.py new file mode 100644 index 0000000000..f6a2a42ba0 --- /dev/null +++ b/src/datadog_api_client/v2/model/gcp_project_filter_config_type.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class GCPProjectFilterConfigType(ModelSimple): + """ + The GCP project field that the filters are matched against. + + :param value: Must be one of ["project_id", "project_label"]. + :type value: str + """ + + allowed_values = { + "project_id", + "project_label", + } + PROJECT_ID: ClassVar["GCPProjectFilterConfigType"] + PROJECT_LABEL: ClassVar["GCPProjectFilterConfigType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +GCPProjectFilterConfigType.PROJECT_ID = GCPProjectFilterConfigType("project_id") +GCPProjectFilterConfigType.PROJECT_LABEL = GCPProjectFilterConfigType("project_label") diff --git a/src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py b/src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py index a1449f45d6..4f9ef1e65c 100644 --- a/src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py +++ b/src/datadog_api_client/v2/model/gcpsts_service_account_attributes.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.gcp_metric_namespace_config import GCPMetricNamespaceConfig from datadog_api_client.v2.model.gcp_monitored_resource_config import GCPMonitoredResourceConfig + from datadog_api_client.v2.model.gcp_project_filter_config import GCPProjectFilterConfig class GCPSTSServiceAccountAttributes(ModelNormal): @@ -23,6 +24,7 @@ class GCPSTSServiceAccountAttributes(ModelNormal): def openapi_types(_): from datadog_api_client.v2.model.gcp_metric_namespace_config import GCPMetricNamespaceConfig from datadog_api_client.v2.model.gcp_monitored_resource_config import GCPMonitoredResourceConfig + from datadog_api_client.v2.model.gcp_project_filter_config import GCPProjectFilterConfig return { "account_tags": ([str],), @@ -38,6 +40,7 @@ def openapi_types(_): "is_security_command_center_enabled": (bool,), "metric_namespace_configs": ([GCPMetricNamespaceConfig],), "monitored_resource_configs": ([GCPMonitoredResourceConfig],), + "project_filter_configs": ([GCPProjectFilterConfig],), "region_filter_configs": ([str],), "resource_collection_enabled": (bool,), } @@ -56,6 +59,7 @@ def openapi_types(_): "is_security_command_center_enabled": "is_security_command_center_enabled", "metric_namespace_configs": "metric_namespace_configs", "monitored_resource_configs": "monitored_resource_configs", + "project_filter_configs": "project_filter_configs", "region_filter_configs": "region_filter_configs", "resource_collection_enabled": "resource_collection_enabled", } @@ -75,6 +79,7 @@ def __init__( is_security_command_center_enabled: Union[bool, UnsetType] = unset, metric_namespace_configs: Union[List[GCPMetricNamespaceConfig], UnsetType] = unset, monitored_resource_configs: Union[List[GCPMonitoredResourceConfig], UnsetType] = unset, + project_filter_configs: Union[List[GCPProjectFilterConfig], UnsetType] = unset, region_filter_configs: Union[List[str], UnsetType] = unset, resource_collection_enabled: Union[bool, UnsetType] = unset, **kwargs, @@ -126,6 +131,13 @@ def __init__( :param monitored_resource_configs: Configurations for GCP monitored resources. :type monitored_resource_configs: [GCPMonitoredResourceConfig], optional + :param project_filter_configs: Configurations that limit which GCP projects Datadog monitors, out of the projects this service + account can access. Each type can have at most one configuration. A project is monitored only if + it passes the filters of every configured type. By default, Datadog monitors every project the + service account can access. When updating a service account, omit this field to keep the current + filters, or send an empty list to remove them. + :type project_filter_configs: [GCPProjectFilterConfig], optional + :param region_filter_configs: Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations. :type region_filter_configs: [str], optional @@ -158,6 +170,8 @@ def __init__( kwargs["metric_namespace_configs"] = metric_namespace_configs if monitored_resource_configs is not unset: kwargs["monitored_resource_configs"] = monitored_resource_configs + if project_filter_configs is not unset: + kwargs["project_filter_configs"] = project_filter_configs if region_filter_configs is not unset: kwargs["region_filter_configs"] = region_filter_configs if resource_collection_enabled is not unset: diff --git a/src/datadog_api_client/v2/model/tag_rule_attributes.py b/src/datadog_api_client/v2/model/tag_rule_attributes.py index 953282eabc..338bf0d816 100644 --- a/src/datadog_api_client/v2/model/tag_rule_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_attributes.py @@ -119,6 +119,7 @@ def __init__( :param rule_type: How the rule is enforced. ``blocking`` rejects telemetry that violates the rule. ``surfacing`` only highlights non-compliant telemetry without blocking it. + RUM supports only ``surfacing`` rules. :type rule_type: TagRuleType :param scope: The scope the rule applies within. diff --git a/src/datadog_api_client/v2/model/tag_rule_create_attributes.py b/src/datadog_api_client/v2/model/tag_rule_create_attributes.py index 4f51780356..d9a024a705 100644 --- a/src/datadog_api_client/v2/model/tag_rule_create_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_create_attributes.py @@ -20,7 +20,9 @@ class TagRuleCreateAttributes(ModelNormal): validations = { + "tag_key": {}, "tag_value_patterns": { + "max_items": 30, "min_items": 1, }, } @@ -68,9 +70,11 @@ def __init__( **kwargs, ): """ - Attributes that can be supplied when creating a tag rule. + Attributes that can be supplied when creating a tag rule. If ``tag_value_patterns`` + contains ``*`` , set ``required`` and ``negated`` to different values. If both are ``false`` , + the rule has no effect. If both are ``true`` , no value can satisfy the rule. - :param enabled: Whether the rule is currently enforced. Defaults to ``true`` for newly created rules. + :param enabled: The API ignores this value on creation and always enables new rules. To disable a rule, use the "Update a tag rule" endpoint. :type enabled: bool, optional :param name: Human-readable name for the tag rule. @@ -86,18 +90,23 @@ def __init__( creation time. :type rule_type: TagRuleCreateType - :param scope: The scope the rule applies within. Typically an environment, team, or - organization-level identifier used to limit where the rule is enforced. + :param scope: The scope the rule applies within. For logs and spans, use a search query, such + as ``env:prod`` , or ``*`` to match all telemetry. For metrics, use a metric selector + with an optional tag filter, such as ``system.cpu.*{env:prod}``. A metric wildcard + is allowed only once, at the end of the metric selector. :type scope: str :param source: The telemetry source that a tag rule applies to. :type source: TagRuleSource - :param tag_key: The tag key that the rule governs (for example, ``service`` ). + :param tag_key: The tag key that the rule governs (for example, ``service`` ). Allowed characters + are ASCII letters, digits, underscores, hyphens, periods, and slashes. The keys + ``host`` and ``device`` are not supported in any letter case. :type tag_key: str - :param tag_value_patterns: One or more patterns that valid values for the tag key must match. At least one - pattern is required. + :param tag_value_patterns: Between 1 and 30 non-empty patterns that valid values for the tag key must match. + Allowed characters are ASCII letters, digits, underscores, colons, hyphens, + periods, commas, slashes, and asterisks. :type tag_value_patterns: [str] """ if enabled is not unset: diff --git a/src/datadog_api_client/v2/model/tag_rule_create_data.py b/src/datadog_api_client/v2/model/tag_rule_create_data.py index 2358c06603..b31fe1fc50 100644 --- a/src/datadog_api_client/v2/model/tag_rule_create_data.py +++ b/src/datadog_api_client/v2/model/tag_rule_create_data.py @@ -36,10 +36,12 @@ def __init__(self_, attributes: TagRuleCreateAttributes, type: TagRuleResourceTy """ Data object for creating a tag rule. - :param attributes: Attributes that can be supplied when creating a tag rule. + :param attributes: Attributes that can be supplied when creating a tag rule. If ``tag_value_patterns`` + contains ``*`` , set ``required`` and ``negated`` to different values. If both are ``false`` , + the rule has no effect. If both are ``true`` , no value can satisfy the rule. :type attributes: TagRuleCreateAttributes - :param type: JSON:API resource type for a tag rule. + :param type: JSON:API resource type for a tag rule. Requests accept ``tag_rule`` or ``tag_policy`` ; responses use ``tag_policy``. :type type: TagRuleResourceType """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_rule_data.py b/src/datadog_api_client/v2/model/tag_rule_data.py index 5f5c427f74..745b3dd9a8 100644 --- a/src/datadog_api_client/v2/model/tag_rule_data.py +++ b/src/datadog_api_client/v2/model/tag_rule_data.py @@ -60,7 +60,7 @@ def __init__( :param relationships: Related resources for a tag rule. Only present when the corresponding ``include`` query parameter is supplied. :type relationships: TagRuleRelationships, optional - :param type: JSON:API resource type for a tag rule. + :param type: JSON:API resource type for a tag rule. Requests accept ``tag_rule`` or ``tag_policy`` ; responses use ``tag_policy``. :type type: TagRuleResourceType """ if relationships is not unset: diff --git a/src/datadog_api_client/v2/model/tag_rule_resource_type.py b/src/datadog_api_client/v2/model/tag_rule_resource_type.py index 436f4ba020..388e167600 100644 --- a/src/datadog_api_client/v2/model/tag_rule_resource_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_resource_type.py @@ -14,16 +14,18 @@ class TagRuleResourceType(ModelSimple): """ - JSON:API resource type for a tag rule. + JSON:API resource type for a tag rule. Requests accept `tag_rule` or `tag_policy`; responses use `tag_policy`. - :param value: If omitted defaults to "tag_rule". Must be one of ["tag_rule"]. + :param value: Must be one of ["tag_rule", "tag_policy"]. :type value: str """ allowed_values = { "tag_rule", + "tag_policy", } TAG_RULE: ClassVar["TagRuleResourceType"] + TAG_POLICY: ClassVar["TagRuleResourceType"] @cached_property def openapi_types(_): @@ -33,3 +35,4 @@ def openapi_types(_): TagRuleResourceType.TAG_RULE = TagRuleResourceType("tag_rule") +TagRuleResourceType.TAG_POLICY = TagRuleResourceType("tag_policy") diff --git a/src/datadog_api_client/v2/model/tag_rule_score_data.py b/src/datadog_api_client/v2/model/tag_rule_score_data.py index 8a6e731024..68ee0ce629 100644 --- a/src/datadog_api_client/v2/model/tag_rule_score_data.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_data.py @@ -44,7 +44,7 @@ def __init__(self_, attributes: TagRuleScoreAttributes, id: str, type: TagRuleSc :param id: The unique identifier of the compliance score resource. :type id: str - :param type: JSON:API resource type for a tag rule compliance score. + :param type: JSON:API resource type for a tag rule compliance score. Responses use ``tag_policy_score``. :type type: TagRuleScoreResourceType """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py b/src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py index 2b7603a714..49f682a7d6 100644 --- a/src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py @@ -37,7 +37,7 @@ def __init__(self_, id: str, type: TagRuleScoreResourceType, **kwargs): :param id: The unique identifier of the related compliance score resource. :type id: str - :param type: JSON:API resource type for a tag rule compliance score. + :param type: JSON:API resource type for a tag rule compliance score. Responses use ``tag_policy_score``. :type type: TagRuleScoreResourceType """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_rule_score_resource_type.py b/src/datadog_api_client/v2/model/tag_rule_score_resource_type.py index c327bc9147..c55a6b30f8 100644 --- a/src/datadog_api_client/v2/model/tag_rule_score_resource_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_resource_type.py @@ -14,16 +14,18 @@ class TagRuleScoreResourceType(ModelSimple): """ - JSON:API resource type for a tag rule compliance score. + JSON:API resource type for a tag rule compliance score. Responses use `tag_policy_score`. - :param value: If omitted defaults to "tag_rule_score". Must be one of ["tag_rule_score"]. + :param value: Must be one of ["tag_rule_score", "tag_policy_score"]. :type value: str """ allowed_values = { "tag_rule_score", + "tag_policy_score", } TAG_RULE_SCORE: ClassVar["TagRuleScoreResourceType"] + TAG_POLICY_SCORE: ClassVar["TagRuleScoreResourceType"] @cached_property def openapi_types(_): @@ -33,3 +35,4 @@ def openapi_types(_): TagRuleScoreResourceType.TAG_RULE_SCORE = TagRuleScoreResourceType("tag_rule_score") +TagRuleScoreResourceType.TAG_POLICY_SCORE = TagRuleScoreResourceType("tag_policy_score") diff --git a/src/datadog_api_client/v2/model/tag_rule_type.py b/src/datadog_api_client/v2/model/tag_rule_type.py index 2af092988b..a9435a8b4d 100644 --- a/src/datadog_api_client/v2/model/tag_rule_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_type.py @@ -16,6 +16,7 @@ class TagRuleType(ModelSimple): """ How the rule is enforced. `blocking` rejects telemetry that violates the rule. `surfacing` only highlights non-compliant telemetry without blocking it. + RUM supports only `surfacing` rules. :param value: Must be one of ["blocking", "surfacing"]. :type value: str diff --git a/src/datadog_api_client/v2/model/tag_rule_update_attributes.py b/src/datadog_api_client/v2/model/tag_rule_update_attributes.py index 6d9f7e2e88..9bbeebe729 100644 --- a/src/datadog_api_client/v2/model/tag_rule_update_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_update_attributes.py @@ -18,6 +18,14 @@ class TagRuleUpdateAttributes(ModelNormal): + validations = { + "tag_key": {}, + "tag_value_patterns": { + "max_items": 30, + "min_items": 1, + }, + } + @cached_property def openapi_types(_): from datadog_api_client.v2.model.tag_rule_type import TagRuleType @@ -58,7 +66,9 @@ def __init__( ): """ Mutable attributes of a tag rule. Each field is optional; omitting a field leaves its - current value unchanged. The ``source`` of a rule cannot be changed. + current value unchanged. The ``source`` of a rule cannot be changed. Tag keys, patterns, + and metrics scopes have the same constraints as on creation. If the effective + ``tag_value_patterns`` contains ``*`` , set ``required`` and ``negated`` to different values. :param enabled: Whether the rule is currently enforced. :type enabled: bool, optional @@ -74,6 +84,7 @@ def __init__( :param rule_type: How the rule is enforced. ``blocking`` rejects telemetry that violates the rule. ``surfacing`` only highlights non-compliant telemetry without blocking it. + RUM supports only ``surfacing`` rules. :type rule_type: TagRuleType, optional :param scope: The scope the rule applies within. diff --git a/src/datadog_api_client/v2/model/tag_rule_update_data.py b/src/datadog_api_client/v2/model/tag_rule_update_data.py index 4f9ab84d0c..c5931a7d4f 100644 --- a/src/datadog_api_client/v2/model/tag_rule_update_data.py +++ b/src/datadog_api_client/v2/model/tag_rule_update_data.py @@ -47,13 +47,15 @@ def __init__( Data object for updating a tag rule. :param attributes: Mutable attributes of a tag rule. Each field is optional; omitting a field leaves its - current value unchanged. The ``source`` of a rule cannot be changed. + current value unchanged. The ``source`` of a rule cannot be changed. Tag keys, patterns, + and metrics scopes have the same constraints as on creation. If the effective + ``tag_value_patterns`` contains ``*`` , set ``required`` and ``negated`` to different values. :type attributes: TagRuleUpdateAttributes, optional :param id: The unique identifier of the tag rule being updated. :type id: str - :param type: JSON:API resource type for a tag rule. + :param type: JSON:API resource type for a tag rule. Requests accept ``tag_rule`` or ``tag_policy`` ; responses use ``tag_policy``. :type type: TagRuleResourceType """ if attributes is not unset: diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index b0d4e01452..fec4b3ddf9 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4768,6 +4768,8 @@ from datadog_api_client.v2.model.gcp_metric_namespace_config import GCPMetricNamespaceConfig from datadog_api_client.v2.model.gcp_monitored_resource_config import GCPMonitoredResourceConfig from datadog_api_client.v2.model.gcp_monitored_resource_config_type import GCPMonitoredResourceConfigType +from datadog_api_client.v2.model.gcp_project_filter_config import GCPProjectFilterConfig +from datadog_api_client.v2.model.gcp_project_filter_config_type import GCPProjectFilterConfigType from datadog_api_client.v2.model.gcpsts_delegate_account import GCPSTSDelegateAccount from datadog_api_client.v2.model.gcpsts_delegate_account_attributes import GCPSTSDelegateAccountAttributes from datadog_api_client.v2.model.gcpsts_delegate_account_response import GCPSTSDelegateAccountResponse @@ -17301,6 +17303,8 @@ "GCPMetricNamespaceConfig", "GCPMonitoredResourceConfig", "GCPMonitoredResourceConfigType", + "GCPProjectFilterConfig", + "GCPProjectFilterConfigType", "GCPSTSDelegateAccount", "GCPSTSDelegateAccountAttributes", "GCPSTSDelegateAccountResponse", diff --git a/tests/v2/features/gcp_integration.feature b/tests/v2/features/gcp_integration.feature index a57193d2b9..2e455ed1ef 100644 --- a/tests/v2/features/gcp_integration.feature +++ b/tests/v2/features/gcp_integration.feature @@ -34,14 +34,14 @@ Feature: GCP Integration @generated @skip @team:ddoghq/gcp-integrations Scenario: Create a new entry for your service account returns "Bad Request" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "region_filter_configs": ["nam4", "europe-north1"]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:ddoghq/gcp-integrations Scenario: Create a new entry for your service account returns "Conflict" response Given new "CreateGCPSTSAccount" request - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "region_filter_configs": ["nam4", "europe-north1"]}, "type": "gcp_service_account"}} When the request is sent Then the response status is 409 Conflict @@ -161,7 +161,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Bad Request" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 400 Bad Request @@ -169,7 +169,7 @@ Feature: GCP Integration Scenario: Update STS Service Account returns "Not Found" response Given new "UpdateGCPSTSAccount" request And request contains "account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} + And body with value {"data": {"attributes": {"account_tags": [], "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com", "cloud_run_revision_filters": ["$KEY:$VALUE"], "host_filters": ["$KEY:$VALUE"], "is_global_location_enabled": true, "is_org_folder_resource_collection_enabled": false, "is_per_project_quota_enabled": true, "is_resource_change_collection_enabled": true, "is_security_command_center_enabled": true, "metric_namespace_configs": [{"disabled": true, "id": "aiplatform"}, {"filters": ["snapshot.*", "!*_by_region"], "id": "pubsub"}], "monitored_resource_configs": [{"filters": ["$KEY:$VALUE"], "type": "gce_instance"}], "project_filter_configs": [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}], "region_filter_configs": ["nam4", "europe-north1"]}, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account"}} When the request is sent Then the response status is 404 Not Found diff --git a/tests/v2/features/tag_rules.feature b/tests/v2/features/tag_rules.feature index 1d70a47958..be904add87 100644 --- a/tests/v2/features/tag_rules.feature +++ b/tests/v2/features/tag_rules.feature @@ -5,7 +5,7 @@ Feature: Tag Rules spans, or metrics). Rules can be `blocking` (data not matching the rule is rejected) or `surfacing` (matching data is highlighted but not blocked). Each rule reports a compliance `score` derived from how much recent - telemetry adheres to the rule. + telemetry adheres to the rule. RUM supports only `surfacing` rules. Background: Given a valid "apiKeyAuth" key in the system @@ -16,7 +16,7 @@ Feature: Tag Rules Scenario: Create a tag rule returns "Bad Request" response Given operation "CreateTagRule" enabled And new "CreateTagRule" request - And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_rule"}} + And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env:prod", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_policy"}} When the request is sent Then the response status is 400 Bad Request @@ -24,7 +24,7 @@ Feature: Tag Rules Scenario: Create a tag rule returns "Conflict" response Given operation "CreateTagRule" enabled And new "CreateTagRule" request - And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_rule"}} + And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env:prod", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_policy"}} When the request is sent Then the response status is 409 Conflict @@ -32,7 +32,7 @@ Feature: Tag Rules Scenario: Create a tag rule returns "Created" response Given operation "CreateTagRule" enabled And new "CreateTagRule" request - And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_rule"}} + And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env:prod", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_policy"}} When the request is sent Then the response status is 201 Created @@ -127,7 +127,7 @@ Feature: Tag Rules Given operation "UpdateTagRule" enabled And new "UpdateTagRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_rule"}} + And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} When the request is sent Then the response status is 400 Bad Request @@ -136,7 +136,7 @@ Feature: Tag Rules Given operation "UpdateTagRule" enabled And new "UpdateTagRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_rule"}} + And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} When the request is sent Then the response status is 404 Not Found @@ -145,6 +145,6 @@ Feature: Tag Rules Given operation "UpdateTagRule" enabled And new "UpdateTagRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_rule"}} + And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} When the request is sent Then the response status is 200 OK