From 6315104ea28b038e70ba7a4e2b0021482d4411b4 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 7 Aug 2026 13:37:51 +0000 Subject: [PATCH] Regenerate client from commit 5addd6e of spec repo --- .generator/schemas/v2/openapi.yaml | 326 +++++++++--------- docs/datadog_api_client.v2.api.rst | 6 +- docs/datadog_api_client.v2.model.rst | 132 +++---- examples/v2/tag-policies/CreateTagPolicy.py | 40 --- examples/v2/tag-policies/DeleteTagPolicy.py | 14 - examples/v2/tag-policies/GetTagPolicy.py | 16 - examples/v2/tag-policies/GetTagPolicyScore.py | 16 - examples/v2/tag-policies/ListTagPolicies.py | 14 - examples/v2/tag-policies/UpdateTagPolicy.py | 30 -- examples/v2/tag-rules/CreateTagRule.py | 40 +++ examples/v2/tag-rules/DeleteTagRule.py | 14 + examples/v2/tag-rules/GetTagRule.py | 16 + examples/v2/tag-rules/GetTagRuleScore.py | 16 + examples/v2/tag-rules/ListTagRules.py | 14 + examples/v2/tag-rules/UpdateTagRule.py | 30 ++ src/datadog_api_client/configuration.py | 12 +- .../{tag_policies_api.py => tag_rules_api.py} | 188 +++++----- src/datadog_api_client/v2/apis/__init__.py | 4 +- .../v2/model/tag_policies_list_response.py | 53 --- .../v2/model/tag_policy_create_data.py | 48 --- .../v2/model/tag_policy_data.py | 72 ---- .../v2/model/tag_policy_score_data.py | 54 --- .../v2/model/tag_policy_source.py | 47 --- .../v2/model/tag_policy_update_data.py | 64 ---- ...y_attributes.py => tag_rule_attributes.py} | 50 +-- ...butes.py => tag_rule_create_attributes.py} | 40 +-- .../v2/model/tag_rule_create_data.py | 48 +++ ...response.py => tag_rule_create_request.py} | 16 +- ...create_type.py => tag_rule_create_type.py} | 8 +- .../v2/model/tag_rule_data.py | 72 ++++ ..._policy_include.py => tag_rule_include.py} | 8 +- ...tionships.py => tag_rule_relationships.py} | 16 +- ...urce_type.py => tag_rule_resource_type.py} | 8 +- ...olicy_response.py => tag_rule_response.py} | 26 +- ...ibutes.py => tag_rule_score_attributes.py} | 8 +- .../v2/model/tag_rule_score_data.py | 54 +++ ...ship.py => tag_rule_score_relationship.py} | 14 +- ...py => tag_rule_score_relationship_data.py} | 14 +- ...ype.py => tag_rule_score_resource_type.py} | 8 +- ..._request.py => tag_rule_score_response.py} | 16 +- .../v2/model/tag_rule_source.py | 41 +++ .../{tag_policy_type.py => tag_rule_type.py} | 12 +- ...butes.py => tag_rule_update_attributes.py} | 28 +- .../v2/model/tag_rule_update_data.py | 64 ++++ ..._request.py => tag_rule_update_request.py} | 16 +- .../v2/model/tag_rules_list_response.py | 51 +++ src/datadog_api_client/v2/models/__init__.py | 88 ++--- ...tag_policies.feature => tag_rules.feature} | 118 +++---- tests/v2/features/undo.json | 26 +- 49 files changed, 1052 insertions(+), 1064 deletions(-) delete mode 100644 examples/v2/tag-policies/CreateTagPolicy.py delete mode 100644 examples/v2/tag-policies/DeleteTagPolicy.py delete mode 100644 examples/v2/tag-policies/GetTagPolicy.py delete mode 100644 examples/v2/tag-policies/GetTagPolicyScore.py delete mode 100644 examples/v2/tag-policies/ListTagPolicies.py delete mode 100644 examples/v2/tag-policies/UpdateTagPolicy.py create mode 100644 examples/v2/tag-rules/CreateTagRule.py create mode 100644 examples/v2/tag-rules/DeleteTagRule.py create mode 100644 examples/v2/tag-rules/GetTagRule.py create mode 100644 examples/v2/tag-rules/GetTagRuleScore.py create mode 100644 examples/v2/tag-rules/ListTagRules.py create mode 100644 examples/v2/tag-rules/UpdateTagRule.py rename src/datadog_api_client/v2/api/{tag_policies_api.py => tag_rules_api.py} (65%) delete mode 100644 src/datadog_api_client/v2/model/tag_policies_list_response.py delete mode 100644 src/datadog_api_client/v2/model/tag_policy_create_data.py delete mode 100644 src/datadog_api_client/v2/model/tag_policy_data.py delete mode 100644 src/datadog_api_client/v2/model/tag_policy_score_data.py delete mode 100644 src/datadog_api_client/v2/model/tag_policy_source.py delete mode 100644 src/datadog_api_client/v2/model/tag_policy_update_data.py rename src/datadog_api_client/v2/model/{tag_policy_attributes.py => tag_rule_attributes.py} (71%) rename src/datadog_api_client/v2/model/{tag_policy_create_attributes.py => tag_rule_create_attributes.py} (64%) create mode 100644 src/datadog_api_client/v2/model/tag_rule_create_data.py rename src/datadog_api_client/v2/model/{tag_policy_score_response.py => tag_rule_create_request.py} (57%) rename src/datadog_api_client/v2/model/{tag_policy_create_type.py => tag_rule_create_type.py} (74%) create mode 100644 src/datadog_api_client/v2/model/tag_rule_data.py rename src/datadog_api_client/v2/model/{tag_policy_include.py => tag_rule_include.py} (72%) rename src/datadog_api_client/v2/model/{tag_policy_relationships.py => tag_rule_relationships.py} (55%) rename src/datadog_api_client/v2/model/{tag_policy_resource_type.py => tag_rule_resource_type.py} (76%) rename src/datadog_api_client/v2/model/{tag_policy_response.py => tag_rule_response.py} (50%) rename src/datadog_api_client/v2/model/{tag_policy_score_attributes.py => tag_rule_score_attributes.py} (83%) create mode 100644 src/datadog_api_client/v2/model/tag_rule_score_data.py rename src/datadog_api_client/v2/model/{tag_policy_score_relationship.py => tag_rule_score_relationship.py} (62%) rename src/datadog_api_client/v2/model/{tag_policy_score_relationship_data.py => tag_rule_score_relationship_data.py} (62%) rename src/datadog_api_client/v2/model/{tag_policy_score_resource_type.py => tag_rule_score_resource_type.py} (72%) rename src/datadog_api_client/v2/model/{tag_policy_create_request.py => tag_rule_score_response.py} (56%) create mode 100644 src/datadog_api_client/v2/model/tag_rule_source.py rename src/datadog_api_client/v2/model/{tag_policy_type.py => tag_rule_type.py} (70%) rename src/datadog_api_client/v2/model/{tag_policy_update_attributes.py => tag_rule_update_attributes.py} (73%) create mode 100644 src/datadog_api_client/v2/model/tag_rule_update_data.py rename src/datadog_api_client/v2/model/{tag_policy_update_request.py => tag_rule_update_request.py} (54%) create mode 100644 src/datadog_api_client/v2/model/tag_rules_list_response.py rename tests/v2/features/{tag_policies.feature => tag_rules.feature} (60%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 397d1a8cdc..7d7dff6530 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -110560,72 +110560,62 @@ components: format: int64 type: integer type: object - TagPoliciesListResponse: - description: A page of tag policies. - properties: - data: - $ref: "#/components/schemas/TagPolicyDataArray" - included: - $ref: "#/components/schemas/TagPolicyIncludedResources" - required: - - data - type: object - TagPolicyAttributes: - description: The attributes of a tag policy resource. + TagRuleAttributes: + description: The attributes of a tag rule resource. properties: created_at: - description: The RFC 3339 timestamp at which the policy was created. + description: The RFC 3339 timestamp at which the rule was created. example: "2026-05-21T22:11:06.108696Z" format: date-time type: string created_by: - description: The identifier of the user who created the policy. + description: The identifier of the user who created the rule. example: "test-user" type: string deleted_at: - description: The RFC 3339 timestamp at which the policy was soft-deleted. `null` if the policy has not been deleted. Only present when `include_deleted=true` is requested. + description: The RFC 3339 timestamp at which the rule was soft-deleted. `null` if the rule has not been deleted. Only present when `include_deleted=true` is requested. format: date-time nullable: true type: string deleted_by: - description: The identifier of the user who soft-deleted the policy. `null` if the policy has not been deleted. + description: The identifier of the user who soft-deleted the rule. `null` if the rule has not been deleted. nullable: true type: string enabled: - description: Whether the policy is currently enforced. + description: Whether the rule is currently enforced. example: true type: boolean modified_at: - description: The RFC 3339 timestamp at which the policy was last modified. + description: The RFC 3339 timestamp at which the rule was last modified. example: "2026-05-21T22:11:06.108696Z" format: date-time type: string modified_by: - description: The identifier of the user who last modified the policy. + description: The identifier of the user who last modified the rule. example: "test-user" type: string negated: - description: When `true`, the policy matches tag values that do NOT match any of the supplied patterns. + description: When `true`, the rule matches tag values that do NOT match any of the supplied patterns. example: false type: boolean policy_name: - description: Human-readable name for the tag policy. + description: Human-readable name for the tag rule. example: "Service tag must be one of api or web" type: string policy_type: - $ref: "#/components/schemas/TagPolicyType" + $ref: "#/components/schemas/TagRuleType" required: description: When `true`, telemetry without this tag is treated as a violation. example: true type: boolean scope: - description: The scope the policy applies within. + description: The scope the rule applies within. example: "env" type: string source: - $ref: "#/components/schemas/TagPolicySource" + $ref: "#/components/schemas/TagRuleSource" tag_key: - description: The tag key that the policy governs. + description: The tag key that the rule governs. example: "service" type: string tag_value_patterns: @@ -110658,37 +110648,37 @@ components: - modified_at - modified_by type: object - TagPolicyCreateAttributes: - description: Attributes that can be supplied when creating a tag policy. + TagRuleCreateAttributes: + description: Attributes that can be supplied when creating a tag rule. properties: enabled: - description: Whether the policy is currently enforced. Defaults to `true` for newly created policies. + description: Whether the rule is currently enforced. Defaults to `true` for newly created rules. example: true type: boolean negated: - description: When `true`, the policy matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. + description: When `true`, the rule matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. example: false type: boolean policy_name: - description: Human-readable name for the tag policy. + description: Human-readable name for the tag rule. example: "Service tag must be one of api or web" type: string policy_type: - $ref: "#/components/schemas/TagPolicyCreateType" + $ref: "#/components/schemas/TagRuleCreateType" required: description: When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. example: true type: boolean scope: description: |- - The scope the policy applies within. Typically an environment, team, or - organization-level identifier used to limit where the policy is enforced. + The scope the rule applies within. Typically an environment, team, or + organization-level identifier used to limit where the rule is enforced. example: "env" type: string source: - $ref: "#/components/schemas/TagPolicySource" + $ref: "#/components/schemas/TagRuleSource" tag_key: - description: The tag key that the policy governs (for example, `service`). + description: The tag key that the rule governs (for example, `service`). example: "service" type: string tag_value_patterns: @@ -110711,28 +110701,28 @@ components: - tag_value_patterns - policy_type type: object - TagPolicyCreateData: - description: Data object for creating a tag policy. + TagRuleCreateData: + description: Data object for creating a tag rule. properties: attributes: - $ref: "#/components/schemas/TagPolicyCreateAttributes" + $ref: "#/components/schemas/TagRuleCreateAttributes" type: - $ref: "#/components/schemas/TagPolicyResourceType" + $ref: "#/components/schemas/TagRuleResourceType" required: - type - attributes type: object - TagPolicyCreateRequest: - description: Payload for creating a new tag policy. + TagRuleCreateRequest: + description: Payload for creating a new tag rule. properties: data: - $ref: "#/components/schemas/TagPolicyCreateData" + $ref: "#/components/schemas/TagRuleCreateData" required: - data type: object - TagPolicyCreateType: + TagRuleCreateType: description: |- - The policy type allowed when creating a tag policy. Only `surfacing` is accepted at + The rule type allowed when creating a tag rule. Only `surfacing` is accepted at creation time. enum: - surfacing @@ -110740,72 +110730,72 @@ components: type: string x-enum-varnames: - SURFACING - TagPolicyData: - description: A tag policy resource. + TagRuleData: + description: A tag rule resource. properties: attributes: - $ref: "#/components/schemas/TagPolicyAttributes" + $ref: "#/components/schemas/TagRuleAttributes" id: - description: The unique identifier of the tag policy. + description: The unique identifier of the tag rule. example: "123" type: string relationships: - $ref: "#/components/schemas/TagPolicyRelationships" + $ref: "#/components/schemas/TagRuleRelationships" type: - $ref: "#/components/schemas/TagPolicyResourceType" + $ref: "#/components/schemas/TagRuleResourceType" required: - type - id - attributes type: object - TagPolicyDataArray: - description: An array of tag policy data objects. + TagRuleDataArray: + description: An array of tag rule data objects. items: - $ref: "#/components/schemas/TagPolicyData" + $ref: "#/components/schemas/TagRuleData" type: array - TagPolicyInclude: - description: A related resource to include alongside a tag policy in the response. Currently the only supported value is `score`. + TagRuleInclude: + description: A related resource to include alongside a tag rule in the response. Currently the only supported value is `score`. enum: - score example: "score" type: string x-enum-varnames: - SCORE - TagPolicyIncludedResources: - description: Related resources fetched alongside the primary tag policies. Populated when an `include` query parameter is supplied. + TagRuleIncludedResources: + description: Related resources fetched alongside the primary tag rules. Populated when an `include` query parameter is supplied. items: - $ref: "#/components/schemas/TagPolicyScoreData" + $ref: "#/components/schemas/TagRuleScoreData" type: array - TagPolicyRelationships: - description: Related resources for a tag policy. Only present when the corresponding `include` query parameter is supplied. + TagRuleRelationships: + description: Related resources for a tag rule. Only present when the corresponding `include` query parameter is supplied. properties: score: - $ref: "#/components/schemas/TagPolicyScoreRelationship" + $ref: "#/components/schemas/TagRuleScoreRelationship" type: object - TagPolicyResourceType: - description: JSON:API resource type for a tag policy. + TagRuleResourceType: + description: JSON:API resource type for a tag rule. enum: - tag_policy example: "tag_policy" type: string x-enum-varnames: - TAG_POLICY - TagPolicyResponse: - description: A single tag policy. + TagRuleResponse: + description: A single tag rule. properties: data: - $ref: "#/components/schemas/TagPolicyData" + $ref: "#/components/schemas/TagRuleData" included: - $ref: "#/components/schemas/TagPolicyIncludedResources" + $ref: "#/components/schemas/TagRuleIncludedResources" required: - data type: object - TagPolicyScoreAttributes: - description: Attributes of a tag policy compliance score. + TagRuleScoreAttributes: + description: Attributes of a tag rule compliance score. properties: score: description: |- - The compliance score for the policy over the requested time window, as a percentage + The compliance score for the rule over the requested time window, as a percentage between 0 and 100. `null` indicates that no relevant telemetry was found. example: 80 format: double @@ -110822,7 +110812,7 @@ components: format: int64 type: integer version: - description: The version of the tag policy that the score was computed against. + description: The version of the tag rule that the score was computed against. example: 1 format: int64 type: integer @@ -110832,31 +110822,31 @@ components: - ts_end - version type: object - TagPolicyScoreData: - description: A compliance score resource for a tag policy. + TagRuleScoreData: + description: A compliance score resource for a tag rule. properties: attributes: - $ref: "#/components/schemas/TagPolicyScoreAttributes" + $ref: "#/components/schemas/TagRuleScoreAttributes" id: description: The unique identifier of the compliance score resource. example: "123-v1-1779315066097-1779401466097" type: string type: - $ref: "#/components/schemas/TagPolicyScoreResourceType" + $ref: "#/components/schemas/TagRuleScoreResourceType" required: - type - id - attributes type: object - TagPolicyScoreRelationship: - description: A relationship to the compliance score resource for this policy. + TagRuleScoreRelationship: + description: A relationship to the compliance score resource for this rule. properties: data: - $ref: "#/components/schemas/TagPolicyScoreRelationshipData" + $ref: "#/components/schemas/TagRuleScoreRelationshipData" required: - data type: object - TagPolicyScoreRelationshipData: + TagRuleScoreRelationshipData: description: Identifier of the related compliance score resource. properties: id: @@ -110864,46 +110854,42 @@ components: example: "123-v1-1779315066097-1779401466097" type: string type: - $ref: "#/components/schemas/TagPolicyScoreResourceType" + $ref: "#/components/schemas/TagRuleScoreResourceType" required: - type - id type: object - TagPolicyScoreResourceType: - description: JSON:API resource type for a tag policy compliance score. + TagRuleScoreResourceType: + description: JSON:API resource type for a tag rule compliance score. enum: - tag_policy_score example: "tag_policy_score" type: string x-enum-varnames: - TAG_POLICY_SCORE - TagPolicyScoreResponse: - description: A tag policy compliance score. + TagRuleScoreResponse: + description: A tag rule compliance score. properties: data: - $ref: "#/components/schemas/TagPolicyScoreData" + $ref: "#/components/schemas/TagRuleScoreData" required: - data type: object - TagPolicySource: - description: The telemetry source that a tag policy applies to. + TagRuleSource: + description: The telemetry source that a tag rule applies to. enum: - logs - spans - metrics - - rum - - feed example: "logs" type: string x-enum-varnames: - LOGS - SPANS - METRICS - - RUM - - FEED - TagPolicyType: + TagRuleType: description: |- - How the policy is enforced. `blocking` rejects telemetry that violates the policy. + How the rule is enforced. `blocking` rejects telemetry that violates the rule. `surfacing` only highlights non-compliant telemetry without blocking it. enum: - blocking @@ -110913,30 +110899,30 @@ components: x-enum-varnames: - BLOCKING - SURFACING - TagPolicyUpdateAttributes: + TagRuleUpdateAttributes: description: |- - Mutable attributes of a tag policy. Each field is optional; omitting a field leaves its - current value unchanged. The `source` of a policy cannot be changed. + 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. properties: enabled: - description: Whether the policy is currently enforced. + description: Whether the rule is currently enforced. type: boolean negated: - description: When `true`, the policy matches tag values that do NOT match any of the supplied patterns. + description: When `true`, the rule matches tag values that do NOT match any of the supplied patterns. type: boolean policy_name: - description: Human-readable name for the tag policy. + description: Human-readable name for the tag rule. type: string policy_type: - $ref: "#/components/schemas/TagPolicyType" + $ref: "#/components/schemas/TagRuleType" required: description: When `true`, telemetry without this tag is treated as a violation. type: boolean scope: - description: The scope the policy applies within. + description: The scope the rule applies within. type: string tag_key: - description: The tag key that the policy governs. + description: The tag key that the rule governs. type: string tag_value_patterns: description: One or more patterns that valid values for the tag key must match. @@ -110945,26 +110931,36 @@ components: type: string type: array type: object - TagPolicyUpdateData: - description: Data object for updating a tag policy. + TagRuleUpdateData: + description: Data object for updating a tag rule. properties: attributes: - $ref: "#/components/schemas/TagPolicyUpdateAttributes" + $ref: "#/components/schemas/TagRuleUpdateAttributes" id: - description: The unique identifier of the tag policy being updated. + description: The unique identifier of the tag rule being updated. example: "123" type: string type: - $ref: "#/components/schemas/TagPolicyResourceType" + $ref: "#/components/schemas/TagRuleResourceType" required: - type - id type: object - TagPolicyUpdateRequest: - description: Payload for updating an existing tag policy. Only the supplied fields are modified. + TagRuleUpdateRequest: + description: Payload for updating an existing tag rule. Only the supplied fields are modified. properties: data: - $ref: "#/components/schemas/TagPolicyUpdateData" + $ref: "#/components/schemas/TagRuleUpdateData" + required: + - data + type: object + TagRulesListResponse: + description: A page of tag rules. + properties: + data: + $ref: "#/components/schemas/TagRuleDataArray" + included: + $ref: "#/components/schemas/TagRuleIncludedResources" required: - data type: object @@ -206603,38 +206599,38 @@ paths: /api/v2/tag_policies: get: description: |- - Retrieve all tag policies for the organization. Optionally include disabled or deleted - policies, filter by telemetry source, and include each policy's current compliance score + Retrieve all tag rules for the organization. Optionally include disabled or deleted + rules, filter by telemetry source, and include each rule's current compliance score via the `include=score` query parameter. - operationId: ListTagPolicies + operationId: ListTagRules parameters: - - description: Whether to include policies that are currently disabled. Defaults to `false`. + - description: Whether to include rules that are currently disabled. Defaults to `false`. example: false in: query name: include_disabled required: false schema: type: boolean - - description: Whether to include policies that have been soft-deleted. Defaults to `false`. + - description: Whether to include rules that have been soft-deleted. Defaults to `false`. example: false in: query name: include_deleted required: false schema: type: boolean - - description: Comma-separated list of related resources to include alongside each policy in the response. Currently the only supported value is `score`. + - description: Comma-separated list of related resources to include alongside each rule in the response. Currently the only supported value is `score`. example: "score" in: query name: include required: false schema: - $ref: "#/components/schemas/TagPolicyInclude" - - description: Restrict the result set to policies whose source matches the given value. + $ref: "#/components/schemas/TagRuleInclude" + - description: Restrict the result set to rules whose source matches the given value. in: query name: filter[source] required: false schema: - $ref: "#/components/schemas/TagPolicySource" + $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. example: 1779315066097 in: query @@ -206692,7 +206688,7 @@ paths: id: "123-v1-1779315066097-1779401466097" type: "tag_policy_score" schema: - $ref: "#/components/schemas/TagPoliciesListResponse" + $ref: "#/components/schemas/TagRulesListResponse" description: OK "400": content: @@ -206717,9 +206713,9 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: List tag policies + summary: List tag rules tags: - - Tag Policies + - Tag Rules "x-permission": operator: OR permissions: @@ -206730,10 +206726,10 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- - Create a new tag policy for the organization. The caller's organization is derived from + Create a new tag rule for the organization. The caller's organization is derived from the authenticated user; cross-organization creation is not supported. Fields such as `policy_id`, `version`, and the timestamp/audit fields are assigned by the server. - operationId: CreateTagPolicy + operationId: CreateTagRule requestBody: content: application/json: @@ -206755,7 +206751,7 @@ paths: - "web" type: "tag_policy" schema: - $ref: "#/components/schemas/TagPolicyCreateRequest" + $ref: "#/components/schemas/TagRuleCreateRequest" required: true responses: "201": @@ -206785,7 +206781,7 @@ paths: id: "123" type: "tag_policy" schema: - $ref: "#/components/schemas/TagPolicyResponse" + $ref: "#/components/schemas/TagRuleResponse" description: Created "400": content: @@ -206816,9 +206812,9 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Create a tag policy + summary: Create a tag rule tags: - - Tag Policies + - Tag Rules "x-permission": operator: AND permissions: @@ -206829,19 +206825,19 @@ paths: /api/v2/tag_policies/{policy_id}: delete: description: |- - Delete a tag policy. By default the policy is soft-deleted so it can be recovered later + 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 policy permanently. - operationId: DeleteTagPolicy + the rule permanently. + operationId: DeleteTagRule parameters: - - description: The unique identifier of the tag policy to delete. + - description: The unique identifier of the tag rule to delete. example: "123" in: path name: policy_id required: true schema: type: string - - description: Whether to permanently delete the policy instead of performing a soft delete. Defaults to `false`. + - description: Whether to permanently delete the rule instead of performing a soft delete. Defaults to `false`. example: false in: query name: hard_delete @@ -206880,9 +206876,9 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Delete a tag policy + summary: Delete a tag rule tags: - - Tag Policies + - Tag Rules "x-permission": operator: AND permissions: @@ -206892,25 +206888,25 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). get: description: |- - Retrieve a single tag policy by ID. Optionally include the policy's current compliance - score via the `include=score` query parameter. Policies belonging to other organizations + Retrieve a single tag rule by ID. Optionally include the rule's current compliance + score via the `include=score` query parameter. Rules belonging to other organizations cannot be retrieved. - operationId: GetTagPolicy + operationId: GetTagRule parameters: - - description: The unique identifier of the tag policy. + - description: The unique identifier of the tag rule. example: "123" in: path name: policy_id required: true schema: type: string - - description: Comma-separated list of related resources to include alongside the policy. Currently the only supported value is `score`. + - description: Comma-separated list of related resources to include alongside the rule. Currently the only supported value is `score`. example: "score" in: query name: include required: false schema: - $ref: "#/components/schemas/TagPolicyInclude" + $ref: "#/components/schemas/TagRuleInclude" - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. example: 1779315066097 in: query @@ -206968,7 +206964,7 @@ paths: id: "123-v1-1779315066097-1779401466097" type: "tag_policy_score" schema: - $ref: "#/components/schemas/TagPolicyResponse" + $ref: "#/components/schemas/TagRuleResponse" description: OK "400": content: @@ -206999,9 +206995,9 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get a tag policy + summary: Get a tag rule tags: - - Tag Policies + - Tag Rules "x-permission": operator: OR permissions: @@ -207012,12 +207008,12 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: description: |- - Update one or more attributes of an existing tag policy. Only the fields supplied in the - request body are modified; omitted fields retain their current values. The policy's + 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. - operationId: UpdateTagPolicy + operationId: UpdateTagRule parameters: - - description: The unique identifier of the tag policy to update. + - description: The unique identifier of the tag rule to update. example: "123" in: path name: policy_id @@ -207037,7 +207033,7 @@ paths: id: "123" type: "tag_policy" schema: - $ref: "#/components/schemas/TagPolicyUpdateRequest" + $ref: "#/components/schemas/TagRuleUpdateRequest" required: true responses: "200": @@ -207067,7 +207063,7 @@ paths: id: "123" type: "tag_policy" schema: - $ref: "#/components/schemas/TagPolicyResponse" + $ref: "#/components/schemas/TagRuleResponse" description: OK "400": content: @@ -207098,9 +207094,9 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update a tag policy + summary: Update a tag rule tags: - - Tag Policies + - Tag Rules "x-permission": operator: AND permissions: @@ -207111,13 +207107,13 @@ paths: /api/v2/tag_policies/{policy_id}/score: get: description: |- - Retrieve the compliance score for a single tag policy. The score is computed over the + Retrieve the compliance score for a single tag rule. The score is computed over the requested time window (or a source-appropriate default) and represents the percentage of - telemetry within that window that conforms to the policy. A `null` score indicates that + telemetry within that window that conforms to the rule. A `null` score indicates that no relevant telemetry was found. - operationId: GetTagPolicyScore + operationId: GetTagRuleScore parameters: - - description: The unique identifier of the tag policy. + - description: The unique identifier of the tag rule. example: "123" in: path name: policy_id @@ -207156,7 +207152,7 @@ paths: id: "123-v1-1779315066097-1779401466097" type: "tag_policy_score" schema: - $ref: "#/components/schemas/TagPolicyScoreResponse" + $ref: "#/components/schemas/TagRuleScoreResponse" description: OK "400": content: @@ -207187,9 +207183,9 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get a tag policy compliance score + summary: Get a tag rule compliance score tags: - - Tag Policies + - Tag Rules "x-permission": operator: OR permissions: @@ -213664,12 +213660,12 @@ tags: For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/). name: Synthetics - description: |- - Tag Policies define rules that govern which tag values are accepted for a given tag key, - scoped to a particular telemetry source (such as logs, spans, or metrics). Policies can be - `blocking` (data not matching the policy is rejected) or `surfacing` (matching data is - highlighted but not blocked). Each policy reports a compliance `score` derived from how - much recent telemetry adheres to the policy. - name: Tag Policies + Tag Rules define rules that govern which tag values are accepted for a given tag key, + 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. + 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 - description: |- diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index c74f2573bf..9f2e18820b 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -914,10 +914,10 @@ datadog\_api\_client.v2.api.synthetics\_api module :members: :show-inheritance: -datadog\_api\_client.v2.api.tag\_policies\_api module ------------------------------------------------------ +datadog\_api\_client.v2.api.tag\_rules\_api module +-------------------------------------------------- -.. automodule:: datadog_api_client.v2.api.tag_policies_api +.. automodule:: datadog_api_client.v2.api.tag_rules_api :members: :show-inheritance: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index dd56032ba7..df308bd16b 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -47177,157 +47177,157 @@ datadog\_api\_client.v2.model.tag\_indexing\_rules\_response\_meta module :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policies\_list\_response module ------------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_attributes module +---------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policies_list_response +.. automodule:: datadog_api_client.v2.model.tag_rule_attributes :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_attributes module ------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_create\_attributes module +------------------------------------------------------------------ -.. automodule:: datadog_api_client.v2.model.tag_policy_attributes +.. automodule:: datadog_api_client.v2.model.tag_rule_create_attributes :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_create\_attributes module --------------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_create\_data module +------------------------------------------------------------ -.. automodule:: datadog_api_client.v2.model.tag_policy_create_attributes +.. automodule:: datadog_api_client.v2.model.tag_rule_create_data :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_create\_data module --------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_create\_request module +--------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_create_data +.. automodule:: datadog_api_client.v2.model.tag_rule_create_request :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_create\_request module ------------------------------------------------------------------ +datadog\_api\_client.v2.model.tag\_rule\_create\_type module +------------------------------------------------------------ -.. automodule:: datadog_api_client.v2.model.tag_policy_create_request +.. automodule:: datadog_api_client.v2.model.tag_rule_create_type :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_create\_type module --------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_data module +---------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_create_type +.. automodule:: datadog_api_client.v2.model.tag_rule_data :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_data module ------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_include module +------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_data +.. automodule:: datadog_api_client.v2.model.tag_rule_include :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_include module ---------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_relationships module +------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_include +.. automodule:: datadog_api_client.v2.model.tag_rule_relationships :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_relationships module ---------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_resource\_type module +-------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_relationships +.. automodule:: datadog_api_client.v2.model.tag_rule_resource_type :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_resource\_type module ----------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_response module +-------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_resource_type +.. automodule:: datadog_api_client.v2.model.tag_rule_response :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_response module ----------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_score\_attributes module +----------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_response +.. automodule:: datadog_api_client.v2.model.tag_rule_score_attributes :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_score\_attributes module -------------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_score\_data module +----------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_score_attributes +.. automodule:: datadog_api_client.v2.model.tag_rule_score_data :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_score\_data module -------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_score\_relationship module +------------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_score_data +.. automodule:: datadog_api_client.v2.model.tag_rule_score_relationship :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_score\_relationship module ---------------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_score\_relationship\_data module +------------------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_score_relationship +.. automodule:: datadog_api_client.v2.model.tag_rule_score_relationship_data :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_score\_relationship\_data module ---------------------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_score\_resource\_type module +--------------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_score_relationship_data +.. automodule:: datadog_api_client.v2.model.tag_rule_score_resource_type :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_score\_resource\_type module ------------------------------------------------------------------------ +datadog\_api\_client.v2.model.tag\_rule\_score\_response module +--------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_score_resource_type +.. automodule:: datadog_api_client.v2.model.tag_rule_score_response :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_score\_response module ------------------------------------------------------------------ +datadog\_api\_client.v2.model.tag\_rule\_source module +------------------------------------------------------ -.. automodule:: datadog_api_client.v2.model.tag_policy_score_response +.. automodule:: datadog_api_client.v2.model.tag_rule_source :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_source module --------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_type module +---------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_source +.. automodule:: datadog_api_client.v2.model.tag_rule_type :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_type module ------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_update\_attributes module +------------------------------------------------------------------ -.. automodule:: datadog_api_client.v2.model.tag_policy_type +.. automodule:: datadog_api_client.v2.model.tag_rule_update_attributes :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_update\_attributes module --------------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_update\_data module +------------------------------------------------------------ -.. automodule:: datadog_api_client.v2.model.tag_policy_update_attributes +.. automodule:: datadog_api_client.v2.model.tag_rule_update_data :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_update\_data module --------------------------------------------------------------- +datadog\_api\_client.v2.model.tag\_rule\_update\_request module +--------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_update_data +.. automodule:: datadog_api_client.v2.model.tag_rule_update_request :members: :show-inheritance: -datadog\_api\_client.v2.model.tag\_policy\_update\_request module ------------------------------------------------------------------ +datadog\_api\_client.v2.model.tag\_rules\_list\_response module +--------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.tag_policy_update_request +.. automodule:: datadog_api_client.v2.model.tag_rules_list_response :members: :show-inheritance: diff --git a/examples/v2/tag-policies/CreateTagPolicy.py b/examples/v2/tag-policies/CreateTagPolicy.py deleted file mode 100644 index b50dcb3704..0000000000 --- a/examples/v2/tag-policies/CreateTagPolicy.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -Create a tag policy returns "Created" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi -from datadog_api_client.v2.model.tag_policy_create_attributes import TagPolicyCreateAttributes -from datadog_api_client.v2.model.tag_policy_create_data import TagPolicyCreateData -from datadog_api_client.v2.model.tag_policy_create_request import TagPolicyCreateRequest -from datadog_api_client.v2.model.tag_policy_create_type import TagPolicyCreateType -from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType -from datadog_api_client.v2.model.tag_policy_source import TagPolicySource - -body = TagPolicyCreateRequest( - data=TagPolicyCreateData( - attributes=TagPolicyCreateAttributes( - enabled=True, - negated=False, - policy_name="Service tag must be one of api or web", - policy_type=TagPolicyCreateType.SURFACING, - required=True, - scope="env", - source=TagPolicySource.LOGS, - tag_key="service", - tag_value_patterns=[ - "api", - "web", - ], - ), - type=TagPolicyResourceType.TAG_POLICY, - ), -) - -configuration = Configuration() -configuration.unstable_operations["create_tag_policy"] = True -with ApiClient(configuration) as api_client: - api_instance = TagPoliciesApi(api_client) - response = api_instance.create_tag_policy(body=body) - - print(response) diff --git a/examples/v2/tag-policies/DeleteTagPolicy.py b/examples/v2/tag-policies/DeleteTagPolicy.py deleted file mode 100644 index c6b7e1e043..0000000000 --- a/examples/v2/tag-policies/DeleteTagPolicy.py +++ /dev/null @@ -1,14 +0,0 @@ -""" -Delete a tag policy returns "No Content" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi - -configuration = Configuration() -configuration.unstable_operations["delete_tag_policy"] = True -with ApiClient(configuration) as api_client: - api_instance = TagPoliciesApi(api_client) - api_instance.delete_tag_policy( - policy_id="policy_id", - ) diff --git a/examples/v2/tag-policies/GetTagPolicy.py b/examples/v2/tag-policies/GetTagPolicy.py deleted file mode 100644 index ee938812ec..0000000000 --- a/examples/v2/tag-policies/GetTagPolicy.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Get a tag policy returns "OK" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi - -configuration = Configuration() -configuration.unstable_operations["get_tag_policy"] = True -with ApiClient(configuration) as api_client: - api_instance = TagPoliciesApi(api_client) - response = api_instance.get_tag_policy( - policy_id="policy_id", - ) - - print(response) diff --git a/examples/v2/tag-policies/GetTagPolicyScore.py b/examples/v2/tag-policies/GetTagPolicyScore.py deleted file mode 100644 index de9e925751..0000000000 --- a/examples/v2/tag-policies/GetTagPolicyScore.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Get a tag policy compliance score returns "OK" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi - -configuration = Configuration() -configuration.unstable_operations["get_tag_policy_score"] = True -with ApiClient(configuration) as api_client: - api_instance = TagPoliciesApi(api_client) - response = api_instance.get_tag_policy_score( - policy_id="policy_id", - ) - - print(response) diff --git a/examples/v2/tag-policies/ListTagPolicies.py b/examples/v2/tag-policies/ListTagPolicies.py deleted file mode 100644 index 822c24d305..0000000000 --- a/examples/v2/tag-policies/ListTagPolicies.py +++ /dev/null @@ -1,14 +0,0 @@ -""" -List tag policies returns "OK" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi - -configuration = Configuration() -configuration.unstable_operations["list_tag_policies"] = True -with ApiClient(configuration) as api_client: - api_instance = TagPoliciesApi(api_client) - response = api_instance.list_tag_policies() - - print(response) diff --git a/examples/v2/tag-policies/UpdateTagPolicy.py b/examples/v2/tag-policies/UpdateTagPolicy.py deleted file mode 100644 index 3730a5bf05..0000000000 --- a/examples/v2/tag-policies/UpdateTagPolicy.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -Update a tag policy returns "OK" response -""" - -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi -from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType -from datadog_api_client.v2.model.tag_policy_type import TagPolicyType -from datadog_api_client.v2.model.tag_policy_update_attributes import TagPolicyUpdateAttributes -from datadog_api_client.v2.model.tag_policy_update_data import TagPolicyUpdateData -from datadog_api_client.v2.model.tag_policy_update_request import TagPolicyUpdateRequest - -body = TagPolicyUpdateRequest( - data=TagPolicyUpdateData( - attributes=TagPolicyUpdateAttributes( - policy_type=TagPolicyType.SURFACING, - tag_value_patterns=[], - ), - id="123", - type=TagPolicyResourceType.TAG_POLICY, - ), -) - -configuration = Configuration() -configuration.unstable_operations["update_tag_policy"] = True -with ApiClient(configuration) as api_client: - api_instance = TagPoliciesApi(api_client) - response = api_instance.update_tag_policy(policy_id="policy_id", body=body) - - print(response) diff --git a/examples/v2/tag-rules/CreateTagRule.py b/examples/v2/tag-rules/CreateTagRule.py new file mode 100644 index 0000000000..fa4be2cdda --- /dev/null +++ b/examples/v2/tag-rules/CreateTagRule.py @@ -0,0 +1,40 @@ +""" +Create a tag rule returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi +from datadog_api_client.v2.model.tag_rule_create_attributes import TagRuleCreateAttributes +from datadog_api_client.v2.model.tag_rule_create_data import TagRuleCreateData +from datadog_api_client.v2.model.tag_rule_create_request import TagRuleCreateRequest +from datadog_api_client.v2.model.tag_rule_create_type import TagRuleCreateType +from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType +from datadog_api_client.v2.model.tag_rule_source import TagRuleSource + +body = TagRuleCreateRequest( + data=TagRuleCreateData( + attributes=TagRuleCreateAttributes( + enabled=True, + negated=False, + policy_name="Service tag must be one of api or web", + policy_type=TagRuleCreateType.SURFACING, + required=True, + scope="env", + source=TagRuleSource.LOGS, + tag_key="service", + tag_value_patterns=[ + "api", + "web", + ], + ), + type=TagRuleResourceType.TAG_POLICY, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_tag_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = TagRulesApi(api_client) + response = api_instance.create_tag_rule(body=body) + + print(response) diff --git a/examples/v2/tag-rules/DeleteTagRule.py b/examples/v2/tag-rules/DeleteTagRule.py new file mode 100644 index 0000000000..4f78c4eaae --- /dev/null +++ b/examples/v2/tag-rules/DeleteTagRule.py @@ -0,0 +1,14 @@ +""" +Delete a tag rule returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi + +configuration = Configuration() +configuration.unstable_operations["delete_tag_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = TagRulesApi(api_client) + api_instance.delete_tag_rule( + policy_id="policy_id", + ) diff --git a/examples/v2/tag-rules/GetTagRule.py b/examples/v2/tag-rules/GetTagRule.py new file mode 100644 index 0000000000..8bf01dffcb --- /dev/null +++ b/examples/v2/tag-rules/GetTagRule.py @@ -0,0 +1,16 @@ +""" +Get a tag rule returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi + +configuration = Configuration() +configuration.unstable_operations["get_tag_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = TagRulesApi(api_client) + response = api_instance.get_tag_rule( + policy_id="policy_id", + ) + + print(response) diff --git a/examples/v2/tag-rules/GetTagRuleScore.py b/examples/v2/tag-rules/GetTagRuleScore.py new file mode 100644 index 0000000000..1f695c6d0d --- /dev/null +++ b/examples/v2/tag-rules/GetTagRuleScore.py @@ -0,0 +1,16 @@ +""" +Get a tag rule compliance score returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi + +configuration = Configuration() +configuration.unstable_operations["get_tag_rule_score"] = True +with ApiClient(configuration) as api_client: + api_instance = TagRulesApi(api_client) + response = api_instance.get_tag_rule_score( + policy_id="policy_id", + ) + + print(response) diff --git a/examples/v2/tag-rules/ListTagRules.py b/examples/v2/tag-rules/ListTagRules.py new file mode 100644 index 0000000000..f8e58fd73d --- /dev/null +++ b/examples/v2/tag-rules/ListTagRules.py @@ -0,0 +1,14 @@ +""" +List tag rules returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi + +configuration = Configuration() +configuration.unstable_operations["list_tag_rules"] = True +with ApiClient(configuration) as api_client: + api_instance = TagRulesApi(api_client) + response = api_instance.list_tag_rules() + + print(response) diff --git a/examples/v2/tag-rules/UpdateTagRule.py b/examples/v2/tag-rules/UpdateTagRule.py new file mode 100644 index 0000000000..7beaf31015 --- /dev/null +++ b/examples/v2/tag-rules/UpdateTagRule.py @@ -0,0 +1,30 @@ +""" +Update a tag rule returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi +from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType +from datadog_api_client.v2.model.tag_rule_type import TagRuleType +from datadog_api_client.v2.model.tag_rule_update_attributes import TagRuleUpdateAttributes +from datadog_api_client.v2.model.tag_rule_update_data import TagRuleUpdateData +from datadog_api_client.v2.model.tag_rule_update_request import TagRuleUpdateRequest + +body = TagRuleUpdateRequest( + data=TagRuleUpdateData( + attributes=TagRuleUpdateAttributes( + policy_type=TagRuleType.SURFACING, + tag_value_patterns=[], + ), + id="123", + type=TagRuleResourceType.TAG_POLICY, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_tag_rule"] = True +with ApiClient(configuration) as api_client: + api_instance = TagRulesApi(api_client) + response = api_instance.update_tag_rule(policy_id="policy_id", body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 0f400f6576..a1751139ed 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -787,12 +787,12 @@ def __init__( "v2.revert_custom_rule_revision": False, "v2.update_ai_custom_ruleset": False, "v2.update_custom_ruleset": False, - "v2.create_tag_policy": False, - "v2.delete_tag_policy": False, - "v2.get_tag_policy": False, - "v2.get_tag_policy_score": False, - "v2.list_tag_policies": False, - "v2.update_tag_policy": False, + "v2.create_tag_rule": False, + "v2.delete_tag_rule": False, + "v2.get_tag_rule": False, + "v2.get_tag_rule_score": False, + "v2.list_tag_rules": False, + "v2.update_tag_rule": False, "v2.add_member_team": False, "v2.list_member_teams": False, "v2.remove_member_team": False, diff --git a/src/datadog_api_client/v2/api/tag_policies_api.py b/src/datadog_api_client/v2/api/tag_rules_api.py similarity index 65% rename from src/datadog_api_client/v2/api/tag_policies_api.py rename to src/datadog_api_client/v2/api/tag_rules_api.py index 8dfd7eae90..b046b34542 100644 --- a/src/datadog_api_client/v2/api/tag_policies_api.py +++ b/src/datadog_api_client/v2/api/tag_rules_api.py @@ -11,22 +11,22 @@ UnsetType, unset, ) -from datadog_api_client.v2.model.tag_policies_list_response import TagPoliciesListResponse -from datadog_api_client.v2.model.tag_policy_include import TagPolicyInclude -from datadog_api_client.v2.model.tag_policy_source import TagPolicySource -from datadog_api_client.v2.model.tag_policy_response import TagPolicyResponse -from datadog_api_client.v2.model.tag_policy_create_request import TagPolicyCreateRequest -from datadog_api_client.v2.model.tag_policy_update_request import TagPolicyUpdateRequest -from datadog_api_client.v2.model.tag_policy_score_response import TagPolicyScoreResponse +from datadog_api_client.v2.model.tag_rules_list_response import TagRulesListResponse +from datadog_api_client.v2.model.tag_rule_include import TagRuleInclude +from datadog_api_client.v2.model.tag_rule_source import TagRuleSource +from datadog_api_client.v2.model.tag_rule_response import TagRuleResponse +from datadog_api_client.v2.model.tag_rule_create_request import TagRuleCreateRequest +from datadog_api_client.v2.model.tag_rule_update_request import TagRuleUpdateRequest +from datadog_api_client.v2.model.tag_rule_score_response import TagRuleScoreResponse -class TagPoliciesApi: +class TagRulesApi: """ - Tag Policies define rules that govern which tag values are accepted for a given tag key, - scoped to a particular telemetry source (such as logs, spans, or metrics). Policies can be - ``blocking`` (data not matching the policy is rejected) or ``surfacing`` (matching data is - highlighted but not blocked). Each policy reports a compliance ``score`` derived from how - much recent telemetry adheres to the policy. + Tag Rules define rules that govern which tag values are accepted for a given tag key, + 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. """ def __init__(self, api_client=None): @@ -34,19 +34,19 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client - self._create_tag_policy_endpoint = _Endpoint( + self._create_tag_rule_endpoint = _Endpoint( settings={ - "response_type": (TagPolicyResponse,), + "response_type": (TagRuleResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/tag_policies", - "operation_id": "create_tag_policy", + "operation_id": "create_tag_rule", "http_method": "POST", "version": "v2", }, params_map={ "body": { "required": True, - "openapi_types": (TagPolicyCreateRequest,), + "openapi_types": (TagRuleCreateRequest,), "location": "body", }, }, @@ -54,12 +54,12 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._delete_tag_policy_endpoint = _Endpoint( + self._delete_tag_rule_endpoint = _Endpoint( settings={ "response_type": None, "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/tag_policies/{policy_id}", - "operation_id": "delete_tag_policy", + "operation_id": "delete_tag_rule", "http_method": "DELETE", "version": "v2", }, @@ -82,12 +82,12 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._get_tag_policy_endpoint = _Endpoint( + self._get_tag_rule_endpoint = _Endpoint( settings={ - "response_type": (TagPolicyResponse,), + "response_type": (TagRuleResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/tag_policies/{policy_id}", - "operation_id": "get_tag_policy", + "operation_id": "get_tag_rule", "http_method": "GET", "version": "v2", }, @@ -99,7 +99,7 @@ def __init__(self, api_client=None): "location": "path", }, "include": { - "openapi_types": (TagPolicyInclude,), + "openapi_types": (TagRuleInclude,), "attribute": "include", "location": "query", }, @@ -120,12 +120,12 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._get_tag_policy_score_endpoint = _Endpoint( + self._get_tag_rule_score_endpoint = _Endpoint( settings={ - "response_type": (TagPolicyScoreResponse,), + "response_type": (TagRuleScoreResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/tag_policies/{policy_id}/score", - "operation_id": "get_tag_policy_score", + "operation_id": "get_tag_rule_score", "http_method": "GET", "version": "v2", }, @@ -153,12 +153,12 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._list_tag_policies_endpoint = _Endpoint( + self._list_tag_rules_endpoint = _Endpoint( settings={ - "response_type": (TagPoliciesListResponse,), + "response_type": (TagRulesListResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/tag_policies", - "operation_id": "list_tag_policies", + "operation_id": "list_tag_rules", "http_method": "GET", "version": "v2", }, @@ -174,12 +174,12 @@ def __init__(self, api_client=None): "location": "query", }, "include": { - "openapi_types": (TagPolicyInclude,), + "openapi_types": (TagRuleInclude,), "attribute": "include", "location": "query", }, "filter_source": { - "openapi_types": (TagPolicySource,), + "openapi_types": (TagRuleSource,), "attribute": "filter[source]", "location": "query", }, @@ -200,12 +200,12 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._update_tag_policy_endpoint = _Endpoint( + self._update_tag_rule_endpoint = _Endpoint( settings={ - "response_type": (TagPolicyResponse,), + "response_type": (TagRuleResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/tag_policies/{policy_id}", - "operation_id": "update_tag_policy", + "operation_id": "update_tag_rule", "http_method": "PATCH", "version": "v2", }, @@ -218,7 +218,7 @@ def __init__(self, api_client=None): }, "body": { "required": True, - "openapi_types": (TagPolicyUpdateRequest,), + "openapi_types": (TagRuleUpdateRequest,), "location": "body", }, }, @@ -226,39 +226,39 @@ def __init__(self, api_client=None): api_client=api_client, ) - def create_tag_policy( + def create_tag_rule( self, - body: TagPolicyCreateRequest, - ) -> TagPolicyResponse: - """Create a tag policy. + body: TagRuleCreateRequest, + ) -> TagRuleResponse: + """Create a tag rule. - Create a new tag policy for the organization. The caller's organization is derived from + Create a new tag rule for the organization. The caller's organization is derived from the authenticated user; cross-organization creation is not supported. Fields such as ``policy_id`` , ``version`` , and the timestamp/audit fields are assigned by the server. - :type body: TagPolicyCreateRequest - :rtype: TagPolicyResponse + :type body: TagRuleCreateRequest + :rtype: TagRuleResponse """ kwargs: Dict[str, Any] = {} kwargs["body"] = body - return self._create_tag_policy_endpoint.call_with_http_info(**kwargs) + return self._create_tag_rule_endpoint.call_with_http_info(**kwargs) - def delete_tag_policy( + def delete_tag_rule( self, policy_id: str, *, hard_delete: Union[bool, UnsetType] = unset, ) -> None: - """Delete a tag policy. + """Delete a tag rule. - Delete a tag policy. By default the policy is soft-deleted so it can be recovered later + 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 policy permanently. + the rule permanently. - :param policy_id: The unique identifier of the tag policy to delete. + :param policy_id: The unique identifier of the tag rule to delete. :type policy_id: str - :param hard_delete: Whether to permanently delete the policy instead of performing a soft delete. Defaults to ``false``. + :param hard_delete: Whether to permanently delete the rule instead of performing a soft delete. Defaults to ``false``. :type hard_delete: bool, optional :rtype: None """ @@ -268,31 +268,31 @@ def delete_tag_policy( if hard_delete is not unset: kwargs["hard_delete"] = hard_delete - return self._delete_tag_policy_endpoint.call_with_http_info(**kwargs) + return self._delete_tag_rule_endpoint.call_with_http_info(**kwargs) - def get_tag_policy( + def get_tag_rule( self, policy_id: str, *, - include: Union[TagPolicyInclude, UnsetType] = unset, + include: Union[TagRuleInclude, UnsetType] = unset, ts_start: Union[int, UnsetType] = unset, ts_end: Union[int, UnsetType] = unset, - ) -> TagPolicyResponse: - """Get a tag policy. + ) -> TagRuleResponse: + """Get a tag rule. - Retrieve a single tag policy by ID. Optionally include the policy's current compliance - score via the ``include=score`` query parameter. Policies belonging to other organizations + Retrieve a single tag rule by ID. Optionally include the rule's current compliance + score via the ``include=score`` query parameter. Rules belonging to other organizations cannot be retrieved. - :param policy_id: The unique identifier of the tag policy. + :param policy_id: The unique identifier of the tag rule. :type policy_id: str - :param include: Comma-separated list of related resources to include alongside the policy. Currently the only supported value is ``score``. - :type include: TagPolicyInclude, optional + :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. :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 - :rtype: TagPolicyResponse + :rtype: TagRuleResponse """ kwargs: Dict[str, Any] = {} kwargs["policy_id"] = policy_id @@ -306,29 +306,29 @@ def get_tag_policy( if ts_end is not unset: kwargs["ts_end"] = ts_end - return self._get_tag_policy_endpoint.call_with_http_info(**kwargs) + return self._get_tag_rule_endpoint.call_with_http_info(**kwargs) - def get_tag_policy_score( + def get_tag_rule_score( self, policy_id: str, *, ts_start: Union[int, UnsetType] = unset, ts_end: Union[int, UnsetType] = unset, - ) -> TagPolicyScoreResponse: - """Get a tag policy compliance score. + ) -> TagRuleScoreResponse: + """Get a tag rule compliance score. - Retrieve the compliance score for a single tag policy. The score is computed over the + Retrieve the compliance score for a single tag rule. The score is computed over the requested time window (or a source-appropriate default) and represents the percentage of - telemetry within that window that conforms to the policy. A ``null`` score indicates that + telemetry within that window that conforms to the rule. A ``null`` score indicates that no relevant telemetry was found. - :param policy_id: The unique identifier of the tag policy. + :param policy_id: The unique identifier of the tag rule. :type policy_id: str :param ts_start: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. :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 - :rtype: TagPolicyScoreResponse + :rtype: TagRuleScoreResponse """ kwargs: Dict[str, Any] = {} kwargs["policy_id"] = policy_id @@ -339,37 +339,37 @@ def get_tag_policy_score( if ts_end is not unset: kwargs["ts_end"] = ts_end - return self._get_tag_policy_score_endpoint.call_with_http_info(**kwargs) + return self._get_tag_rule_score_endpoint.call_with_http_info(**kwargs) - def list_tag_policies( + def list_tag_rules( self, *, include_disabled: Union[bool, UnsetType] = unset, include_deleted: Union[bool, UnsetType] = unset, - include: Union[TagPolicyInclude, UnsetType] = unset, - filter_source: Union[TagPolicySource, UnsetType] = unset, + include: Union[TagRuleInclude, UnsetType] = unset, + filter_source: Union[TagRuleSource, UnsetType] = unset, ts_start: Union[int, UnsetType] = unset, ts_end: Union[int, UnsetType] = unset, - ) -> TagPoliciesListResponse: - """List tag policies. + ) -> TagRulesListResponse: + """List tag rules. - Retrieve all tag policies for the organization. Optionally include disabled or deleted - policies, filter by telemetry source, and include each policy's current compliance score + Retrieve all tag rules for the organization. Optionally include disabled or deleted + rules, filter by telemetry source, and include each rule's current compliance score via the ``include=score`` query parameter. - :param include_disabled: Whether to include policies that are currently disabled. Defaults to ``false``. + :param include_disabled: Whether to include rules that are currently disabled. Defaults to ``false``. :type include_disabled: bool, optional - :param include_deleted: Whether to include policies that have been soft-deleted. Defaults to ``false``. + :param include_deleted: Whether to include rules that have been soft-deleted. Defaults to ``false``. :type include_deleted: bool, optional - :param include: Comma-separated list of related resources to include alongside each policy in the response. Currently the only supported value is ``score``. - :type include: TagPolicyInclude, optional - :param filter_source: Restrict the result set to policies whose source matches the given value. - :type filter_source: TagPolicySource, optional + :param include: Comma-separated list of related resources to include alongside each rule in the response. Currently the only supported value is ``score``. + :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. :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 - :rtype: TagPoliciesListResponse + :rtype: TagRulesListResponse """ kwargs: Dict[str, Any] = {} if include_disabled is not unset: @@ -390,27 +390,27 @@ def list_tag_policies( if ts_end is not unset: kwargs["ts_end"] = ts_end - return self._list_tag_policies_endpoint.call_with_http_info(**kwargs) + return self._list_tag_rules_endpoint.call_with_http_info(**kwargs) - def update_tag_policy( + def update_tag_rule( self, policy_id: str, - body: TagPolicyUpdateRequest, - ) -> TagPolicyResponse: - """Update a tag policy. + body: TagRuleUpdateRequest, + ) -> TagRuleResponse: + """Update a tag rule. - Update one or more attributes of an existing tag policy. Only the fields supplied in the - request body are modified; omitted fields retain their current values. The policy's + 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. - :param policy_id: The unique identifier of the tag policy to update. + :param policy_id: The unique identifier of the tag rule to update. :type policy_id: str - :type body: TagPolicyUpdateRequest - :rtype: TagPolicyResponse + :type body: TagRuleUpdateRequest + :rtype: TagRuleResponse """ kwargs: Dict[str, Any] = {} kwargs["policy_id"] = policy_id kwargs["body"] = body - return self._update_tag_policy_endpoint.call_with_http_info(**kwargs) + return self._update_tag_rule_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index c6b9db7d12..9ad0d5eb0d 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -128,7 +128,7 @@ from datadog_api_client.v2.api.stegadography_api import StegadographyApi from datadog_api_client.v2.api.storage_management_api import StorageManagementApi from datadog_api_client.v2.api.synthetics_api import SyntheticsApi -from datadog_api_client.v2.api.tag_policies_api import TagPoliciesApi +from datadog_api_client.v2.api.tag_rules_api import TagRulesApi from datadog_api_client.v2.api.teams_api import TeamsApi from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi @@ -271,7 +271,7 @@ "StegadographyApi", "StorageManagementApi", "SyntheticsApi", - "TagPoliciesApi", + "TagRulesApi", "TeamsApi", "TestOptimizationApi", "UsageMeteringApi", diff --git a/src/datadog_api_client/v2/model/tag_policies_list_response.py b/src/datadog_api_client/v2/model/tag_policies_list_response.py deleted file mode 100644 index 6973a9f365..0000000000 --- a/src/datadog_api_client/v2/model/tag_policies_list_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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.tag_policy_data import TagPolicyData - from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData - - -class TagPoliciesListResponse(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_data import TagPolicyData - from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData - - return { - "data": ([TagPolicyData],), - "included": ([TagPolicyScoreData],), - } - - attribute_map = { - "data": "data", - "included": "included", - } - - def __init__( - self_, data: List[TagPolicyData], included: Union[List[TagPolicyScoreData], UnsetType] = unset, **kwargs - ): - """ - A page of tag policies. - - :param data: An array of tag policy data objects. - :type data: [TagPolicyData] - - :param included: Related resources fetched alongside the primary tag policies. Populated when an ``include`` query parameter is supplied. - :type included: [TagPolicyScoreData], optional - """ - if included is not unset: - kwargs["included"] = included - super().__init__(kwargs) - - self_.data = data diff --git a/src/datadog_api_client/v2/model/tag_policy_create_data.py b/src/datadog_api_client/v2/model/tag_policy_create_data.py deleted file mode 100644 index c99b2f280f..0000000000 --- a/src/datadog_api_client/v2/model/tag_policy_create_data.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_create_attributes import TagPolicyCreateAttributes - from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType - - -class TagPolicyCreateData(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_create_attributes import TagPolicyCreateAttributes - from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType - - return { - "attributes": (TagPolicyCreateAttributes,), - "type": (TagPolicyResourceType,), - } - - attribute_map = { - "attributes": "attributes", - "type": "type", - } - - def __init__(self_, attributes: TagPolicyCreateAttributes, type: TagPolicyResourceType, **kwargs): - """ - Data object for creating a tag policy. - - :param attributes: Attributes that can be supplied when creating a tag policy. - :type attributes: TagPolicyCreateAttributes - - :param type: JSON:API resource type for a tag policy. - :type type: TagPolicyResourceType - """ - super().__init__(kwargs) - - self_.attributes = attributes - self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_data.py b/src/datadog_api_client/v2/model/tag_policy_data.py deleted file mode 100644 index 1546583602..0000000000 --- a/src/datadog_api_client/v2/model/tag_policy_data.py +++ /dev/null @@ -1,72 +0,0 @@ -# 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 Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_attributes import TagPolicyAttributes - from datadog_api_client.v2.model.tag_policy_relationships import TagPolicyRelationships - from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType - - -class TagPolicyData(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_attributes import TagPolicyAttributes - from datadog_api_client.v2.model.tag_policy_relationships import TagPolicyRelationships - from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType - - return { - "attributes": (TagPolicyAttributes,), - "id": (str,), - "relationships": (TagPolicyRelationships,), - "type": (TagPolicyResourceType,), - } - - attribute_map = { - "attributes": "attributes", - "id": "id", - "relationships": "relationships", - "type": "type", - } - - def __init__( - self_, - attributes: TagPolicyAttributes, - id: str, - type: TagPolicyResourceType, - relationships: Union[TagPolicyRelationships, UnsetType] = unset, - **kwargs, - ): - """ - A tag policy resource. - - :param attributes: The attributes of a tag policy resource. - :type attributes: TagPolicyAttributes - - :param id: The unique identifier of the tag policy. - :type id: str - - :param relationships: Related resources for a tag policy. Only present when the corresponding ``include`` query parameter is supplied. - :type relationships: TagPolicyRelationships, optional - - :param type: JSON:API resource type for a tag policy. - :type type: TagPolicyResourceType - """ - if relationships is not unset: - kwargs["relationships"] = relationships - super().__init__(kwargs) - - self_.attributes = attributes - self_.id = id - self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_score_data.py b/src/datadog_api_client/v2/model/tag_policy_score_data.py deleted file mode 100644 index c00fe9bb99..0000000000 --- a/src/datadog_api_client/v2/model/tag_policy_score_data.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_score_attributes import TagPolicyScoreAttributes - from datadog_api_client.v2.model.tag_policy_score_resource_type import TagPolicyScoreResourceType - - -class TagPolicyScoreData(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_score_attributes import TagPolicyScoreAttributes - from datadog_api_client.v2.model.tag_policy_score_resource_type import TagPolicyScoreResourceType - - return { - "attributes": (TagPolicyScoreAttributes,), - "id": (str,), - "type": (TagPolicyScoreResourceType,), - } - - attribute_map = { - "attributes": "attributes", - "id": "id", - "type": "type", - } - - def __init__(self_, attributes: TagPolicyScoreAttributes, id: str, type: TagPolicyScoreResourceType, **kwargs): - """ - A compliance score resource for a tag policy. - - :param attributes: Attributes of a tag policy compliance score. - :type attributes: TagPolicyScoreAttributes - - :param id: The unique identifier of the compliance score resource. - :type id: str - - :param type: JSON:API resource type for a tag policy compliance score. - :type type: TagPolicyScoreResourceType - """ - super().__init__(kwargs) - - self_.attributes = attributes - self_.id = id - self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_source.py b/src/datadog_api_client/v2/model/tag_policy_source.py deleted file mode 100644 index 49f0a4fe34..0000000000 --- a/src/datadog_api_client/v2/model/tag_policy_source.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 TagPolicySource(ModelSimple): - """ - The telemetry source that a tag policy applies to. - - :param value: Must be one of ["logs", "spans", "metrics", "rum", "feed"]. - :type value: str - """ - - allowed_values = { - "logs", - "spans", - "metrics", - "rum", - "feed", - } - LOGS: ClassVar["TagPolicySource"] - SPANS: ClassVar["TagPolicySource"] - METRICS: ClassVar["TagPolicySource"] - RUM: ClassVar["TagPolicySource"] - FEED: ClassVar["TagPolicySource"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -TagPolicySource.LOGS = TagPolicySource("logs") -TagPolicySource.SPANS = TagPolicySource("spans") -TagPolicySource.METRICS = TagPolicySource("metrics") -TagPolicySource.RUM = TagPolicySource("rum") -TagPolicySource.FEED = TagPolicySource("feed") diff --git a/src/datadog_api_client/v2/model/tag_policy_update_data.py b/src/datadog_api_client/v2/model/tag_policy_update_data.py deleted file mode 100644 index 3a91003167..0000000000 --- a/src/datadog_api_client/v2/model/tag_policy_update_data.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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 Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_update_attributes import TagPolicyUpdateAttributes - from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType - - -class TagPolicyUpdateData(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_update_attributes import TagPolicyUpdateAttributes - from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType - - return { - "attributes": (TagPolicyUpdateAttributes,), - "id": (str,), - "type": (TagPolicyResourceType,), - } - - attribute_map = { - "attributes": "attributes", - "id": "id", - "type": "type", - } - - def __init__( - self_, - id: str, - type: TagPolicyResourceType, - attributes: Union[TagPolicyUpdateAttributes, UnsetType] = unset, - **kwargs, - ): - """ - Data object for updating a tag policy. - - :param attributes: Mutable attributes of a tag policy. Each field is optional; omitting a field leaves its - current value unchanged. The ``source`` of a policy cannot be changed. - :type attributes: TagPolicyUpdateAttributes, optional - - :param id: The unique identifier of the tag policy being updated. - :type id: str - - :param type: JSON:API resource type for a tag policy. - :type type: TagPolicyResourceType - """ - if attributes is not unset: - kwargs["attributes"] = attributes - super().__init__(kwargs) - - self_.id = id - self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_attributes.py b/src/datadog_api_client/v2/model/tag_rule_attributes.py similarity index 71% rename from src/datadog_api_client/v2/model/tag_policy_attributes.py rename to src/datadog_api_client/v2/model/tag_rule_attributes.py index ae103a9f63..a70ed70c27 100644 --- a/src/datadog_api_client/v2/model/tag_policy_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_attributes.py @@ -16,15 +16,15 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_type import TagPolicyType - from datadog_api_client.v2.model.tag_policy_source import TagPolicySource + from datadog_api_client.v2.model.tag_rule_type import TagRuleType + from datadog_api_client.v2.model.tag_rule_source import TagRuleSource -class TagPolicyAttributes(ModelNormal): +class TagRuleAttributes(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_type import TagPolicyType - from datadog_api_client.v2.model.tag_policy_source import TagPolicySource + from datadog_api_client.v2.model.tag_rule_type import TagRuleType + from datadog_api_client.v2.model.tag_rule_source import TagRuleSource return { "created_at": (datetime,), @@ -36,10 +36,10 @@ def openapi_types(_): "modified_by": (str,), "negated": (bool,), "policy_name": (str,), - "policy_type": (TagPolicyType,), + "policy_type": (TagRuleType,), "required": (bool,), "scope": (str,), - "source": (TagPolicySource,), + "source": (TagRuleSource,), "tag_key": (str,), "tag_value_patterns": ([str],), "version": (int,), @@ -73,10 +73,10 @@ def __init__( modified_by: str, negated: bool, policy_name: str, - policy_type: TagPolicyType, + policy_type: TagRuleType, required: bool, scope: str, - source: TagPolicySource, + source: TagRuleSource, tag_key: str, tag_value_patterns: List[str], version: int, @@ -85,49 +85,49 @@ def __init__( **kwargs, ): """ - The attributes of a tag policy resource. + The attributes of a tag rule resource. - :param created_at: The RFC 3339 timestamp at which the policy was created. + :param created_at: The RFC 3339 timestamp at which the rule was created. :type created_at: datetime - :param created_by: The identifier of the user who created the policy. + :param created_by: The identifier of the user who created the rule. :type created_by: str - :param deleted_at: The RFC 3339 timestamp at which the policy was soft-deleted. ``null`` if the policy has not been deleted. Only present when ``include_deleted=true`` is requested. + :param deleted_at: The RFC 3339 timestamp at which the rule was soft-deleted. ``null`` if the rule has not been deleted. Only present when ``include_deleted=true`` is requested. :type deleted_at: datetime, none_type, optional - :param deleted_by: The identifier of the user who soft-deleted the policy. ``null`` if the policy has not been deleted. + :param deleted_by: The identifier of the user who soft-deleted the rule. ``null`` if the rule has not been deleted. :type deleted_by: str, none_type, optional - :param enabled: Whether the policy is currently enforced. + :param enabled: Whether the rule is currently enforced. :type enabled: bool - :param modified_at: The RFC 3339 timestamp at which the policy was last modified. + :param modified_at: The RFC 3339 timestamp at which the rule was last modified. :type modified_at: datetime - :param modified_by: The identifier of the user who last modified the policy. + :param modified_by: The identifier of the user who last modified the rule. :type modified_by: str - :param negated: When ``true`` , the policy matches tag values that do NOT match any of the supplied patterns. + :param negated: When ``true`` , the rule matches tag values that do NOT match any of the supplied patterns. :type negated: bool - :param policy_name: Human-readable name for the tag policy. + :param policy_name: Human-readable name for the tag rule. :type policy_name: str - :param policy_type: How the policy is enforced. ``blocking`` rejects telemetry that violates the policy. + :param policy_type: How the rule is enforced. ``blocking`` rejects telemetry that violates the rule. ``surfacing`` only highlights non-compliant telemetry without blocking it. - :type policy_type: TagPolicyType + :type policy_type: TagRuleType :param required: When ``true`` , telemetry without this tag is treated as a violation. :type required: bool - :param scope: The scope the policy applies within. + :param scope: The scope the rule applies within. :type scope: str - :param source: The telemetry source that a tag policy applies to. - :type source: TagPolicySource + :param source: The telemetry source that a tag rule applies to. + :type source: TagRuleSource - :param tag_key: The tag key that the policy governs. + :param tag_key: The tag key that the rule governs. :type tag_key: str :param tag_value_patterns: The patterns that valid values for the tag key must match. diff --git a/src/datadog_api_client/v2/model/tag_policy_create_attributes.py b/src/datadog_api_client/v2/model/tag_rule_create_attributes.py similarity index 64% rename from src/datadog_api_client/v2/model/tag_policy_create_attributes.py rename to src/datadog_api_client/v2/model/tag_rule_create_attributes.py index d19e212167..a93406db53 100644 --- a/src/datadog_api_client/v2/model/tag_policy_create_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_create_attributes.py @@ -14,11 +14,11 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_create_type import TagPolicyCreateType - from datadog_api_client.v2.model.tag_policy_source import TagPolicySource + from datadog_api_client.v2.model.tag_rule_create_type import TagRuleCreateType + from datadog_api_client.v2.model.tag_rule_source import TagRuleSource -class TagPolicyCreateAttributes(ModelNormal): +class TagRuleCreateAttributes(ModelNormal): validations = { "tag_value_patterns": { "min_items": 1, @@ -27,17 +27,17 @@ class TagPolicyCreateAttributes(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_create_type import TagPolicyCreateType - from datadog_api_client.v2.model.tag_policy_source import TagPolicySource + from datadog_api_client.v2.model.tag_rule_create_type import TagRuleCreateType + from datadog_api_client.v2.model.tag_rule_source import TagRuleSource return { "enabled": (bool,), "negated": (bool,), "policy_name": (str,), - "policy_type": (TagPolicyCreateType,), + "policy_type": (TagRuleCreateType,), "required": (bool,), "scope": (str,), - "source": (TagPolicySource,), + "source": (TagRuleSource,), "tag_key": (str,), "tag_value_patterns": ([str],), } @@ -57,9 +57,9 @@ def openapi_types(_): def __init__( self_, policy_name: str, - policy_type: TagPolicyCreateType, + policy_type: TagRuleCreateType, scope: str, - source: TagPolicySource, + source: TagRuleSource, tag_key: str, tag_value_patterns: List[str], enabled: Union[bool, UnsetType] = unset, @@ -68,32 +68,32 @@ def __init__( **kwargs, ): """ - Attributes that can be supplied when creating a tag policy. + Attributes that can be supplied when creating a tag rule. - :param enabled: Whether the policy is currently enforced. Defaults to ``true`` for newly created policies. + :param enabled: Whether the rule is currently enforced. Defaults to ``true`` for newly created rules. :type enabled: bool, optional - :param negated: When ``true`` , the policy matches tag values that do NOT match any of the supplied patterns. Defaults to ``false``. + :param negated: When ``true`` , the rule matches tag values that do NOT match any of the supplied patterns. Defaults to ``false``. :type negated: bool, optional - :param policy_name: Human-readable name for the tag policy. + :param policy_name: Human-readable name for the tag rule. :type policy_name: str - :param policy_type: The policy type allowed when creating a tag policy. Only ``surfacing`` is accepted at + :param policy_type: The rule type allowed when creating a tag rule. Only ``surfacing`` is accepted at creation time. - :type policy_type: TagPolicyCreateType + :type policy_type: TagRuleCreateType :param required: When ``true`` , telemetry without this tag is treated as a violation. Defaults to ``false``. :type required: bool, optional - :param scope: The scope the policy applies within. Typically an environment, team, or - organization-level identifier used to limit where the policy is enforced. + :param scope: The scope the rule applies within. Typically an environment, team, or + organization-level identifier used to limit where the rule is enforced. :type scope: str - :param source: The telemetry source that a tag policy applies to. - :type source: TagPolicySource + :param source: The telemetry source that a tag rule applies to. + :type source: TagRuleSource - :param tag_key: The tag key that the policy governs (for example, ``service`` ). + :param tag_key: The tag key that the rule governs (for example, ``service`` ). :type tag_key: str :param tag_value_patterns: One or more patterns that valid values for the tag key must match. At least one 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 new file mode 100644 index 0000000000..2358c06603 --- /dev/null +++ b/src/datadog_api_client/v2/model/tag_rule_create_data.py @@ -0,0 +1,48 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tag_rule_create_attributes import TagRuleCreateAttributes + from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType + + +class TagRuleCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tag_rule_create_attributes import TagRuleCreateAttributes + from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType + + return { + "attributes": (TagRuleCreateAttributes,), + "type": (TagRuleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes: TagRuleCreateAttributes, type: TagRuleResourceType, **kwargs): + """ + Data object for creating a tag rule. + + :param attributes: Attributes that can be supplied when creating a tag rule. + :type attributes: TagRuleCreateAttributes + + :param type: JSON:API resource type for a tag rule. + :type type: TagRuleResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_score_response.py b/src/datadog_api_client/v2/model/tag_rule_create_request.py similarity index 57% rename from src/datadog_api_client/v2/model/tag_policy_score_response.py rename to src/datadog_api_client/v2/model/tag_rule_create_request.py index 45456e3535..6b42a3e6e3 100644 --- a/src/datadog_api_client/v2/model/tag_policy_score_response.py +++ b/src/datadog_api_client/v2/model/tag_rule_create_request.py @@ -12,28 +12,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData + from datadog_api_client.v2.model.tag_rule_create_data import TagRuleCreateData -class TagPolicyScoreResponse(ModelNormal): +class TagRuleCreateRequest(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData + from datadog_api_client.v2.model.tag_rule_create_data import TagRuleCreateData return { - "data": (TagPolicyScoreData,), + "data": (TagRuleCreateData,), } attribute_map = { "data": "data", } - def __init__(self_, data: TagPolicyScoreData, **kwargs): + def __init__(self_, data: TagRuleCreateData, **kwargs): """ - A tag policy compliance score. + Payload for creating a new tag rule. - :param data: A compliance score resource for a tag policy. - :type data: TagPolicyScoreData + :param data: Data object for creating a tag rule. + :type data: TagRuleCreateData """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_policy_create_type.py b/src/datadog_api_client/v2/model/tag_rule_create_type.py similarity index 74% rename from src/datadog_api_client/v2/model/tag_policy_create_type.py rename to src/datadog_api_client/v2/model/tag_rule_create_type.py index 88f46445ed..f12f419eba 100644 --- a/src/datadog_api_client/v2/model/tag_policy_create_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_create_type.py @@ -12,9 +12,9 @@ from typing import ClassVar -class TagPolicyCreateType(ModelSimple): +class TagRuleCreateType(ModelSimple): """ - The policy type allowed when creating a tag policy. Only `surfacing` is accepted at + The rule type allowed when creating a tag rule. Only `surfacing` is accepted at creation time. :param value: If omitted defaults to "surfacing". Must be one of ["surfacing"]. @@ -24,7 +24,7 @@ class TagPolicyCreateType(ModelSimple): allowed_values = { "surfacing", } - SURFACING: ClassVar["TagPolicyCreateType"] + SURFACING: ClassVar["TagRuleCreateType"] @cached_property def openapi_types(_): @@ -33,4 +33,4 @@ def openapi_types(_): } -TagPolicyCreateType.SURFACING = TagPolicyCreateType("surfacing") +TagRuleCreateType.SURFACING = TagRuleCreateType("surfacing") diff --git a/src/datadog_api_client/v2/model/tag_rule_data.py b/src/datadog_api_client/v2/model/tag_rule_data.py new file mode 100644 index 0000000000..5f5c427f74 --- /dev/null +++ b/src/datadog_api_client/v2/model/tag_rule_data.py @@ -0,0 +1,72 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tag_rule_attributes import TagRuleAttributes + from datadog_api_client.v2.model.tag_rule_relationships import TagRuleRelationships + from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType + + +class TagRuleData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tag_rule_attributes import TagRuleAttributes + from datadog_api_client.v2.model.tag_rule_relationships import TagRuleRelationships + from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType + + return { + "attributes": (TagRuleAttributes,), + "id": (str,), + "relationships": (TagRuleRelationships,), + "type": (TagRuleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: TagRuleAttributes, + id: str, + type: TagRuleResourceType, + relationships: Union[TagRuleRelationships, UnsetType] = unset, + **kwargs, + ): + """ + A tag rule resource. + + :param attributes: The attributes of a tag rule resource. + :type attributes: TagRuleAttributes + + :param id: The unique identifier of the tag rule. + :type id: str + + :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. + :type type: TagRuleResourceType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_include.py b/src/datadog_api_client/v2/model/tag_rule_include.py similarity index 72% rename from src/datadog_api_client/v2/model/tag_policy_include.py rename to src/datadog_api_client/v2/model/tag_rule_include.py index bb0691bcc5..b1766bd1a9 100644 --- a/src/datadog_api_client/v2/model/tag_policy_include.py +++ b/src/datadog_api_client/v2/model/tag_rule_include.py @@ -12,9 +12,9 @@ from typing import ClassVar -class TagPolicyInclude(ModelSimple): +class TagRuleInclude(ModelSimple): """ - A related resource to include alongside a tag policy in the response. Currently the only supported value is `score`. + A related resource to include alongside a tag rule in the response. Currently the only supported value is `score`. :param value: If omitted defaults to "score". Must be one of ["score"]. :type value: str @@ -23,7 +23,7 @@ class TagPolicyInclude(ModelSimple): allowed_values = { "score", } - SCORE: ClassVar["TagPolicyInclude"] + SCORE: ClassVar["TagRuleInclude"] @cached_property def openapi_types(_): @@ -32,4 +32,4 @@ def openapi_types(_): } -TagPolicyInclude.SCORE = TagPolicyInclude("score") +TagRuleInclude.SCORE = TagRuleInclude("score") diff --git a/src/datadog_api_client/v2/model/tag_policy_relationships.py b/src/datadog_api_client/v2/model/tag_rule_relationships.py similarity index 55% rename from src/datadog_api_client/v2/model/tag_policy_relationships.py rename to src/datadog_api_client/v2/model/tag_rule_relationships.py index 39ab37a666..1ebba4c6ba 100644 --- a/src/datadog_api_client/v2/model/tag_policy_relationships.py +++ b/src/datadog_api_client/v2/model/tag_rule_relationships.py @@ -14,28 +14,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_score_relationship import TagPolicyScoreRelationship + from datadog_api_client.v2.model.tag_rule_score_relationship import TagRuleScoreRelationship -class TagPolicyRelationships(ModelNormal): +class TagRuleRelationships(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_score_relationship import TagPolicyScoreRelationship + from datadog_api_client.v2.model.tag_rule_score_relationship import TagRuleScoreRelationship return { - "score": (TagPolicyScoreRelationship,), + "score": (TagRuleScoreRelationship,), } attribute_map = { "score": "score", } - def __init__(self_, score: Union[TagPolicyScoreRelationship, UnsetType] = unset, **kwargs): + def __init__(self_, score: Union[TagRuleScoreRelationship, UnsetType] = unset, **kwargs): """ - Related resources for a tag policy. Only present when the corresponding ``include`` query parameter is supplied. + Related resources for a tag rule. Only present when the corresponding ``include`` query parameter is supplied. - :param score: A relationship to the compliance score resource for this policy. - :type score: TagPolicyScoreRelationship, optional + :param score: A relationship to the compliance score resource for this rule. + :type score: TagRuleScoreRelationship, optional """ if score is not unset: kwargs["score"] = score diff --git a/src/datadog_api_client/v2/model/tag_policy_resource_type.py b/src/datadog_api_client/v2/model/tag_rule_resource_type.py similarity index 76% rename from src/datadog_api_client/v2/model/tag_policy_resource_type.py rename to src/datadog_api_client/v2/model/tag_rule_resource_type.py index 8bedc6962f..ab64a664dd 100644 --- a/src/datadog_api_client/v2/model/tag_policy_resource_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_resource_type.py @@ -12,9 +12,9 @@ from typing import ClassVar -class TagPolicyResourceType(ModelSimple): +class TagRuleResourceType(ModelSimple): """ - JSON:API resource type for a tag policy. + JSON:API resource type for a tag rule. :param value: If omitted defaults to "tag_policy". Must be one of ["tag_policy"]. :type value: str @@ -23,7 +23,7 @@ class TagPolicyResourceType(ModelSimple): allowed_values = { "tag_policy", } - TAG_POLICY: ClassVar["TagPolicyResourceType"] + TAG_POLICY: ClassVar["TagRuleResourceType"] @cached_property def openapi_types(_): @@ -32,4 +32,4 @@ def openapi_types(_): } -TagPolicyResourceType.TAG_POLICY = TagPolicyResourceType("tag_policy") +TagRuleResourceType.TAG_POLICY = TagRuleResourceType("tag_policy") diff --git a/src/datadog_api_client/v2/model/tag_policy_response.py b/src/datadog_api_client/v2/model/tag_rule_response.py similarity index 50% rename from src/datadog_api_client/v2/model/tag_policy_response.py rename to src/datadog_api_client/v2/model/tag_rule_response.py index 578210f123..f5341cc3f0 100644 --- a/src/datadog_api_client/v2/model/tag_policy_response.py +++ b/src/datadog_api_client/v2/model/tag_rule_response.py @@ -14,19 +14,19 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_data import TagPolicyData - from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData + from datadog_api_client.v2.model.tag_rule_data import TagRuleData + from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData -class TagPolicyResponse(ModelNormal): +class TagRuleResponse(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_data import TagPolicyData - from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData + from datadog_api_client.v2.model.tag_rule_data import TagRuleData + from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData return { - "data": (TagPolicyData,), - "included": ([TagPolicyScoreData],), + "data": (TagRuleData,), + "included": ([TagRuleScoreData],), } attribute_map = { @@ -34,15 +34,15 @@ def openapi_types(_): "included": "included", } - def __init__(self_, data: TagPolicyData, included: Union[List[TagPolicyScoreData], UnsetType] = unset, **kwargs): + def __init__(self_, data: TagRuleData, included: Union[List[TagRuleScoreData], UnsetType] = unset, **kwargs): """ - A single tag policy. + A single tag rule. - :param data: A tag policy resource. - :type data: TagPolicyData + :param data: A tag rule resource. + :type data: TagRuleData - :param included: Related resources fetched alongside the primary tag policies. Populated when an ``include`` query parameter is supplied. - :type included: [TagPolicyScoreData], optional + :param included: Related resources fetched alongside the primary tag rules. Populated when an ``include`` query parameter is supplied. + :type included: [TagRuleScoreData], optional """ if included is not unset: kwargs["included"] = included diff --git a/src/datadog_api_client/v2/model/tag_policy_score_attributes.py b/src/datadog_api_client/v2/model/tag_rule_score_attributes.py similarity index 83% rename from src/datadog_api_client/v2/model/tag_policy_score_attributes.py rename to src/datadog_api_client/v2/model/tag_rule_score_attributes.py index 20f6a43bc7..7b3671c050 100644 --- a/src/datadog_api_client/v2/model/tag_policy_score_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_attributes.py @@ -12,7 +12,7 @@ ) -class TagPolicyScoreAttributes(ModelNormal): +class TagRuleScoreAttributes(ModelNormal): @cached_property def openapi_types(_): return { @@ -31,9 +31,9 @@ def openapi_types(_): def __init__(self_, score: Union[float, none_type], ts_end: int, ts_start: int, version: int, **kwargs): """ - Attributes of a tag policy compliance score. + Attributes of a tag rule compliance score. - :param score: The compliance score for the policy over the requested time window, as a percentage + :param score: The compliance score for the rule over the requested time window, as a percentage between 0 and 100. ``null`` indicates that no relevant telemetry was found. :type score: float, none_type @@ -43,7 +43,7 @@ def __init__(self_, score: Union[float, none_type], ts_end: int, ts_start: int, :param ts_start: Start of the time window the score was computed over, as a Unix timestamp in milliseconds. :type ts_start: int - :param version: The version of the tag policy that the score was computed against. + :param version: The version of the tag rule that the score was computed against. :type version: int """ super().__init__(kwargs) 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 new file mode 100644 index 0000000000..8a6e731024 --- /dev/null +++ b/src/datadog_api_client/v2/model/tag_rule_score_data.py @@ -0,0 +1,54 @@ +# 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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tag_rule_score_attributes import TagRuleScoreAttributes + from datadog_api_client.v2.model.tag_rule_score_resource_type import TagRuleScoreResourceType + + +class TagRuleScoreData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tag_rule_score_attributes import TagRuleScoreAttributes + from datadog_api_client.v2.model.tag_rule_score_resource_type import TagRuleScoreResourceType + + return { + "attributes": (TagRuleScoreAttributes,), + "id": (str,), + "type": (TagRuleScoreResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: TagRuleScoreAttributes, id: str, type: TagRuleScoreResourceType, **kwargs): + """ + A compliance score resource for a tag rule. + + :param attributes: Attributes of a tag rule compliance score. + :type attributes: TagRuleScoreAttributes + + :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. + :type type: TagRuleScoreResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_score_relationship.py b/src/datadog_api_client/v2/model/tag_rule_score_relationship.py similarity index 62% rename from src/datadog_api_client/v2/model/tag_policy_score_relationship.py rename to src/datadog_api_client/v2/model/tag_rule_score_relationship.py index 2e23c42019..0e9c805d5a 100644 --- a/src/datadog_api_client/v2/model/tag_policy_score_relationship.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_relationship.py @@ -12,28 +12,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_score_relationship_data import TagPolicyScoreRelationshipData + from datadog_api_client.v2.model.tag_rule_score_relationship_data import TagRuleScoreRelationshipData -class TagPolicyScoreRelationship(ModelNormal): +class TagRuleScoreRelationship(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_score_relationship_data import TagPolicyScoreRelationshipData + from datadog_api_client.v2.model.tag_rule_score_relationship_data import TagRuleScoreRelationshipData return { - "data": (TagPolicyScoreRelationshipData,), + "data": (TagRuleScoreRelationshipData,), } attribute_map = { "data": "data", } - def __init__(self_, data: TagPolicyScoreRelationshipData, **kwargs): + def __init__(self_, data: TagRuleScoreRelationshipData, **kwargs): """ - A relationship to the compliance score resource for this policy. + A relationship to the compliance score resource for this rule. :param data: Identifier of the related compliance score resource. - :type data: TagPolicyScoreRelationshipData + :type data: TagRuleScoreRelationshipData """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_policy_score_relationship_data.py b/src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py similarity index 62% rename from src/datadog_api_client/v2/model/tag_policy_score_relationship_data.py rename to src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py index 0624a2b4cc..2b7603a714 100644 --- a/src/datadog_api_client/v2/model/tag_policy_score_relationship_data.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_relationship_data.py @@ -12,17 +12,17 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_score_resource_type import TagPolicyScoreResourceType + from datadog_api_client.v2.model.tag_rule_score_resource_type import TagRuleScoreResourceType -class TagPolicyScoreRelationshipData(ModelNormal): +class TagRuleScoreRelationshipData(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_score_resource_type import TagPolicyScoreResourceType + from datadog_api_client.v2.model.tag_rule_score_resource_type import TagRuleScoreResourceType return { "id": (str,), - "type": (TagPolicyScoreResourceType,), + "type": (TagRuleScoreResourceType,), } attribute_map = { @@ -30,15 +30,15 @@ def openapi_types(_): "type": "type", } - def __init__(self_, id: str, type: TagPolicyScoreResourceType, **kwargs): + def __init__(self_, id: str, type: TagRuleScoreResourceType, **kwargs): """ Identifier of the related compliance score resource. :param id: The unique identifier of the related compliance score resource. :type id: str - :param type: JSON:API resource type for a tag policy compliance score. - :type type: TagPolicyScoreResourceType + :param type: JSON:API resource type for a tag rule compliance score. + :type type: TagRuleScoreResourceType """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_policy_score_resource_type.py b/src/datadog_api_client/v2/model/tag_rule_score_resource_type.py similarity index 72% rename from src/datadog_api_client/v2/model/tag_policy_score_resource_type.py rename to src/datadog_api_client/v2/model/tag_rule_score_resource_type.py index 109ea20ec6..03f973308e 100644 --- a/src/datadog_api_client/v2/model/tag_policy_score_resource_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_resource_type.py @@ -12,9 +12,9 @@ from typing import ClassVar -class TagPolicyScoreResourceType(ModelSimple): +class TagRuleScoreResourceType(ModelSimple): """ - JSON:API resource type for a tag policy compliance score. + JSON:API resource type for a tag rule compliance score. :param value: If omitted defaults to "tag_policy_score". Must be one of ["tag_policy_score"]. :type value: str @@ -23,7 +23,7 @@ class TagPolicyScoreResourceType(ModelSimple): allowed_values = { "tag_policy_score", } - TAG_POLICY_SCORE: ClassVar["TagPolicyScoreResourceType"] + TAG_POLICY_SCORE: ClassVar["TagRuleScoreResourceType"] @cached_property def openapi_types(_): @@ -32,4 +32,4 @@ def openapi_types(_): } -TagPolicyScoreResourceType.TAG_POLICY_SCORE = TagPolicyScoreResourceType("tag_policy_score") +TagRuleScoreResourceType.TAG_POLICY_SCORE = TagRuleScoreResourceType("tag_policy_score") diff --git a/src/datadog_api_client/v2/model/tag_policy_create_request.py b/src/datadog_api_client/v2/model/tag_rule_score_response.py similarity index 56% rename from src/datadog_api_client/v2/model/tag_policy_create_request.py rename to src/datadog_api_client/v2/model/tag_rule_score_response.py index c531b82719..c554125ff3 100644 --- a/src/datadog_api_client/v2/model/tag_policy_create_request.py +++ b/src/datadog_api_client/v2/model/tag_rule_score_response.py @@ -12,28 +12,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_create_data import TagPolicyCreateData + from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData -class TagPolicyCreateRequest(ModelNormal): +class TagRuleScoreResponse(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_create_data import TagPolicyCreateData + from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData return { - "data": (TagPolicyCreateData,), + "data": (TagRuleScoreData,), } attribute_map = { "data": "data", } - def __init__(self_, data: TagPolicyCreateData, **kwargs): + def __init__(self_, data: TagRuleScoreData, **kwargs): """ - Payload for creating a new tag policy. + A tag rule compliance score. - :param data: Data object for creating a tag policy. - :type data: TagPolicyCreateData + :param data: A compliance score resource for a tag rule. + :type data: TagRuleScoreData """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_rule_source.py b/src/datadog_api_client/v2/model/tag_rule_source.py new file mode 100644 index 0000000000..af9f035319 --- /dev/null +++ b/src/datadog_api_client/v2/model/tag_rule_source.py @@ -0,0 +1,41 @@ +# 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 TagRuleSource(ModelSimple): + """ + The telemetry source that a tag rule applies to. + + :param value: Must be one of ["logs", "spans", "metrics"]. + :type value: str + """ + + allowed_values = { + "logs", + "spans", + "metrics", + } + LOGS: ClassVar["TagRuleSource"] + SPANS: ClassVar["TagRuleSource"] + METRICS: ClassVar["TagRuleSource"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TagRuleSource.LOGS = TagRuleSource("logs") +TagRuleSource.SPANS = TagRuleSource("spans") +TagRuleSource.METRICS = TagRuleSource("metrics") diff --git a/src/datadog_api_client/v2/model/tag_policy_type.py b/src/datadog_api_client/v2/model/tag_rule_type.py similarity index 70% rename from src/datadog_api_client/v2/model/tag_policy_type.py rename to src/datadog_api_client/v2/model/tag_rule_type.py index 86b7beedc4..2af092988b 100644 --- a/src/datadog_api_client/v2/model/tag_policy_type.py +++ b/src/datadog_api_client/v2/model/tag_rule_type.py @@ -12,9 +12,9 @@ from typing import ClassVar -class TagPolicyType(ModelSimple): +class TagRuleType(ModelSimple): """ - How the policy is enforced. `blocking` rejects telemetry that violates the policy. + How the rule is enforced. `blocking` rejects telemetry that violates the rule. `surfacing` only highlights non-compliant telemetry without blocking it. :param value: Must be one of ["blocking", "surfacing"]. @@ -25,8 +25,8 @@ class TagPolicyType(ModelSimple): "blocking", "surfacing", } - BLOCKING: ClassVar["TagPolicyType"] - SURFACING: ClassVar["TagPolicyType"] + BLOCKING: ClassVar["TagRuleType"] + SURFACING: ClassVar["TagRuleType"] @cached_property def openapi_types(_): @@ -35,5 +35,5 @@ def openapi_types(_): } -TagPolicyType.BLOCKING = TagPolicyType("blocking") -TagPolicyType.SURFACING = TagPolicyType("surfacing") +TagRuleType.BLOCKING = TagRuleType("blocking") +TagRuleType.SURFACING = TagRuleType("surfacing") diff --git a/src/datadog_api_client/v2/model/tag_policy_update_attributes.py b/src/datadog_api_client/v2/model/tag_rule_update_attributes.py similarity index 73% rename from src/datadog_api_client/v2/model/tag_policy_update_attributes.py rename to src/datadog_api_client/v2/model/tag_rule_update_attributes.py index 379fec2747..ab033b0db3 100644 --- a/src/datadog_api_client/v2/model/tag_policy_update_attributes.py +++ b/src/datadog_api_client/v2/model/tag_rule_update_attributes.py @@ -14,19 +14,19 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_type import TagPolicyType + from datadog_api_client.v2.model.tag_rule_type import TagRuleType -class TagPolicyUpdateAttributes(ModelNormal): +class TagRuleUpdateAttributes(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_type import TagPolicyType + from datadog_api_client.v2.model.tag_rule_type import TagRuleType return { "enabled": (bool,), "negated": (bool,), "policy_name": (str,), - "policy_type": (TagPolicyType,), + "policy_type": (TagRuleType,), "required": (bool,), "scope": (str,), "tag_key": (str,), @@ -49,7 +49,7 @@ def __init__( enabled: Union[bool, UnsetType] = unset, negated: Union[bool, UnsetType] = unset, policy_name: Union[str, UnsetType] = unset, - policy_type: Union[TagPolicyType, UnsetType] = unset, + policy_type: Union[TagRuleType, UnsetType] = unset, required: Union[bool, UnsetType] = unset, scope: Union[str, UnsetType] = unset, tag_key: Union[str, UnsetType] = unset, @@ -57,29 +57,29 @@ def __init__( **kwargs, ): """ - Mutable attributes of a tag policy. Each field is optional; omitting a field leaves its - current value unchanged. The ``source`` of a policy cannot be changed. + 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. - :param enabled: Whether the policy is currently enforced. + :param enabled: Whether the rule is currently enforced. :type enabled: bool, optional - :param negated: When ``true`` , the policy matches tag values that do NOT match any of the supplied patterns. + :param negated: When ``true`` , the rule matches tag values that do NOT match any of the supplied patterns. :type negated: bool, optional - :param policy_name: Human-readable name for the tag policy. + :param policy_name: Human-readable name for the tag rule. :type policy_name: str, optional - :param policy_type: How the policy is enforced. ``blocking`` rejects telemetry that violates the policy. + :param policy_type: How the rule is enforced. ``blocking`` rejects telemetry that violates the rule. ``surfacing`` only highlights non-compliant telemetry without blocking it. - :type policy_type: TagPolicyType, optional + :type policy_type: TagRuleType, optional :param required: When ``true`` , telemetry without this tag is treated as a violation. :type required: bool, optional - :param scope: The scope the policy applies within. + :param scope: The scope the rule applies within. :type scope: str, optional - :param tag_key: The tag key that the policy governs. + :param tag_key: The tag key that the rule governs. :type tag_key: str, optional :param tag_value_patterns: One or more patterns that valid values for the tag key must match. 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 new file mode 100644 index 0000000000..4f9ab84d0c --- /dev/null +++ b/src/datadog_api_client/v2/model/tag_rule_update_data.py @@ -0,0 +1,64 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.tag_rule_update_attributes import TagRuleUpdateAttributes + from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType + + +class TagRuleUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tag_rule_update_attributes import TagRuleUpdateAttributes + from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType + + return { + "attributes": (TagRuleUpdateAttributes,), + "id": (str,), + "type": (TagRuleResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: TagRuleResourceType, + attributes: Union[TagRuleUpdateAttributes, UnsetType] = unset, + **kwargs, + ): + """ + 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. + :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. + :type type: TagRuleResourceType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/tag_policy_update_request.py b/src/datadog_api_client/v2/model/tag_rule_update_request.py similarity index 54% rename from src/datadog_api_client/v2/model/tag_policy_update_request.py rename to src/datadog_api_client/v2/model/tag_rule_update_request.py index 447438b7ed..f74dd67350 100644 --- a/src/datadog_api_client/v2/model/tag_policy_update_request.py +++ b/src/datadog_api_client/v2/model/tag_rule_update_request.py @@ -12,28 +12,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.tag_policy_update_data import TagPolicyUpdateData + from datadog_api_client.v2.model.tag_rule_update_data import TagRuleUpdateData -class TagPolicyUpdateRequest(ModelNormal): +class TagRuleUpdateRequest(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.tag_policy_update_data import TagPolicyUpdateData + from datadog_api_client.v2.model.tag_rule_update_data import TagRuleUpdateData return { - "data": (TagPolicyUpdateData,), + "data": (TagRuleUpdateData,), } attribute_map = { "data": "data", } - def __init__(self_, data: TagPolicyUpdateData, **kwargs): + def __init__(self_, data: TagRuleUpdateData, **kwargs): """ - Payload for updating an existing tag policy. Only the supplied fields are modified. + Payload for updating an existing tag rule. Only the supplied fields are modified. - :param data: Data object for updating a tag policy. - :type data: TagPolicyUpdateData + :param data: Data object for updating a tag rule. + :type data: TagRuleUpdateData """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/tag_rules_list_response.py b/src/datadog_api_client/v2/model/tag_rules_list_response.py new file mode 100644 index 0000000000..2d1307eb82 --- /dev/null +++ b/src/datadog_api_client/v2/model/tag_rules_list_response.py @@ -0,0 +1,51 @@ +# 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.tag_rule_data import TagRuleData + from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData + + +class TagRulesListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.tag_rule_data import TagRuleData + from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData + + return { + "data": ([TagRuleData],), + "included": ([TagRuleScoreData],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__(self_, data: List[TagRuleData], included: Union[List[TagRuleScoreData], UnsetType] = unset, **kwargs): + """ + A page of tag rules. + + :param data: An array of tag rule data objects. + :type data: [TagRuleData] + + :param included: Related resources fetched alongside the primary tag rules. Populated when an ``include`` query parameter is supplied. + :type included: [TagRuleScoreData], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 6dcd30db0f..ff589bd98c 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -9704,28 +9704,28 @@ from datadog_api_client.v2.model.tag_indexing_rule_update_request import TagIndexingRuleUpdateRequest from datadog_api_client.v2.model.tag_indexing_rules_response import TagIndexingRulesResponse from datadog_api_client.v2.model.tag_indexing_rules_response_meta import TagIndexingRulesResponseMeta -from datadog_api_client.v2.model.tag_policies_list_response import TagPoliciesListResponse -from datadog_api_client.v2.model.tag_policy_attributes import TagPolicyAttributes -from datadog_api_client.v2.model.tag_policy_create_attributes import TagPolicyCreateAttributes -from datadog_api_client.v2.model.tag_policy_create_data import TagPolicyCreateData -from datadog_api_client.v2.model.tag_policy_create_request import TagPolicyCreateRequest -from datadog_api_client.v2.model.tag_policy_create_type import TagPolicyCreateType -from datadog_api_client.v2.model.tag_policy_data import TagPolicyData -from datadog_api_client.v2.model.tag_policy_include import TagPolicyInclude -from datadog_api_client.v2.model.tag_policy_relationships import TagPolicyRelationships -from datadog_api_client.v2.model.tag_policy_resource_type import TagPolicyResourceType -from datadog_api_client.v2.model.tag_policy_response import TagPolicyResponse -from datadog_api_client.v2.model.tag_policy_score_attributes import TagPolicyScoreAttributes -from datadog_api_client.v2.model.tag_policy_score_data import TagPolicyScoreData -from datadog_api_client.v2.model.tag_policy_score_relationship import TagPolicyScoreRelationship -from datadog_api_client.v2.model.tag_policy_score_relationship_data import TagPolicyScoreRelationshipData -from datadog_api_client.v2.model.tag_policy_score_resource_type import TagPolicyScoreResourceType -from datadog_api_client.v2.model.tag_policy_score_response import TagPolicyScoreResponse -from datadog_api_client.v2.model.tag_policy_source import TagPolicySource -from datadog_api_client.v2.model.tag_policy_type import TagPolicyType -from datadog_api_client.v2.model.tag_policy_update_attributes import TagPolicyUpdateAttributes -from datadog_api_client.v2.model.tag_policy_update_data import TagPolicyUpdateData -from datadog_api_client.v2.model.tag_policy_update_request import TagPolicyUpdateRequest +from datadog_api_client.v2.model.tag_rule_attributes import TagRuleAttributes +from datadog_api_client.v2.model.tag_rule_create_attributes import TagRuleCreateAttributes +from datadog_api_client.v2.model.tag_rule_create_data import TagRuleCreateData +from datadog_api_client.v2.model.tag_rule_create_request import TagRuleCreateRequest +from datadog_api_client.v2.model.tag_rule_create_type import TagRuleCreateType +from datadog_api_client.v2.model.tag_rule_data import TagRuleData +from datadog_api_client.v2.model.tag_rule_include import TagRuleInclude +from datadog_api_client.v2.model.tag_rule_relationships import TagRuleRelationships +from datadog_api_client.v2.model.tag_rule_resource_type import TagRuleResourceType +from datadog_api_client.v2.model.tag_rule_response import TagRuleResponse +from datadog_api_client.v2.model.tag_rule_score_attributes import TagRuleScoreAttributes +from datadog_api_client.v2.model.tag_rule_score_data import TagRuleScoreData +from datadog_api_client.v2.model.tag_rule_score_relationship import TagRuleScoreRelationship +from datadog_api_client.v2.model.tag_rule_score_relationship_data import TagRuleScoreRelationshipData +from datadog_api_client.v2.model.tag_rule_score_resource_type import TagRuleScoreResourceType +from datadog_api_client.v2.model.tag_rule_score_response import TagRuleScoreResponse +from datadog_api_client.v2.model.tag_rule_source import TagRuleSource +from datadog_api_client.v2.model.tag_rule_type import TagRuleType +from datadog_api_client.v2.model.tag_rule_update_attributes import TagRuleUpdateAttributes +from datadog_api_client.v2.model.tag_rule_update_data import TagRuleUpdateData +from datadog_api_client.v2.model.tag_rule_update_request import TagRuleUpdateRequest +from datadog_api_client.v2.model.tag_rules_list_response import TagRulesListResponse from datadog_api_client.v2.model.tags_event_attribute import TagsEventAttribute from datadog_api_client.v2.model.targeting_rule import TargetingRule from datadog_api_client.v2.model.targeting_rule_request import TargetingRuleRequest @@ -17299,28 +17299,28 @@ "TagIndexingRuleUpdateRequest", "TagIndexingRulesResponse", "TagIndexingRulesResponseMeta", - "TagPoliciesListResponse", - "TagPolicyAttributes", - "TagPolicyCreateAttributes", - "TagPolicyCreateData", - "TagPolicyCreateRequest", - "TagPolicyCreateType", - "TagPolicyData", - "TagPolicyInclude", - "TagPolicyRelationships", - "TagPolicyResourceType", - "TagPolicyResponse", - "TagPolicyScoreAttributes", - "TagPolicyScoreData", - "TagPolicyScoreRelationship", - "TagPolicyScoreRelationshipData", - "TagPolicyScoreResourceType", - "TagPolicyScoreResponse", - "TagPolicySource", - "TagPolicyType", - "TagPolicyUpdateAttributes", - "TagPolicyUpdateData", - "TagPolicyUpdateRequest", + "TagRuleAttributes", + "TagRuleCreateAttributes", + "TagRuleCreateData", + "TagRuleCreateRequest", + "TagRuleCreateType", + "TagRuleData", + "TagRuleInclude", + "TagRuleRelationships", + "TagRuleResourceType", + "TagRuleResponse", + "TagRuleScoreAttributes", + "TagRuleScoreData", + "TagRuleScoreRelationship", + "TagRuleScoreRelationshipData", + "TagRuleScoreResourceType", + "TagRuleScoreResponse", + "TagRuleSource", + "TagRuleType", + "TagRuleUpdateAttributes", + "TagRuleUpdateData", + "TagRuleUpdateRequest", + "TagRulesListResponse", "TagsEventAttribute", "TargetingRule", "TargetingRuleRequest", diff --git a/tests/v2/features/tag_policies.feature b/tests/v2/features/tag_rules.feature similarity index 60% rename from tests/v2/features/tag_policies.feature rename to tests/v2/features/tag_rules.feature index b5d064c202..a78d0357e3 100644 --- a/tests/v2/features/tag_policies.feature +++ b/tests/v2/features/tag_rules.feature @@ -1,149 +1,149 @@ -@endpoint(tag-policies) @endpoint(tag-policies-v2) -Feature: Tag Policies - Tag Policies define rules that govern which tag values are accepted for a +@endpoint(tag-rules) @endpoint(tag-rules-v2) +Feature: Tag Rules + Tag Rules define rules that govern which tag values are accepted for a given tag key, scoped to a particular telemetry source (such as logs, - spans, or metrics). Policies can be `blocking` (data not matching the - policy is rejected) or `surfacing` (matching data is highlighted but not - blocked). Each policy reports a compliance `score` derived from how much - recent telemetry adheres to the policy. + 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. Background: Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system - And an instance of "TagPolicies" API + And an instance of "TagRules" API @generated @skip @team:DataDog/aaa-governance-console - Scenario: Create a tag policy returns "Bad Request" response - Given operation "CreateTagPolicy" enabled - And new "CreateTagPolicy" request + 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, "negated": false, "policy_name": "Service tag must be one of api or web", "policy_type": "surfacing", "required": true, "scope": "env", "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 @generated @skip @team:DataDog/aaa-governance-console - Scenario: Create a tag policy returns "Conflict" response - Given operation "CreateTagPolicy" enabled - And new "CreateTagPolicy" request + Scenario: Create a tag rule returns "Conflict" response + Given operation "CreateTagRule" enabled + And new "CreateTagRule" request And body with value {"data": {"attributes": {"enabled": true, "negated": false, "policy_name": "Service tag must be one of api or web", "policy_type": "surfacing", "required": true, "scope": "env", "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 @generated @skip @team:DataDog/aaa-governance-console - Scenario: Create a tag policy returns "Created" response - Given operation "CreateTagPolicy" enabled - And new "CreateTagPolicy" request + Scenario: Create a tag rule returns "Created" response + Given operation "CreateTagRule" enabled + And new "CreateTagRule" request And body with value {"data": {"attributes": {"enabled": true, "negated": false, "policy_name": "Service tag must be one of api or web", "policy_type": "surfacing", "required": true, "scope": "env", "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 @generated @skip @team:DataDog/aaa-governance-console - Scenario: Delete a tag policy returns "Bad Request" response - Given operation "DeleteTagPolicy" enabled - And new "DeleteTagPolicy" request + Scenario: Delete a tag rule returns "Bad Request" response + Given operation "DeleteTagRule" enabled + And new "DeleteTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/aaa-governance-console - Scenario: Delete a tag policy returns "No Content" response - Given operation "DeleteTagPolicy" enabled - And new "DeleteTagPolicy" request + Scenario: Delete a tag rule returns "No Content" response + Given operation "DeleteTagRule" enabled + And new "DeleteTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 204 No Content @generated @skip @team:DataDog/aaa-governance-console - Scenario: Delete a tag policy returns "Not Found" response - Given operation "DeleteTagPolicy" enabled - And new "DeleteTagPolicy" request + Scenario: Delete a tag rule returns "Not Found" response + Given operation "DeleteTagRule" enabled + And new "DeleteTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/aaa-governance-console - Scenario: Get a tag policy compliance score returns "Bad Request" response - Given operation "GetTagPolicyScore" enabled - And new "GetTagPolicyScore" request + Scenario: Get a tag rule compliance score returns "Bad Request" response + Given operation "GetTagRuleScore" enabled + And new "GetTagRuleScore" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/aaa-governance-console - Scenario: Get a tag policy compliance score returns "Not Found" response - Given operation "GetTagPolicyScore" enabled - And new "GetTagPolicyScore" request + Scenario: Get a tag rule compliance score returns "Not Found" response + Given operation "GetTagRuleScore" enabled + And new "GetTagRuleScore" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/aaa-governance-console - Scenario: Get a tag policy compliance score returns "OK" response - Given operation "GetTagPolicyScore" enabled - And new "GetTagPolicyScore" request + Scenario: Get a tag rule compliance score returns "OK" response + Given operation "GetTagRuleScore" enabled + And new "GetTagRuleScore" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/aaa-governance-console - Scenario: Get a tag policy returns "Bad Request" response - Given operation "GetTagPolicy" enabled - And new "GetTagPolicy" request + Scenario: Get a tag rule returns "Bad Request" response + Given operation "GetTagRule" enabled + And new "GetTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/aaa-governance-console - Scenario: Get a tag policy returns "Not Found" response - Given operation "GetTagPolicy" enabled - And new "GetTagPolicy" request + Scenario: Get a tag rule returns "Not Found" response + Given operation "GetTagRule" enabled + And new "GetTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/aaa-governance-console - Scenario: Get a tag policy returns "OK" response - Given operation "GetTagPolicy" enabled - And new "GetTagPolicy" request + Scenario: Get a tag rule returns "OK" response + Given operation "GetTagRule" enabled + And new "GetTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/aaa-governance-console - Scenario: List tag policies returns "Bad Request" response - Given operation "ListTagPolicies" enabled - And new "ListTagPolicies" request + Scenario: List tag rules returns "Bad Request" response + Given operation "ListTagRules" enabled + And new "ListTagRules" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/aaa-governance-console - Scenario: List tag policies returns "OK" response - Given operation "ListTagPolicies" enabled - And new "ListTagPolicies" request + Scenario: List tag rules returns "OK" response + Given operation "ListTagRules" enabled + And new "ListTagRules" request When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/aaa-governance-console - Scenario: Update a tag policy returns "Bad Request" response - Given operation "UpdateTagPolicy" enabled - And new "UpdateTagPolicy" request + Scenario: Update a tag rule returns "Bad Request" response + Given operation "UpdateTagRule" enabled + And new "UpdateTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/aaa-governance-console - Scenario: Update a tag policy returns "Not Found" response - Given operation "UpdateTagPolicy" enabled - And new "UpdateTagPolicy" request + Scenario: Update a tag rule returns "Not Found" response + Given operation "UpdateTagRule" enabled + And new "UpdateTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/aaa-governance-console - Scenario: Update a tag policy returns "OK" response - Given operation "UpdateTagPolicy" enabled - And new "UpdateTagPolicy" request + Scenario: Update a tag rule returns "OK" response + Given operation "UpdateTagRule" enabled + And new "UpdateTagRule" request And request contains "policy_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} When the request is sent diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 9903d959ff..3afad07d1d 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -9448,16 +9448,16 @@ "type": "safe" } }, - "ListTagPolicies": { - "tag": "Tag Policies", + "ListTagRules": { + "tag": "Tag Rules", "undo": { "type": "safe" } }, - "CreateTagPolicy": { - "tag": "Tag Policies", + "CreateTagRule": { + "tag": "Tag Rules", "undo": { - "operationId": "DeleteTagPolicy", + "operationId": "DeleteTagRule", "parameters": [ { "name": "policy_id", @@ -9467,26 +9467,26 @@ "type": "unsafe" } }, - "DeleteTagPolicy": { - "tag": "Tag Policies", + "DeleteTagRule": { + "tag": "Tag Rules", "undo": { "type": "idempotent" } }, - "GetTagPolicy": { - "tag": "Tag Policies", + "GetTagRule": { + "tag": "Tag Rules", "undo": { "type": "safe" } }, - "UpdateTagPolicy": { - "tag": "Tag Policies", + "UpdateTagRule": { + "tag": "Tag Rules", "undo": { "type": "idempotent" } }, - "GetTagPolicyScore": { - "tag": "Tag Policies", + "GetTagRuleScore": { + "tag": "Tag Rules", "undo": { "type": "safe" }