diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 248e767e5ed3..e24a358f1bdc 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -114402,72 +114402,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 + name: + description: Human-readable name for the tag rule. + example: "Service tag must be one of api or web" + 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. - example: "Service tag must be one of api or web" - type: string - policy_type: - $ref: "#/components/schemas/TagPolicyType" required: description: When `true`, telemetry without this tag is treated as a violation. example: true type: boolean + rule_type: + $ref: "#/components/schemas/TagRuleType" 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: @@ -114485,7 +114475,7 @@ components: format: int64 type: integer required: - - policy_name + - name - source - scope - tag_key @@ -114493,44 +114483,44 @@ components: - negated - required - enabled - - policy_type + - rule_type - version - created_at - created_by - 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 + name: + description: Human-readable name for the tag rule. + example: "Service tag must be one of api or web" + type: string 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. - example: "Service tag must be one of api or web" - type: string - policy_type: - $ref: "#/components/schemas/TagPolicyCreateType" required: description: When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. example: true type: boolean + rule_type: + $ref: "#/components/schemas/TagRuleCreateType" 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: @@ -114546,35 +114536,35 @@ components: minItems: 1 type: array required: - - policy_name + - name - source - scope - tag_key - tag_value_patterns - - policy_type + - rule_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 @@ -114582,72 +114572,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" + - tag_rule + example: "tag_rule" type: string x-enum-varnames: - - TAG_POLICY - TagPolicyResponse: - description: A single tag policy. + - TAG_RULE + 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 @@ -114664,7 +114654,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 @@ -114674,31 +114664,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: @@ -114706,29 +114696,29 @@ 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" + - tag_rule_score + example: "tag_rule_score" type: string x-enum-varnames: - - TAG_POLICY_SCORE - TagPolicyScoreResponse: - description: A tag policy compliance score. + - TAG_RULE_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 @@ -114743,9 +114733,9 @@ components: - 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 @@ -114755,30 +114745,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 + name: + description: Human-readable name for the tag rule. + 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. type: boolean - policy_name: - description: Human-readable name for the tag policy. - type: string - policy_type: - $ref: "#/components/schemas/TagPolicyType" required: description: When `true`, telemetry without this tag is treated as a violation. type: boolean + rule_type: + $ref: "#/components/schemas/TagRuleType" 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. @@ -114787,26 +114777,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/TagRuleUpdateData" + required: + - data + type: object + TagRulesListResponse: + description: A page of tag rules. properties: data: - $ref: "#/components/schemas/TagPolicyUpdateData" + $ref: "#/components/schemas/TagRuleDataArray" + included: + $ref: "#/components/schemas/TagRuleIncludedResources" required: - data type: object @@ -151506,13 +151506,57 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/hamr: + /api/v2/governance/tag_rules: get: description: |- - Retrieve the High Availability Multi-Region (HAMR) organization connection details for the authenticated organization. - This endpoint returns information about the HAMR connection configuration, including the target organization, - datacenter, status, and whether this is the primary or secondary organization in the HAMR relationship. - operationId: GetHamrOrgConnection + 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: ListTagRules + parameters: + - 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 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 rule in the response. Currently the only supported value is `score`. + example: "score" + in: query + name: include + required: false + schema: + $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/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 + name: ts_start + required: false + schema: + format: int64 + type: integer + - description: 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`. + example: 1779401466097 + in: query + name: ts_end + required: false + schema: + format: int64 + type: integer responses: "200": content: @@ -151521,18 +151565,40 @@ paths: default: value: data: - attributes: - hamr_status: 4 - is_primary: true - modified_at: "2024-01-01T00:00:00+00:00" - modified_by: test@example.com - target_org_datacenter: us1 - target_org_name: Production Backup Org - target_org_uuid: 00000000-0000-0000-0000-000000000001 - id: 00000000-0000-0000-0000-000000000001 - type: hamr_org_connections + - attributes: + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:11:06.108696Z" + modified_by: "test-user" + name: "Service tag must be one of api or web" + negated: false + required: true + rule_type: "surfacing" + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 1 + id: "123" + relationships: + score: + data: + id: "123-v1-1779315066097-1779401466097" + type: "tag_rule_score" + type: "tag_rule" + included: + - attributes: + score: 80 + ts_end: 1779401466097 + ts_start: 1779315066097 + version: 1 + id: "123-v1-1779315066097-1779401466097" + type: "tag_rule_score" schema: - $ref: "#/components/schemas/HamrOrgConnectionResponse" + $ref: "#/components/schemas/TagRulesListResponse" description: OK "400": content: @@ -151540,35 +151606,40 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Bad Request - "403": + "401": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": + description: Unauthorized + "403": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found + description: Forbidden "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: Get HAMR organization connection + summary: List tag rules tags: - - High Availability MultiRegion + - Tag Rules + "x-permission": + operator: OR + permissions: + - telemetry_rules_read + - metrics_read x-unstable: |- - **Note**: This endpoint is in public beta and is subject to change. + **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). post: description: |- - Create or update the High Availability Multi-Region (HAMR) organization connection. - This endpoint allows you to configure the HAMR connection between the authenticated organization - and a target organization, including setting the connection status (ONBOARDING, PASSIVE, FAILOVER, ACTIVE, RECOVERY) - operationId: CreateHamrOrgConnection + 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 + `rule_id`, `version`, and the timestamp/audit fields are assigned by the server. + operationId: CreateTagRule requestBody: content: application/json: @@ -151577,19 +151648,23 @@ paths: value: data: attributes: - hamr_status: 4 - is_primary: true - modified_by: admin@example.com - target_org_datacenter: us1 - target_org_name: Production Backup Org - target_org_uuid: 660f9511-f3ac-52e5-b827-557766551111 - id: 550e8400-e29b-41d4-a716-446655440000 - type: hamr_org_connections + enabled: true + name: "Service tag must be one of api or web" + negated: false + required: true + rule_type: "surfacing" + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + type: "tag_rule" schema: - $ref: "#/components/schemas/HamrOrgConnectionRequest" + $ref: "#/components/schemas/TagRuleCreateRequest" required: true responses: - "200": + "201": content: application/json: examples: @@ -151597,51 +151672,167 @@ paths: value: data: attributes: - hamr_status: 4 - is_primary: true - modified_at: "2024-01-01T00:00:00+00:00" - modified_by: test@example.com - target_org_datacenter: us1 - target_org_name: Production Backup Org - target_org_uuid: 00000000-0000-0000-0000-000000000001 - id: 00000000-0000-0000-0000-000000000002 - type: hamr_org_connections + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:11:06.108696Z" + modified_by: "test-user" + name: "Service tag must be one of api or web" + negated: false + required: true + rule_type: "surfacing" + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 1 + id: "123" + type: "tag_rule" schema: - $ref: "#/components/schemas/HamrOrgConnectionResponse" - description: OK + $ref: "#/components/schemas/TagRuleResponse" + description: Created "400": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict "429": $ref: "#/components/responses/TooManyRequestsResponse" - "500": + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a tag rule + tags: + - Tag Rules + "x-permission": + operator: AND + permissions: + - telemetry_rules_create + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/governance/tag_rules/{rule_id}: + delete: + description: |- + Delete a tag rule. By default the rule is soft-deleted so it can be recovered later + and so that historical score data remains queryable. Pass `hard_delete=true` to remove + the rule permanently. + operationId: DeleteTagRule + parameters: + - description: The unique identifier of the tag rule to delete. + example: "123" + in: path + name: rule_id + required: true + schema: + type: string + - description: Whether to permanently delete the rule instead of performing a soft delete. Defaults to `false`. + example: false + in: query + name: hard_delete + required: false + schema: + type: boolean + responses: + "204": + description: No Content + "400": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Internal Server Error + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - summary: Create or update HAMR organization connection + summary: Delete a tag rule tags: - - High Availability MultiRegion + - Tag Rules + "x-permission": + operator: AND + permissions: + - telemetry_rules_create x-unstable: |- - **Note**: This endpoint is in public beta and is subject to change. + **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/identity_providers: get: - description: Get all identity providers available for the current organization. - operationId: ListIdentityProviders + description: |- + 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: GetTagRule + parameters: + - description: The unique identifier of the tag rule. + example: "123" + in: path + name: rule_id + required: true + schema: + type: string + - 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/TagRuleInclude" + - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + example: 1779315066097 + in: query + name: ts_start + required: false + schema: + format: int64 + type: integer + - description: 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`. + example: 1779401466097 + in: query + name: ts_end + required: false + schema: + format: int64 + type: integer responses: "200": content: @@ -151650,51 +151841,95 @@ paths: default: value: data: + attributes: + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:11:06.108696Z" + modified_by: "test-user" + name: "Service tag must be one of api or web" + negated: false + required: true + rule_type: "surfacing" + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 1 + id: "123" + relationships: + score: + data: + id: "123-v1-1779315066097-1779401466097" + type: "tag_rule_score" + type: "tag_rule" + included: - attributes: - authentication_method: "SAML" - enabled: true - id: "00000000-0000-0000-0000-000000000001" - type: identity_providers - - attributes: - authentication_method: google_oidc - enabled: false - id: "00000000-0000-0000-0000-000000000002" - type: identity_providers - - attributes: - authentication_method: standard - enabled: false - id: "00000000-0000-0000-0000-000000000003" - type: identity_providers + score: 80 + ts_end: 1779401466097 + ts_start: 1779315066097 + version: 1 + id: "123-v1-1779315066097-1779401466097" + type: "tag_rule_score" schema: - $ref: "#/components/schemas/IdentityProvidersResponse" + $ref: "#/components/schemas/TagRuleResponse" description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Authentication error + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - org_management - summary: List identity providers + summary: Get a tag rule tags: - - Identity Providers + - Tag Rules "x-permission": operator: OR permissions: - - org_management - - user_access_manage - /api/v2/identity_providers/{idp_id}: + - telemetry_rules_read + - metrics_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: - description: Enable or disable an identity provider for the current organization. - operationId: UpdateIdentityProvider + description: |- + 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: UpdateTagRule parameters: - - $ref: "#/components/parameters/IdentityProviderId" + - description: The unique identifier of the tag rule to update. + example: "123" + in: path + name: rule_id + required: true + schema: + type: string requestBody: content: application/json: @@ -151704,10 +151939,11 @@ paths: data: attributes: enabled: true - id: "00000000-0000-0000-0000-000000000001" - type: identity_providers + name: "Service tag must be one of api, web, or worker" + id: "123" + type: "tag_rule" schema: - $ref: "#/components/schemas/IdentityProviderUpdateRequest" + $ref: "#/components/schemas/TagRuleUpdateRequest" required: true responses: "200": @@ -151718,12 +151954,26 @@ paths: value: data: attributes: - authentication_method: "SAML" + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" enabled: true - id: "00000000-0000-0000-0000-000000000001" - type: identity_providers + modified_at: "2026-05-21T22:25:01.000000Z" + modified_by: "test-user" + name: "Service tag must be one of api, web, or worker" + negated: false + required: true + rule_type: "surfacing" + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 2 + id: "123" + type: "tag_rule" schema: - $ref: "#/components/schemas/IdentityProviderResponse" + $ref: "#/components/schemas/TagRuleResponse" description: OK "400": content: @@ -151731,73 +151981,71 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Authentication error + description: Forbidden "404": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not found + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - org_management - summary: Update an identity provider + summary: Update a tag rule tags: - - Identity Providers - x-codegen-request-body-name: body + - Tag Rules "x-permission": - operator: OR + operator: AND permissions: - - org_management - /api/v2/identity_providers/{idp_id}/users: + - telemetry_rules_create + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/governance/tag_rules/{rule_id}/score: get: description: |- - Get all users in the organization whose login method has been overridden - to use the specified identity provider. - operationId: ListIdentityProviderUsers + 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 rule. A `null` score indicates that + no relevant telemetry was found. + operationId: GetTagRuleScore parameters: - - $ref: "#/components/parameters/IdentityProviderId" - - $ref: "#/components/parameters/PageSize" - - $ref: "#/components/parameters/PageNumber" - - description: User attribute to order results by. Options include `email` and `name`. - in: query - name: sort - required: false + - description: The unique identifier of the tag rule. + example: "123" + in: path + name: rule_id + required: true schema: - default: email - example: email type: string - - description: "Direction of sort. Options: `asc`, `desc`." - in: query - name: sort_dir - required: false - schema: - $ref: "#/components/schemas/QuerySortOrder" - - description: Filter users by the given string. Defaults to no filtering. + - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + example: 1779315066097 in: query - name: filter + name: ts_start required: false schema: - type: string - - description: |- - Filter on status attribute. - Comma-separated list, with possible values `Active`, `Pending`, and `Disabled`. - Defaults to no filtering. + format: int64 + type: integer + - description: 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`. + example: 1779401466097 in: query - name: filter[status] + name: ts_end required: false schema: - example: Active - type: string + format: int64 + type: integer responses: "200": content: @@ -151806,19 +152054,15 @@ paths: default: value: data: - - attributes: - email: example@datadoghq.com - handle: example-user - name: Example User - status: Active - id: "00000000-0000-9999-0000-000000000001" - type: users - meta: - page: - total_count: 1 - total_filtered_count: 1 + attributes: + score: 80 + ts_end: 1779401466097 + ts_start: 1779315066097 + version: 1 + id: "123-v1-1779315066097-1779401466097" + type: "tag_rule_score" schema: - $ref: "#/components/schemas/UsersResponse" + $ref: "#/components/schemas/TagRuleScoreResponse" description: OK "400": content: @@ -151826,37 +152070,391 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized "403": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Authentication error + description: Forbidden "404": content: application/json: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not found + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - org_management - summary: List users with an identity provider override + summary: Get a tag rule compliance score tags: - - Identity Providers - x-pagination: - limitParam: page[size] - pageParam: page[number] - resultsPath: data + - Tag Rules "x-permission": operator: OR permissions: - - org_management - /api/v2/idp/entity_integrations/{integration_id}: + - telemetry_rules_read + - metrics_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/hamr: + get: + description: |- + Retrieve the High Availability Multi-Region (HAMR) organization connection details for the authenticated organization. + This endpoint returns information about the HAMR connection configuration, including the target organization, + datacenter, status, and whether this is the primary or secondary organization in the HAMR relationship. + operationId: GetHamrOrgConnection + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + hamr_status: 4 + is_primary: true + modified_at: "2024-01-01T00:00:00+00:00" + modified_by: test@example.com + target_org_datacenter: us1 + target_org_name: Production Backup Org + target_org_uuid: 00000000-0000-0000-0000-000000000001 + id: 00000000-0000-0000-0000-000000000001 + type: hamr_org_connections + schema: + $ref: "#/components/schemas/HamrOrgConnectionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get HAMR organization connection + tags: + - High Availability MultiRegion + x-unstable: |- + **Note**: This endpoint is in public beta and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create or update the High Availability Multi-Region (HAMR) organization connection. + This endpoint allows you to configure the HAMR connection between the authenticated organization + and a target organization, including setting the connection status (ONBOARDING, PASSIVE, FAILOVER, ACTIVE, RECOVERY) + operationId: CreateHamrOrgConnection + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + hamr_status: 4 + is_primary: true + modified_by: admin@example.com + target_org_datacenter: us1 + target_org_name: Production Backup Org + target_org_uuid: 660f9511-f3ac-52e5-b827-557766551111 + id: 550e8400-e29b-41d4-a716-446655440000 + type: hamr_org_connections + schema: + $ref: "#/components/schemas/HamrOrgConnectionRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + hamr_status: 4 + is_primary: true + modified_at: "2024-01-01T00:00:00+00:00" + modified_by: test@example.com + target_org_datacenter: us1 + target_org_name: Production Backup Org + target_org_uuid: 00000000-0000-0000-0000-000000000001 + id: 00000000-0000-0000-0000-000000000002 + type: hamr_org_connections + schema: + $ref: "#/components/schemas/HamrOrgConnectionResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create or update HAMR organization connection + tags: + - High Availability MultiRegion + x-unstable: |- + **Note**: This endpoint is in public beta and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/identity_providers: + get: + description: Get all identity providers available for the current organization. + operationId: ListIdentityProviders + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + authentication_method: "SAML" + enabled: true + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + - attributes: + authentication_method: google_oidc + enabled: false + id: "00000000-0000-0000-0000-000000000002" + type: identity_providers + - attributes: + authentication_method: standard + enabled: false + id: "00000000-0000-0000-0000-000000000003" + type: identity_providers + schema: + $ref: "#/components/schemas/IdentityProvidersResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: List identity providers + tags: + - Identity Providers + "x-permission": + operator: OR + permissions: + - org_management + - user_access_manage + /api/v2/identity_providers/{idp_id}: + patch: + description: Enable or disable an identity provider for the current organization. + operationId: UpdateIdentityProvider + parameters: + - $ref: "#/components/parameters/IdentityProviderId" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + schema: + $ref: "#/components/schemas/IdentityProviderUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + authentication_method: "SAML" + enabled: true + id: "00000000-0000-0000-0000-000000000001" + type: identity_providers + schema: + $ref: "#/components/schemas/IdentityProviderResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: Update an identity provider + tags: + - Identity Providers + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - org_management + /api/v2/identity_providers/{idp_id}/users: + get: + description: |- + Get all users in the organization whose login method has been overridden + to use the specified identity provider. + operationId: ListIdentityProviderUsers + parameters: + - $ref: "#/components/parameters/IdentityProviderId" + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - description: User attribute to order results by. Options include `email` and `name`. + in: query + name: sort + required: false + schema: + default: email + example: email + type: string + - description: "Direction of sort. Options: `asc`, `desc`." + in: query + name: sort_dir + required: false + schema: + $ref: "#/components/schemas/QuerySortOrder" + - description: Filter users by the given string. Defaults to no filtering. + in: query + name: filter + required: false + schema: + type: string + - description: |- + Filter on status attribute. + Comma-separated list, with possible values `Active`, `Pending`, and `Disabled`. + Defaults to no filtering. + in: query + name: filter[status] + required: false + schema: + example: Active + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + email: example@datadoghq.com + handle: example-user + name: Example User + status: Active + id: "00000000-0000-9999-0000-000000000001" + type: users + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/UsersResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: List users with an identity provider override + tags: + - Identity Providers + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + "x-permission": + operator: OR + permissions: + - org_management + /api/v2/idp/entity_integrations/{integration_id}: delete: description: Delete the configuration stored for a given integration in the caller's organization. operationId: DeleteEntityIntegrationConfig @@ -214045,604 +214643,6 @@ paths: operator: OR permissions: - synthetics_global_variable_write - /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 - via the `include=score` query parameter. - operationId: ListTagPolicies - parameters: - - description: Whether to include policies 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`. - 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`. - 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. - in: query - name: filter[source] - required: false - schema: - $ref: "#/components/schemas/TagPolicySource" - - 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 - name: ts_start - required: false - schema: - format: int64 - type: integer - - description: 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`. - example: 1779401466097 - in: query - name: ts_end - required: false - schema: - format: int64 - type: integer - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - created_at: "2026-05-21T22:11:06.108696Z" - created_by: "test-user" - enabled: true - modified_at: "2026-05-21T22:11:06.108696Z" - modified_by: "test-user" - 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" - version: 1 - id: "123" - relationships: - score: - data: - id: "123-v1-1779315066097-1779401466097" - type: "tag_policy_score" - type: "tag_policy" - included: - - attributes: - score: 80 - ts_end: 1779401466097 - ts_start: 1779315066097 - version: 1 - id: "123-v1-1779315066097-1779401466097" - type: "tag_policy_score" - schema: - $ref: "#/components/schemas/TagPoliciesListResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: List tag policies - tags: - - Tag Policies - "x-permission": - operator: OR - permissions: - - telemetry_rules_read - - metrics_read - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - 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 - 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 - requestBody: - content: - application/json: - examples: - default: - 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" - schema: - $ref: "#/components/schemas/TagPolicyCreateRequest" - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2026-05-21T22:11:06.108696Z" - created_by: "test-user" - enabled: true - modified_at: "2026-05-21T22:11:06.108696Z" - modified_by: "test-user" - 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" - version: 1 - id: "123" - type: "tag_policy" - schema: - $ref: "#/components/schemas/TagPolicyResponse" - description: Created - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "409": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Conflict - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Create a tag policy - tags: - - Tag Policies - "x-permission": - operator: AND - permissions: - - telemetry_rules_create - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /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 - and so that historical score data remains queryable. Pass `hard_delete=true` to remove - the policy permanently. - operationId: DeleteTagPolicy - parameters: - - description: The unique identifier of the tag policy 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`. - example: false - in: query - name: hard_delete - required: false - schema: - type: boolean - responses: - "204": - description: No Content - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Delete a tag policy - tags: - - Tag Policies - "x-permission": - operator: AND - permissions: - - telemetry_rules_create - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - 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 - cannot be retrieved. - operationId: GetTagPolicy - parameters: - - description: The unique identifier of the tag policy. - 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`. - example: "score" - in: query - name: include - required: false - schema: - $ref: "#/components/schemas/TagPolicyInclude" - - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. - example: 1779315066097 - in: query - name: ts_start - required: false - schema: - format: int64 - type: integer - - description: 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`. - example: 1779401466097 - in: query - name: ts_end - required: false - schema: - format: int64 - type: integer - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2026-05-21T22:11:06.108696Z" - created_by: "test-user" - enabled: true - modified_at: "2026-05-21T22:11:06.108696Z" - modified_by: "test-user" - 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" - version: 1 - id: "123" - relationships: - score: - data: - id: "123-v1-1779315066097-1779401466097" - type: "tag_policy_score" - type: "tag_policy" - included: - - attributes: - score: 80 - ts_end: 1779401466097 - ts_start: 1779315066097 - version: 1 - id: "123-v1-1779315066097-1779401466097" - type: "tag_policy_score" - schema: - $ref: "#/components/schemas/TagPolicyResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Get a tag policy - tags: - - Tag Policies - "x-permission": - operator: OR - permissions: - - telemetry_rules_read - - metrics_read - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - 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 - `source` cannot be changed after creation. - operationId: UpdateTagPolicy - parameters: - - description: The unique identifier of the tag policy to update. - example: "123" - in: path - name: policy_id - required: true - schema: - type: string - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - enabled: true - policy_name: "Service tag must be one of api, web, or worker" - id: "123" - type: "tag_policy" - schema: - $ref: "#/components/schemas/TagPolicyUpdateRequest" - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - created_at: "2026-05-21T22:11:06.108696Z" - created_by: "test-user" - enabled: true - modified_at: "2026-05-21T22:25:01.000000Z" - modified_by: "test-user" - negated: false - policy_name: "Service tag must be one of api, web, or worker" - policy_type: "surfacing" - required: true - scope: "env" - source: "logs" - tag_key: "service" - tag_value_patterns: - - "api" - - "web" - version: 2 - id: "123" - type: "tag_policy" - schema: - $ref: "#/components/schemas/TagPolicyResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Update a tag policy - tags: - - Tag Policies - "x-permission": - operator: AND - permissions: - - telemetry_rules_create - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/tag_policies/{policy_id}/score: - get: - description: |- - Retrieve the compliance score for a single tag policy. 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 - no relevant telemetry was found. - operationId: GetTagPolicyScore - parameters: - - description: The unique identifier of the tag policy. - example: "123" - in: path - name: policy_id - required: true - schema: - type: string - - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. - example: 1779315066097 - in: query - name: ts_start - required: false - schema: - format: int64 - type: integer - - description: 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`. - example: 1779401466097 - in: query - name: ts_end - required: false - schema: - format: int64 - type: integer - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - score: 80 - ts_end: 1779401466097 - ts_start: 1779315066097 - version: 1 - id: "123-v1-1779315066097-1779401466097" - type: "tag_policy_score" - schema: - $ref: "#/components/schemas/TagPolicyScoreResponse" - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Get a tag policy compliance score - tags: - - Tag Policies - "x-permission": - operator: OR - permissions: - - telemetry_rules_read - - metrics_read - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/tags/enrichment: get: description: List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization @@ -221139,12 +221139,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/examples/v2/tag-policies/CreateTagPolicy.rb b/examples/v2/tag-policies/CreateTagPolicy.rb deleted file mode 100644 index 887f9e411594..000000000000 --- a/examples/v2/tag-policies/CreateTagPolicy.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Create a tag policy returns "Created" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_tag_policy".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new - -body = DatadogAPIClient::V2::TagPolicyCreateRequest.new({ - data: DatadogAPIClient::V2::TagPolicyCreateData.new({ - attributes: DatadogAPIClient::V2::TagPolicyCreateAttributes.new({ - enabled: true, - negated: false, - policy_name: "Service tag must be one of api or web", - policy_type: DatadogAPIClient::V2::TagPolicyCreateType::SURFACING, - required: true, - scope: "env", - source: DatadogAPIClient::V2::TagPolicySource::LOGS, - tag_key: "service", - tag_value_patterns: [ - "api", - "web", - ], - }), - type: DatadogAPIClient::V2::TagPolicyResourceType::TAG_POLICY, - }), -}) -p api_instance.create_tag_policy(body) diff --git a/examples/v2/tag-policies/DeleteTagPolicy.rb b/examples/v2/tag-policies/DeleteTagPolicy.rb deleted file mode 100644 index 2d2754052515..000000000000 --- a/examples/v2/tag-policies/DeleteTagPolicy.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Delete a tag policy returns "No Content" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.delete_tag_policy".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new -api_instance.delete_tag_policy("policy_id") diff --git a/examples/v2/tag-policies/GetTagPolicy.rb b/examples/v2/tag-policies/GetTagPolicy.rb deleted file mode 100644 index 1fc5dcbfd922..000000000000 --- a/examples/v2/tag-policies/GetTagPolicy.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Get a tag policy returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_tag_policy".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new -p api_instance.get_tag_policy("policy_id") diff --git a/examples/v2/tag-policies/GetTagPolicyScore.rb b/examples/v2/tag-policies/GetTagPolicyScore.rb deleted file mode 100644 index aa2f99d0d7cf..000000000000 --- a/examples/v2/tag-policies/GetTagPolicyScore.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Get a tag policy compliance score returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_tag_policy_score".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new -p api_instance.get_tag_policy_score("policy_id") diff --git a/examples/v2/tag-policies/ListTagPolicies.rb b/examples/v2/tag-policies/ListTagPolicies.rb deleted file mode 100644 index 04aa25b02572..000000000000 --- a/examples/v2/tag-policies/ListTagPolicies.rb +++ /dev/null @@ -1,8 +0,0 @@ -# List tag policies returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_tag_policies".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new -p api_instance.list_tag_policies() diff --git a/examples/v2/tag-policies/UpdateTagPolicy.rb b/examples/v2/tag-policies/UpdateTagPolicy.rb deleted file mode 100644 index 4cfaad12eced..000000000000 --- a/examples/v2/tag-policies/UpdateTagPolicy.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Update a tag policy returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.update_tag_policy".to_sym] = true -end -api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new - -body = DatadogAPIClient::V2::TagPolicyUpdateRequest.new({ - data: DatadogAPIClient::V2::TagPolicyUpdateData.new({ - attributes: DatadogAPIClient::V2::TagPolicyUpdateAttributes.new({ - policy_type: DatadogAPIClient::V2::TagPolicyType::SURFACING, - tag_value_patterns: [], - }), - id: "123", - type: DatadogAPIClient::V2::TagPolicyResourceType::TAG_POLICY, - }), -}) -p api_instance.update_tag_policy("policy_id", body) diff --git a/examples/v2/tag-rules/CreateTagRule.rb b/examples/v2/tag-rules/CreateTagRule.rb new file mode 100644 index 000000000000..295a81301019 --- /dev/null +++ b/examples/v2/tag-rules/CreateTagRule.rb @@ -0,0 +1,28 @@ +# Create a tag rule returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_tag_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TagRulesAPI.new + +body = DatadogAPIClient::V2::TagRuleCreateRequest.new({ + data: DatadogAPIClient::V2::TagRuleCreateData.new({ + attributes: DatadogAPIClient::V2::TagRuleCreateAttributes.new({ + enabled: true, + name: "Service tag must be one of api or web", + negated: false, + required: true, + rule_type: DatadogAPIClient::V2::TagRuleCreateType::SURFACING, + scope: "env", + source: DatadogAPIClient::V2::TagRuleSource::LOGS, + tag_key: "service", + tag_value_patterns: [ + "api", + "web", + ], + }), + type: DatadogAPIClient::V2::TagRuleResourceType::TAG_RULE, + }), +}) +p api_instance.create_tag_rule(body) diff --git a/examples/v2/tag-rules/DeleteTagRule.rb b/examples/v2/tag-rules/DeleteTagRule.rb new file mode 100644 index 000000000000..0b094d3f40e1 --- /dev/null +++ b/examples/v2/tag-rules/DeleteTagRule.rb @@ -0,0 +1,8 @@ +# Delete a tag rule returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_tag_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TagRulesAPI.new +api_instance.delete_tag_rule("rule_id") diff --git a/examples/v2/tag-rules/GetTagRule.rb b/examples/v2/tag-rules/GetTagRule.rb new file mode 100644 index 000000000000..bd14154efa2e --- /dev/null +++ b/examples/v2/tag-rules/GetTagRule.rb @@ -0,0 +1,8 @@ +# Get a tag rule returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_tag_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TagRulesAPI.new +p api_instance.get_tag_rule("rule_id") diff --git a/examples/v2/tag-rules/GetTagRuleScore.rb b/examples/v2/tag-rules/GetTagRuleScore.rb new file mode 100644 index 000000000000..226a47a60ae9 --- /dev/null +++ b/examples/v2/tag-rules/GetTagRuleScore.rb @@ -0,0 +1,8 @@ +# Get a tag rule compliance score returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_tag_rule_score".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TagRulesAPI.new +p api_instance.get_tag_rule_score("rule_id") diff --git a/examples/v2/tag-rules/ListTagRules.rb b/examples/v2/tag-rules/ListTagRules.rb new file mode 100644 index 000000000000..1ed05408246a --- /dev/null +++ b/examples/v2/tag-rules/ListTagRules.rb @@ -0,0 +1,8 @@ +# List tag rules returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_tag_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TagRulesAPI.new +p api_instance.list_tag_rules() diff --git a/examples/v2/tag-rules/UpdateTagRule.rb b/examples/v2/tag-rules/UpdateTagRule.rb new file mode 100644 index 000000000000..c3dc36e3db69 --- /dev/null +++ b/examples/v2/tag-rules/UpdateTagRule.rb @@ -0,0 +1,19 @@ +# Update a tag rule returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_tag_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TagRulesAPI.new + +body = DatadogAPIClient::V2::TagRuleUpdateRequest.new({ + data: DatadogAPIClient::V2::TagRuleUpdateData.new({ + attributes: DatadogAPIClient::V2::TagRuleUpdateAttributes.new({ + rule_type: DatadogAPIClient::V2::TagRuleType::SURFACING, + tag_value_patterns: [], + }), + id: "123", + type: DatadogAPIClient::V2::TagRuleResourceType::TAG_RULE, + }), +}) +p api_instance.update_tag_rule("rule_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index baee3e1a3240..dba8508d0703 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3539,6 +3539,36 @@ "v2.UpdateGovernanceNotificationSettings" => { "body" => "GovernanceNotificationSettingsUpdateRequest", }, + "v2.ListTagRules" => { + "include_disabled" => "Boolean", + "include_deleted" => "Boolean", + "include" => "TagRuleInclude", + "filter_source" => "TagRuleSource", + "ts_start" => "Integer", + "ts_end" => "Integer", + }, + "v2.CreateTagRule" => { + "body" => "TagRuleCreateRequest", + }, + "v2.DeleteTagRule" => { + "rule_id" => "String", + "hard_delete" => "Boolean", + }, + "v2.GetTagRule" => { + "rule_id" => "String", + "include" => "TagRuleInclude", + "ts_start" => "Integer", + "ts_end" => "Integer", + }, + "v2.UpdateTagRule" => { + "rule_id" => "String", + "body" => "TagRuleUpdateRequest", + }, + "v2.GetTagRuleScore" => { + "rule_id" => "String", + "ts_start" => "Integer", + "ts_end" => "Integer", + }, "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, @@ -6372,36 +6402,6 @@ "variable_id" => "String", "body" => "GlobalVariableJsonPatchRequest", }, - "v2.ListTagPolicies" => { - "include_disabled" => "Boolean", - "include_deleted" => "Boolean", - "include" => "TagPolicyInclude", - "filter_source" => "TagPolicySource", - "ts_start" => "Integer", - "ts_end" => "Integer", - }, - "v2.CreateTagPolicy" => { - "body" => "TagPolicyCreateRequest", - }, - "v2.DeleteTagPolicy" => { - "policy_id" => "String", - "hard_delete" => "Boolean", - }, - "v2.GetTagPolicy" => { - "policy_id" => "String", - "include" => "TagPolicyInclude", - "ts_start" => "Integer", - "ts_end" => "Integer", - }, - "v2.UpdateTagPolicy" => { - "policy_id" => "String", - "body" => "TagPolicyUpdateRequest", - }, - "v2.GetTagPolicyScore" => { - "policy_id" => "String", - "ts_start" => "Integer", - "ts_end" => "Integer", - }, "v2.ListTeams" => { "page_number" => "Integer", "page_size" => "Integer", diff --git a/features/v2/tag_policies.feature b/features/v2/tag_policies.feature deleted file mode 100644 index b5d064c202e7..000000000000 --- a/features/v2/tag_policies.feature +++ /dev/null @@ -1,150 +0,0 @@ -@endpoint(tag-policies) @endpoint(tag-policies-v2) -Feature: Tag Policies - 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. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "TagPolicies" 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 200 OK diff --git a/features/v2/tag_rules.feature b/features/v2/tag_rules.feature new file mode 100644 index 000000000000..ad456e68c011 --- /dev/null +++ b/features/v2/tag_rules.feature @@ -0,0 +1,150 @@ +@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). 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 "TagRules" API + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Create a tag rule returns "Bad Request" response + Given operation "CreateTagRule" enabled + And new "CreateTagRule" request + And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Create a tag rule returns "Conflict" response + Given operation "CreateTagRule" enabled + And new "CreateTagRule" request + And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_rule"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Create a tag rule returns "Created" response + Given operation "CreateTagRule" enabled + And new "CreateTagRule" request + And body with value {"data": {"attributes": {"enabled": true, "name": "Service tag must be one of api or web", "negated": false, "required": true, "rule_type": "surfacing", "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_rule"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Delete a tag rule returns "Bad Request" response + Given operation "DeleteTagRule" enabled + And new "DeleteTagRule" request + And request contains "rule_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 rule returns "No Content" response + Given operation "DeleteTagRule" enabled + And new "DeleteTagRule" request + And request contains "rule_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 rule returns "Not Found" response + Given operation "DeleteTagRule" enabled + And new "DeleteTagRule" request + And request contains "rule_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 rule compliance score returns "Bad Request" response + Given operation "GetTagRuleScore" enabled + And new "GetTagRuleScore" request + And request contains "rule_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 rule compliance score returns "Not Found" response + Given operation "GetTagRuleScore" enabled + And new "GetTagRuleScore" request + And request contains "rule_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 rule compliance score returns "OK" response + Given operation "GetTagRuleScore" enabled + And new "GetTagRuleScore" request + And request contains "rule_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 rule returns "Bad Request" response + Given operation "GetTagRule" enabled + And new "GetTagRule" request + And request contains "rule_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 rule returns "Not Found" response + Given operation "GetTagRule" enabled + And new "GetTagRule" request + And request contains "rule_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 rule returns "OK" response + Given operation "GetTagRule" enabled + And new "GetTagRule" request + And request contains "rule_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 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 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 rule returns "Bad Request" response + Given operation "UpdateTagRule" enabled + And new "UpdateTagRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a tag rule returns "Not Found" response + Given operation "UpdateTagRule" enabled + And new "UpdateTagRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_rule"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a tag rule returns "OK" response + Given operation "UpdateTagRule" enabled + And new "UpdateTagRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rule_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_rule"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index a2c87199354d..16e0df0b3870 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2967,6 +2967,49 @@ "type": "idempotent" } }, + "ListTagRules": { + "tag": "Tag Rules", + "undo": { + "type": "safe" + } + }, + "CreateTagRule": { + "tag": "Tag Rules", + "undo": { + "operationId": "DeleteTagRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteTagRule": { + "tag": "Tag Rules", + "undo": { + "type": "idempotent" + } + }, + "GetTagRule": { + "tag": "Tag Rules", + "undo": { + "type": "safe" + } + }, + "UpdateTagRule": { + "tag": "Tag Rules", + "undo": { + "type": "idempotent" + } + }, + "GetTagRuleScore": { + "tag": "Tag Rules", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": { @@ -9758,49 +9801,6 @@ "type": "safe" } }, - "ListTagPolicies": { - "tag": "Tag Policies", - "undo": { - "type": "safe" - } - }, - "CreateTagPolicy": { - "tag": "Tag Policies", - "undo": { - "operationId": "DeleteTagPolicy", - "parameters": [ - { - "name": "policy_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, - "DeleteTagPolicy": { - "tag": "Tag Policies", - "undo": { - "type": "idempotent" - } - }, - "GetTagPolicy": { - "tag": "Tag Policies", - "undo": { - "type": "safe" - } - }, - "UpdateTagPolicy": { - "tag": "Tag Policies", - "undo": { - "type": "idempotent" - } - }, - "GetTagPolicyScore": { - "tag": "Tag Policies", - "undo": { - "type": "safe" - } - }, "ListTagPipelinesRulesets": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 082d0c5da3d5..bc8d4bb1fd96 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -469,6 +469,12 @@ def initialize "v2.update_governance_control_notification_settings": false, "v2.update_governance_detection": false, "v2.update_governance_notification_settings": 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.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, "v2.delete_entity_integration_config": false, @@ -765,12 +771,6 @@ def initialize "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.add_member_team": false, "v2.list_member_teams": false, "v2.remove_member_team": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 572988340d0f..ee23e2cd6ba1 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -8144,28 +8144,28 @@ def overrides "v2.tag_indexing_rule_update_attributes" => "TagIndexingRuleUpdateAttributes", "v2.tag_indexing_rule_update_data" => "TagIndexingRuleUpdateData", "v2.tag_indexing_rule_update_request" => "TagIndexingRuleUpdateRequest", - "v2.tag_policies_list_response" => "TagPoliciesListResponse", - "v2.tag_policy_attributes" => "TagPolicyAttributes", - "v2.tag_policy_create_attributes" => "TagPolicyCreateAttributes", - "v2.tag_policy_create_data" => "TagPolicyCreateData", - "v2.tag_policy_create_request" => "TagPolicyCreateRequest", - "v2.tag_policy_create_type" => "TagPolicyCreateType", - "v2.tag_policy_data" => "TagPolicyData", - "v2.tag_policy_include" => "TagPolicyInclude", - "v2.tag_policy_relationships" => "TagPolicyRelationships", - "v2.tag_policy_resource_type" => "TagPolicyResourceType", - "v2.tag_policy_response" => "TagPolicyResponse", - "v2.tag_policy_score_attributes" => "TagPolicyScoreAttributes", - "v2.tag_policy_score_data" => "TagPolicyScoreData", - "v2.tag_policy_score_relationship" => "TagPolicyScoreRelationship", - "v2.tag_policy_score_relationship_data" => "TagPolicyScoreRelationshipData", - "v2.tag_policy_score_resource_type" => "TagPolicyScoreResourceType", - "v2.tag_policy_score_response" => "TagPolicyScoreResponse", - "v2.tag_policy_source" => "TagPolicySource", - "v2.tag_policy_type" => "TagPolicyType", - "v2.tag_policy_update_attributes" => "TagPolicyUpdateAttributes", - "v2.tag_policy_update_data" => "TagPolicyUpdateData", - "v2.tag_policy_update_request" => "TagPolicyUpdateRequest", + "v2.tag_rule_attributes" => "TagRuleAttributes", + "v2.tag_rule_create_attributes" => "TagRuleCreateAttributes", + "v2.tag_rule_create_data" => "TagRuleCreateData", + "v2.tag_rule_create_request" => "TagRuleCreateRequest", + "v2.tag_rule_create_type" => "TagRuleCreateType", + "v2.tag_rule_data" => "TagRuleData", + "v2.tag_rule_include" => "TagRuleInclude", + "v2.tag_rule_relationships" => "TagRuleRelationships", + "v2.tag_rule_resource_type" => "TagRuleResourceType", + "v2.tag_rule_response" => "TagRuleResponse", + "v2.tag_rule_score_attributes" => "TagRuleScoreAttributes", + "v2.tag_rule_score_data" => "TagRuleScoreData", + "v2.tag_rule_score_relationship" => "TagRuleScoreRelationship", + "v2.tag_rule_score_relationship_data" => "TagRuleScoreRelationshipData", + "v2.tag_rule_score_resource_type" => "TagRuleScoreResourceType", + "v2.tag_rule_score_response" => "TagRuleScoreResponse", + "v2.tag_rules_list_response" => "TagRulesListResponse", + "v2.tag_rule_source" => "TagRuleSource", + "v2.tag_rule_type" => "TagRuleType", + "v2.tag_rule_update_attributes" => "TagRuleUpdateAttributes", + "v2.tag_rule_update_data" => "TagRuleUpdateData", + "v2.tag_rule_update_request" => "TagRuleUpdateRequest", "v2.targeting_rule" => "TargetingRule", "v2.targeting_rule_request" => "TargetingRuleRequest", "v2.team" => "Team", @@ -8966,7 +8966,7 @@ def overrides "v2.stegadography_api" => "StegadographyAPI", "v2.storage_management_api" => "StorageManagementAPI", "v2.synthetics_api" => "SyntheticsAPI", - "v2.tag_policies_api" => "TagPoliciesAPI", + "v2.tag_rules_api" => "TagRulesAPI", "v2.teams_api" => "TeamsAPI", "v2.test_optimization_api" => "TestOptimizationAPI", "v2.twilio_integration_accounts_api" => "TwilioIntegrationAccountsAPI", diff --git a/lib/datadog_api_client/v2/api/tag_policies_api.rb b/lib/datadog_api_client/v2/api/tag_rules_api.rb similarity index 60% rename from lib/datadog_api_client/v2/api/tag_policies_api.rb rename to lib/datadog_api_client/v2/api/tag_rules_api.rb index abf2f946bd42..631f7e882ee2 100644 --- a/lib/datadog_api_client/v2/api/tag_policies_api.rb +++ b/lib/datadog_api_client/v2/api/tag_rules_api.rb @@ -16,47 +16,47 @@ require 'cgi' module DatadogAPIClient::V2 - class TagPoliciesAPI + class TagRulesAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end - # Create a tag policy. + # Create a tag rule. # - # @see #create_tag_policy_with_http_info - def create_tag_policy(body, opts = {}) - data, _status_code, _headers = create_tag_policy_with_http_info(body, opts) + # @see #create_tag_rule_with_http_info + def create_tag_rule(body, opts = {}) + data, _status_code, _headers = create_tag_rule_with_http_info(body, opts) data end - # Create a tag policy. + # 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. + # `rule_id`, `version`, and the timestamp/audit fields are assigned by the server. # - # @param body [TagPolicyCreateRequest] + # @param body [TagRuleCreateRequest] # @param opts [Hash] the optional parameters - # @return [Array<(TagPolicyResponse, Integer, Hash)>] TagPolicyResponse data, response status code and response headers - def create_tag_policy_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_tag_policy".to_sym] + # @return [Array<(TagRuleResponse, Integer, Hash)>] TagRuleResponse data, response status code and response headers + def create_tag_rule_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_tag_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_tag_policy") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_tag_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_tag_policy")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_tag_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagPoliciesAPI.create_tag_policy ...' + @api_client.config.logger.debug 'Calling API: TagRulesAPI.create_tag_rule ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling TagPoliciesAPI.create_tag_policy" + fail ArgumentError, "Missing the required parameter 'body' when calling TagRulesAPI.create_tag_rule" end # resource path - local_var_path = '/api/v2/tag_policies' + local_var_path = '/api/v2/governance/tag_rules' # query parameters query_params = opts[:query_params] || {} @@ -75,13 +75,13 @@ def create_tag_policy_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'TagPolicyResponse' + return_type = opts[:debug_return_type] || 'TagRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_tag_policy, + :operation => :create_tag_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -93,46 +93,46 @@ def create_tag_policy_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagPoliciesAPI#create_tag_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagRulesAPI#create_tag_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete a tag policy. + # Delete a tag rule. # - # @see #delete_tag_policy_with_http_info - def delete_tag_policy(policy_id, opts = {}) - delete_tag_policy_with_http_info(policy_id, opts) + # @see #delete_tag_rule_with_http_info + def delete_tag_rule(rule_id, opts = {}) + delete_tag_rule_with_http_info(rule_id, opts) nil end - # 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 [String] The unique identifier of the tag policy to delete. + # @param rule_id [String] The unique identifier of the tag rule to delete. # @param opts [Hash] the optional parameters - # @option opts [Boolean] :hard_delete Whether to permanently delete the policy instead of performing a soft delete. Defaults to `false`. + # @option opts [Boolean] :hard_delete Whether to permanently delete the rule instead of performing a soft delete. Defaults to `false`. # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_tag_policy_with_http_info(policy_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_tag_policy".to_sym] + def delete_tag_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_tag_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_tag_policy") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_tag_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_tag_policy")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_tag_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagPoliciesAPI.delete_tag_policy ...' + @api_client.config.logger.debug 'Calling API: TagRulesAPI.delete_tag_rule ...' end - # verify the required parameter 'policy_id' is set - if @api_client.config.client_side_validation && policy_id.nil? - fail ArgumentError, "Missing the required parameter 'policy_id' when calling TagPoliciesAPI.delete_tag_policy" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling TagRulesAPI.delete_tag_rule" end # resource path - local_var_path = '/api/v2/tag_policies/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/governance/tag_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -156,7 +156,7 @@ def delete_tag_policy_with_http_info(policy_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :delete_tag_policy, + :operation => :delete_tag_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -168,52 +168,52 @@ def delete_tag_policy_with_http_info(policy_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagPoliciesAPI#delete_tag_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagRulesAPI#delete_tag_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a tag policy. + # Get a tag rule. # - # @see #get_tag_policy_with_http_info - def get_tag_policy(policy_id, opts = {}) - data, _status_code, _headers = get_tag_policy_with_http_info(policy_id, opts) + # @see #get_tag_rule_with_http_info + def get_tag_rule(rule_id, opts = {}) + data, _status_code, _headers = get_tag_rule_with_http_info(rule_id, opts) data end - # Get a tag policy. + # 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 [String] The unique identifier of the tag policy. + # @param rule_id [String] The unique identifier of the tag rule. # @param opts [Hash] the optional parameters - # @option opts [TagPolicyInclude] :include Comma-separated list of related resources to include alongside the policy. Currently the only supported value is `score`. + # @option opts [TagRuleInclude] :include Comma-separated list of related resources to include alongside the rule. Currently the only supported value is `score`. # @option opts [Integer] :ts_start Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. # @option opts [Integer] :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`. - # @return [Array<(TagPolicyResponse, Integer, Hash)>] TagPolicyResponse data, response status code and response headers - def get_tag_policy_with_http_info(policy_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_tag_policy".to_sym] + # @return [Array<(TagRuleResponse, Integer, Hash)>] TagRuleResponse data, response status code and response headers + def get_tag_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_tag_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_tag_policy") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_tag_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_tag_policy")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_tag_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagPoliciesAPI.get_tag_policy ...' + @api_client.config.logger.debug 'Calling API: TagRulesAPI.get_tag_rule ...' end - # verify the required parameter 'policy_id' is set - if @api_client.config.client_side_validation && policy_id.nil? - fail ArgumentError, "Missing the required parameter 'policy_id' when calling TagPoliciesAPI.get_tag_policy" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling TagRulesAPI.get_tag_rule" end allowable_values = ['score'] if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/v2/tag_policies/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/governance/tag_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -233,13 +233,13 @@ def get_tag_policy_with_http_info(policy_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'TagPolicyResponse' + return_type = opts[:debug_return_type] || 'TagRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_tag_policy, + :operation => :get_tag_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -251,48 +251,48 @@ def get_tag_policy_with_http_info(policy_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagPoliciesAPI#get_tag_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagRulesAPI#get_tag_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a tag policy compliance score. + # Get a tag rule compliance score. # - # @see #get_tag_policy_score_with_http_info - def get_tag_policy_score(policy_id, opts = {}) - data, _status_code, _headers = get_tag_policy_score_with_http_info(policy_id, opts) + # @see #get_tag_rule_score_with_http_info + def get_tag_rule_score(rule_id, opts = {}) + data, _status_code, _headers = get_tag_rule_score_with_http_info(rule_id, opts) data end - # Get a tag policy compliance score. + # 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 [String] The unique identifier of the tag policy. + # @param rule_id [String] The unique identifier of the tag rule. # @param opts [Hash] the optional parameters # @option opts [Integer] :ts_start Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. # @option opts [Integer] :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`. - # @return [Array<(TagPolicyScoreResponse, Integer, Hash)>] TagPolicyScoreResponse data, response status code and response headers - def get_tag_policy_score_with_http_info(policy_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_tag_policy_score".to_sym] + # @return [Array<(TagRuleScoreResponse, Integer, Hash)>] TagRuleScoreResponse data, response status code and response headers + def get_tag_rule_score_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_tag_rule_score".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_tag_policy_score") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_tag_rule_score") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_tag_policy_score")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_tag_rule_score")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagPoliciesAPI.get_tag_policy_score ...' + @api_client.config.logger.debug 'Calling API: TagRulesAPI.get_tag_rule_score ...' end - # verify the required parameter 'policy_id' is set - if @api_client.config.client_side_validation && policy_id.nil? - fail ArgumentError, "Missing the required parameter 'policy_id' when calling TagPoliciesAPI.get_tag_policy_score" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling TagRulesAPI.get_tag_rule_score" end # resource path - local_var_path = '/api/v2/tag_policies/{policy_id}/score'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/governance/tag_rules/{rule_id}/score'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -311,13 +311,13 @@ def get_tag_policy_score_with_http_info(policy_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'TagPolicyScoreResponse' + return_type = opts[:debug_return_type] || 'TagRuleScoreResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_tag_policy_score, + :operation => :get_tag_rule_score, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -329,43 +329,43 @@ def get_tag_policy_score_with_http_info(policy_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagPoliciesAPI#get_tag_policy_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagRulesAPI#get_tag_rule_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List tag policies. + # List tag rules. # - # @see #list_tag_policies_with_http_info - def list_tag_policies(opts = {}) - data, _status_code, _headers = list_tag_policies_with_http_info(opts) + # @see #list_tag_rules_with_http_info + def list_tag_rules(opts = {}) + data, _status_code, _headers = list_tag_rules_with_http_info(opts) data end - # List tag policies. + # 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 opts [Hash] the optional parameters - # @option opts [Boolean] :include_disabled Whether to include policies that are currently disabled. Defaults to `false`. - # @option opts [Boolean] :include_deleted Whether to include policies that have been soft-deleted. Defaults to `false`. - # @option opts [TagPolicyInclude] :include Comma-separated list of related resources to include alongside each policy in the response. Currently the only supported value is `score`. - # @option opts [TagPolicySource] :filter_source Restrict the result set to policies whose source matches the given value. + # @option opts [Boolean] :include_disabled Whether to include rules that are currently disabled. Defaults to `false`. + # @option opts [Boolean] :include_deleted Whether to include rules that have been soft-deleted. Defaults to `false`. + # @option opts [TagRuleInclude] :include Comma-separated list of related resources to include alongside each rule in the response. Currently the only supported value is `score`. + # @option opts [TagRuleSource] :filter_source Restrict the result set to rules whose source matches the given value. # @option opts [Integer] :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. # @option opts [Integer] :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`. - # @return [Array<(TagPoliciesListResponse, Integer, Hash)>] TagPoliciesListResponse data, response status code and response headers - def list_tag_policies_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_tag_policies".to_sym] + # @return [Array<(TagRulesListResponse, Integer, Hash)>] TagRulesListResponse data, response status code and response headers + def list_tag_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_tag_rules".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_tag_policies") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_tag_rules") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_tag_policies")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_tag_rules")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagPoliciesAPI.list_tag_policies ...' + @api_client.config.logger.debug 'Calling API: TagRulesAPI.list_tag_rules ...' end allowable_values = ['score'] if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) @@ -376,7 +376,7 @@ def list_tag_policies_with_http_info(opts = {}) fail ArgumentError, "invalid value for \"filter_source\", must be one of #{allowable_values}" end # resource path - local_var_path = '/api/v2/tag_policies' + local_var_path = '/api/v2/governance/tag_rules' # query parameters query_params = opts[:query_params] || {} @@ -399,13 +399,13 @@ def list_tag_policies_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'TagPoliciesListResponse' + return_type = opts[:debug_return_type] || 'TagRulesListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_tag_policies, + :operation => :list_tag_rules, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -417,50 +417,50 @@ def list_tag_policies_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagPoliciesAPI#list_tag_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagRulesAPI#list_tag_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update a tag policy. + # Update a tag rule. # - # @see #update_tag_policy_with_http_info - def update_tag_policy(policy_id, body, opts = {}) - data, _status_code, _headers = update_tag_policy_with_http_info(policy_id, body, opts) + # @see #update_tag_rule_with_http_info + def update_tag_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_tag_rule_with_http_info(rule_id, body, opts) data end - # Update a tag policy. + # 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 [String] The unique identifier of the tag policy to update. - # @param body [TagPolicyUpdateRequest] + # @param rule_id [String] The unique identifier of the tag rule to update. + # @param body [TagRuleUpdateRequest] # @param opts [Hash] the optional parameters - # @return [Array<(TagPolicyResponse, Integer, Hash)>] TagPolicyResponse data, response status code and response headers - def update_tag_policy_with_http_info(policy_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_tag_policy".to_sym] + # @return [Array<(TagRuleResponse, Integer, Hash)>] TagRuleResponse data, response status code and response headers + def update_tag_rule_with_http_info(rule_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_tag_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_tag_policy") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_tag_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_tag_policy")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_tag_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: TagPoliciesAPI.update_tag_policy ...' + @api_client.config.logger.debug 'Calling API: TagRulesAPI.update_tag_rule ...' end - # verify the required parameter 'policy_id' is set - if @api_client.config.client_side_validation && policy_id.nil? - fail ArgumentError, "Missing the required parameter 'policy_id' when calling TagPoliciesAPI.update_tag_policy" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling TagRulesAPI.update_tag_rule" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling TagPoliciesAPI.update_tag_policy" + fail ArgumentError, "Missing the required parameter 'body' when calling TagRulesAPI.update_tag_rule" end # resource path - local_var_path = '/api/v2/tag_policies/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/governance/tag_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -479,13 +479,13 @@ def update_tag_policy_with_http_info(policy_id, body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'TagPolicyResponse' + return_type = opts[:debug_return_type] || 'TagRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :update_tag_policy, + :operation => :update_tag_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -497,7 +497,7 @@ def update_tag_policy_with_http_info(policy_id, body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: TagPoliciesAPI#update_tag_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: TagRulesAPI#update_tag_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end diff --git a/lib/datadog_api_client/v2/models/tag_policy_attributes.rb b/lib/datadog_api_client/v2/models/tag_rule_attributes.rb similarity index 82% rename from lib/datadog_api_client/v2/models/tag_policy_attributes.rb rename to lib/datadog_api_client/v2/models/tag_rule_attributes.rb index 1874b5e5887f..395acf35d933 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_attributes.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_attributes.rb @@ -17,51 +17,51 @@ require 'time' module DatadogAPIClient::V2 - # The attributes of a tag policy resource. - class TagPolicyAttributes + # The attributes of a tag rule resource. + class TagRuleAttributes include BaseGenericModel - # The RFC 3339 timestamp at which the policy was created. + # The RFC 3339 timestamp at which the rule was created. attr_reader :created_at - # The identifier of the user who created the policy. + # The identifier of the user who created the rule. attr_reader :created_by - # 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. + # 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. attr_accessor :deleted_at - # The identifier of the user who soft-deleted the policy. `null` if the policy has not been deleted. + # The identifier of the user who soft-deleted the rule. `null` if the rule has not been deleted. attr_accessor :deleted_by - # Whether the policy is currently enforced. + # Whether the rule is currently enforced. attr_reader :enabled - # The RFC 3339 timestamp at which the policy was last modified. + # The RFC 3339 timestamp at which the rule was last modified. attr_reader :modified_at - # The identifier of the user who last modified the policy. + # The identifier of the user who last modified the rule. attr_reader :modified_by - # When `true`, the policy matches tag values that do NOT match any of the supplied patterns. - attr_reader :negated - - # Human-readable name for the tag policy. - attr_reader :policy_name + # Human-readable name for the tag rule. + attr_reader :name - # How the policy is enforced. `blocking` rejects telemetry that violates the policy. - # `surfacing` only highlights non-compliant telemetry without blocking it. - attr_reader :policy_type + # When `true`, the rule matches tag values that do NOT match any of the supplied patterns. + attr_reader :negated # When `true`, telemetry without this tag is treated as a violation. attr_reader :required - # The scope the policy applies within. + # How the rule is enforced. `blocking` rejects telemetry that violates the rule. + # `surfacing` only highlights non-compliant telemetry without blocking it. + attr_reader :rule_type + + # The scope the rule applies within. attr_reader :scope - # The telemetry source that a tag policy applies to. + # The telemetry source that a tag rule applies to. attr_reader :source - # The tag key that the policy governs. + # The tag key that the rule governs. attr_reader :tag_key # The patterns that valid values for the tag key must match. @@ -83,10 +83,10 @@ def self.attribute_map :'enabled' => :'enabled', :'modified_at' => :'modified_at', :'modified_by' => :'modified_by', + :'name' => :'name', :'negated' => :'negated', - :'policy_name' => :'policy_name', - :'policy_type' => :'policy_type', :'required' => :'required', + :'rule_type' => :'rule_type', :'scope' => :'scope', :'source' => :'source', :'tag_key' => :'tag_key', @@ -106,12 +106,12 @@ def self.openapi_types :'enabled' => :'Boolean', :'modified_at' => :'Time', :'modified_by' => :'String', + :'name' => :'String', :'negated' => :'Boolean', - :'policy_name' => :'String', - :'policy_type' => :'TagPolicyType', :'required' => :'Boolean', + :'rule_type' => :'TagRuleType', :'scope' => :'String', - :'source' => :'TagPolicySource', + :'source' => :'TagRuleSource', :'tag_key' => :'String', :'tag_value_patterns' => :'Array', :'version' => :'Integer' @@ -132,7 +132,7 @@ def self.openapi_nullable # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleAttributes` initialize method" end self.additional_properties = {} @@ -173,22 +173,22 @@ def initialize(attributes = {}) self.modified_by = attributes[:'modified_by'] end - if attributes.key?(:'negated') - self.negated = attributes[:'negated'] + if attributes.key?(:'name') + self.name = attributes[:'name'] end - if attributes.key?(:'policy_name') - self.policy_name = attributes[:'policy_name'] - end - - if attributes.key?(:'policy_type') - self.policy_type = attributes[:'policy_type'] + if attributes.key?(:'negated') + self.negated = attributes[:'negated'] end if attributes.key?(:'required') self.required = attributes[:'required'] end + if attributes.key?(:'rule_type') + self.rule_type = attributes[:'rule_type'] + end + if attributes.key?(:'scope') self.scope = attributes[:'scope'] end @@ -221,10 +221,10 @@ def valid? return false if @enabled.nil? return false if @modified_at.nil? return false if @modified_by.nil? + return false if @name.nil? return false if @negated.nil? - return false if @policy_name.nil? - return false if @policy_type.nil? return false if @required.nil? + return false if @rule_type.nil? return false if @scope.nil? return false if @source.nil? return false if @tag_key.nil? @@ -284,33 +284,23 @@ def modified_by=(modified_by) end # Custom attribute writer method with validation - # @param negated [Object] Object to be assigned - # @!visibility private - def negated=(negated) - if negated.nil? - fail ArgumentError, 'invalid value for "negated", negated cannot be nil.' - end - @negated = negated - end - - # Custom attribute writer method with validation - # @param policy_name [Object] Object to be assigned + # @param name [Object] Object to be assigned # @!visibility private - def policy_name=(policy_name) - if policy_name.nil? - fail ArgumentError, 'invalid value for "policy_name", policy_name cannot be nil.' + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' end - @policy_name = policy_name + @name = name end # Custom attribute writer method with validation - # @param policy_type [Object] Object to be assigned + # @param negated [Object] Object to be assigned # @!visibility private - def policy_type=(policy_type) - if policy_type.nil? - fail ArgumentError, 'invalid value for "policy_type", policy_type cannot be nil.' + def negated=(negated) + if negated.nil? + fail ArgumentError, 'invalid value for "negated", negated cannot be nil.' end - @policy_type = policy_type + @negated = negated end # Custom attribute writer method with validation @@ -323,6 +313,16 @@ def required=(required) @required = required end + # Custom attribute writer method with validation + # @param rule_type [Object] Object to be assigned + # @!visibility private + def rule_type=(rule_type) + if rule_type.nil? + fail ArgumentError, 'invalid value for "rule_type", rule_type cannot be nil.' + end + @rule_type = rule_type + end + # Custom attribute writer method with validation # @param scope [Object] Object to be assigned # @!visibility private @@ -406,10 +406,10 @@ def ==(o) enabled == o.enabled && modified_at == o.modified_at && modified_by == o.modified_by && + name == o.name && negated == o.negated && - policy_name == o.policy_name && - policy_type == o.policy_type && required == o.required && + rule_type == o.rule_type && scope == o.scope && source == o.source && tag_key == o.tag_key && @@ -422,7 +422,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, created_by, deleted_at, deleted_by, enabled, modified_at, modified_by, negated, policy_name, policy_type, required, scope, source, tag_key, tag_value_patterns, version, additional_properties].hash + [created_at, created_by, deleted_at, deleted_by, enabled, modified_at, modified_by, name, negated, required, rule_type, scope, source, tag_key, tag_value_patterns, version, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/tag_policy_create_attributes.rb b/lib/datadog_api_client/v2/models/tag_rule_create_attributes.rb similarity index 76% rename from lib/datadog_api_client/v2/models/tag_policy_create_attributes.rb rename to lib/datadog_api_client/v2/models/tag_rule_create_attributes.rb index 14b0469ee048..a8c58f228635 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_create_attributes.rb @@ -17,34 +17,34 @@ require 'time' module DatadogAPIClient::V2 - # Attributes that can be supplied when creating a tag policy. - class TagPolicyCreateAttributes + # Attributes that can be supplied when creating a tag rule. + class TagRuleCreateAttributes include BaseGenericModel - # Whether the policy is currently enforced. Defaults to `true` for newly created policies. + # Whether the rule is currently enforced. Defaults to `true` for newly created rules. attr_accessor :enabled - # When `true`, the policy matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. - attr_accessor :negated - - # Human-readable name for the tag policy. - attr_reader :policy_name + # Human-readable name for the tag rule. + attr_reader :name - # The policy type allowed when creating a tag policy. Only `surfacing` is accepted at - # creation time. - attr_reader :policy_type + # When `true`, the rule matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. + attr_accessor :negated # When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. attr_accessor :required - # The scope the policy applies within. Typically an environment, team, or - # organization-level identifier used to limit where the policy is enforced. + # The rule type allowed when creating a tag rule. Only `surfacing` is accepted at + # creation time. + attr_reader :rule_type + + # The scope the rule applies within. Typically an environment, team, or + # organization-level identifier used to limit where the rule is enforced. attr_reader :scope - # The telemetry source that a tag policy applies to. + # The telemetry source that a tag rule applies to. attr_reader :source - # The tag key that the policy governs (for example, `service`). + # The tag key that the rule governs (for example, `service`). attr_reader :tag_key # One or more patterns that valid values for the tag key must match. At least one @@ -58,10 +58,10 @@ class TagPolicyCreateAttributes def self.attribute_map { :'enabled' => :'enabled', + :'name' => :'name', :'negated' => :'negated', - :'policy_name' => :'policy_name', - :'policy_type' => :'policy_type', :'required' => :'required', + :'rule_type' => :'rule_type', :'scope' => :'scope', :'source' => :'source', :'tag_key' => :'tag_key', @@ -74,12 +74,12 @@ def self.attribute_map def self.openapi_types { :'enabled' => :'Boolean', + :'name' => :'String', :'negated' => :'Boolean', - :'policy_name' => :'String', - :'policy_type' => :'TagPolicyCreateType', :'required' => :'Boolean', + :'rule_type' => :'TagRuleCreateType', :'scope' => :'String', - :'source' => :'TagPolicySource', + :'source' => :'TagRuleSource', :'tag_key' => :'String', :'tag_value_patterns' => :'Array' } @@ -90,7 +90,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyCreateAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleCreateAttributes` initialize method" end self.additional_properties = {} @@ -107,22 +107,22 @@ def initialize(attributes = {}) self.enabled = attributes[:'enabled'] end - if attributes.key?(:'negated') - self.negated = attributes[:'negated'] - end - - if attributes.key?(:'policy_name') - self.policy_name = attributes[:'policy_name'] + if attributes.key?(:'name') + self.name = attributes[:'name'] end - if attributes.key?(:'policy_type') - self.policy_type = attributes[:'policy_type'] + if attributes.key?(:'negated') + self.negated = attributes[:'negated'] end if attributes.key?(:'required') self.required = attributes[:'required'] end + if attributes.key?(:'rule_type') + self.rule_type = attributes[:'rule_type'] + end + if attributes.key?(:'scope') self.scope = attributes[:'scope'] end @@ -146,8 +146,8 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @policy_name.nil? - return false if @policy_type.nil? + return false if @name.nil? + return false if @rule_type.nil? return false if @scope.nil? return false if @source.nil? return false if @tag_key.nil? @@ -157,23 +157,23 @@ def valid? end # Custom attribute writer method with validation - # @param policy_name [Object] Object to be assigned + # @param name [Object] Object to be assigned # @!visibility private - def policy_name=(policy_name) - if policy_name.nil? - fail ArgumentError, 'invalid value for "policy_name", policy_name cannot be nil.' + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' end - @policy_name = policy_name + @name = name end # Custom attribute writer method with validation - # @param policy_type [Object] Object to be assigned + # @param rule_type [Object] Object to be assigned # @!visibility private - def policy_type=(policy_type) - if policy_type.nil? - fail ArgumentError, 'invalid value for "policy_type", policy_type cannot be nil.' + def rule_type=(rule_type) + if rule_type.nil? + fail ArgumentError, 'invalid value for "rule_type", rule_type cannot be nil.' end - @policy_type = policy_type + @rule_type = rule_type end # Custom attribute writer method with validation @@ -246,10 +246,10 @@ def ==(o) return true if self.equal?(o) self.class == o.class && enabled == o.enabled && + name == o.name && negated == o.negated && - policy_name == o.policy_name && - policy_type == o.policy_type && required == o.required && + rule_type == o.rule_type && scope == o.scope && source == o.source && tag_key == o.tag_key && @@ -261,7 +261,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [enabled, negated, policy_name, policy_type, required, scope, source, tag_key, tag_value_patterns, additional_properties].hash + [enabled, name, negated, required, rule_type, scope, source, tag_key, tag_value_patterns, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/tag_policy_create_data.rb b/lib/datadog_api_client/v2/models/tag_rule_create_data.rb similarity index 91% rename from lib/datadog_api_client/v2/models/tag_policy_create_data.rb rename to lib/datadog_api_client/v2/models/tag_rule_create_data.rb index 4b78db9c5eb3..9497c887d188 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_create_data.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_create_data.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Data object for creating a tag policy. - class TagPolicyCreateData + # Data object for creating a tag rule. + class TagRuleCreateData include BaseGenericModel - # Attributes that can be supplied when creating a tag policy. + # Attributes that can be supplied when creating a tag rule. attr_reader :attributes - # JSON:API resource type for a tag policy. + # JSON:API resource type for a tag rule. attr_reader :type attr_accessor :additional_properties @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'TagPolicyCreateAttributes', - :'type' => :'TagPolicyResourceType' + :'attributes' => :'TagRuleCreateAttributes', + :'type' => :'TagRuleResourceType' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyCreateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleCreateData` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_score_response.rb b/lib/datadog_api_client/v2/models/tag_rule_create_request.rb similarity index 93% rename from lib/datadog_api_client/v2/models/tag_policy_score_response.rb rename to lib/datadog_api_client/v2/models/tag_rule_create_request.rb index 20be7e49217f..8049738200fa 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_score_response.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_create_request.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # A tag policy compliance score. - class TagPolicyScoreResponse + # Payload for creating a new tag rule. + class TagRuleCreateRequest include BaseGenericModel - # A compliance score resource for a tag policy. + # Data object for creating a tag rule. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'TagPolicyScoreData' + :'data' => :'TagRuleCreateData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyScoreResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleCreateRequest` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_create_type.rb b/lib/datadog_api_client/v2/models/tag_rule_create_type.rb similarity index 84% rename from lib/datadog_api_client/v2/models/tag_policy_create_type.rb rename to lib/datadog_api_client/v2/models/tag_rule_create_type.rb index 025a70e6afbc..f183a1d98ad8 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_create_type.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_create_type.rb @@ -17,9 +17,9 @@ require 'time' module DatadogAPIClient::V2 - # 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. - class TagPolicyCreateType + class TagRuleCreateType include BaseEnumModel SURFACING = "surfacing".freeze diff --git a/lib/datadog_api_client/v2/models/tag_policy_data.rb b/lib/datadog_api_client/v2/models/tag_rule_data.rb similarity index 89% rename from lib/datadog_api_client/v2/models/tag_policy_data.rb rename to lib/datadog_api_client/v2/models/tag_rule_data.rb index 89cfa1ff2726..bc0c724288d2 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_data.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_data.rb @@ -17,20 +17,20 @@ require 'time' module DatadogAPIClient::V2 - # A tag policy resource. - class TagPolicyData + # A tag rule resource. + class TagRuleData include BaseGenericModel - # The attributes of a tag policy resource. + # The attributes of a tag rule resource. attr_reader :attributes - # The unique identifier of the tag policy. + # The unique identifier of the tag rule. attr_reader :id - # 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. attr_accessor :relationships - # JSON:API resource type for a tag policy. + # JSON:API resource type for a tag rule. attr_reader :type attr_accessor :additional_properties @@ -50,10 +50,10 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'TagPolicyAttributes', + :'attributes' => :'TagRuleAttributes', :'id' => :'String', - :'relationships' => :'TagPolicyRelationships', - :'type' => :'TagPolicyResourceType' + :'relationships' => :'TagRuleRelationships', + :'type' => :'TagRuleResourceType' } end @@ -62,7 +62,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleData` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_include.rb b/lib/datadog_api_client/v2/models/tag_rule_include.rb similarity index 80% rename from lib/datadog_api_client/v2/models/tag_policy_include.rb rename to lib/datadog_api_client/v2/models/tag_rule_include.rb index a05c72e0fd13..7e6eae7b11b9 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_include.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_include.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # A related resource to include alongside a tag policy in the response. Currently the only supported value is `score`. - class TagPolicyInclude + # A related resource to include alongside a tag rule in the response. Currently the only supported value is `score`. + class TagRuleInclude include BaseEnumModel SCORE = "score".freeze diff --git a/lib/datadog_api_client/v2/models/tag_policy_relationships.rb b/lib/datadog_api_client/v2/models/tag_rule_relationships.rb similarity index 88% rename from lib/datadog_api_client/v2/models/tag_policy_relationships.rb rename to lib/datadog_api_client/v2/models/tag_rule_relationships.rb index f98680089ab4..20afab5b83e7 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_relationships.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_relationships.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Related resources for a tag policy. Only present when the corresponding `include` query parameter is supplied. - class TagPolicyRelationships + # Related resources for a tag rule. Only present when the corresponding `include` query parameter is supplied. + class TagRuleRelationships include BaseGenericModel - # A relationship to the compliance score resource for this policy. + # A relationship to the compliance score resource for this rule. attr_accessor :score attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'score' => :'TagPolicyScoreRelationship' + :'score' => :'TagRuleScoreRelationship' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyRelationships` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleRelationships` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_resource_type.rb b/lib/datadog_api_client/v2/models/tag_rule_resource_type.rb similarity index 83% rename from lib/datadog_api_client/v2/models/tag_policy_resource_type.rb rename to lib/datadog_api_client/v2/models/tag_rule_resource_type.rb index a14c461fc774..ca2b7c066c6d 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_resource_type.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_resource_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # JSON:API resource type for a tag policy. - class TagPolicyResourceType + # JSON:API resource type for a tag rule. + class TagRuleResourceType include BaseEnumModel - TAG_POLICY = "tag_policy".freeze + TAG_RULE = "tag_rule".freeze end end diff --git a/lib/datadog_api_client/v2/models/tag_policy_response.rb b/lib/datadog_api_client/v2/models/tag_rule_response.rb similarity index 90% rename from lib/datadog_api_client/v2/models/tag_policy_response.rb rename to lib/datadog_api_client/v2/models/tag_rule_response.rb index dfcc3e7593aa..4360b7373c92 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_response.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_response.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # A single tag policy. - class TagPolicyResponse + # A single tag rule. + class TagRuleResponse include BaseGenericModel - # A tag policy resource. + # A tag rule resource. attr_reader :data - # Related resources fetched alongside the primary tag policies. Populated when an `include` query parameter is supplied. + # Related resources fetched alongside the primary tag rules. Populated when an `include` query parameter is supplied. attr_accessor :included attr_accessor :additional_properties @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'TagPolicyData', - :'included' => :'Array' + :'data' => :'TagRuleData', + :'included' => :'Array' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleResponse` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_score_attributes.rb b/lib/datadog_api_client/v2/models/tag_rule_score_attributes.rb similarity index 93% rename from lib/datadog_api_client/v2/models/tag_policy_score_attributes.rb rename to lib/datadog_api_client/v2/models/tag_rule_score_attributes.rb index 34c02aaa2ad6..c87e3df63b9d 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_score_attributes.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_score_attributes.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of a tag policy compliance score. - class TagPolicyScoreAttributes + # Attributes of a tag rule compliance score. + class TagRuleScoreAttributes include BaseGenericModel - # 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. attr_accessor :score @@ -31,7 +31,7 @@ class TagPolicyScoreAttributes # Start of the time window the score was computed over, as a Unix timestamp in milliseconds. attr_reader :ts_start - # The version of the tag policy that the score was computed against. + # The version of the tag rule that the score was computed against. attr_reader :version attr_accessor :additional_properties @@ -71,7 +71,7 @@ def self.openapi_nullable # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyScoreAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleScoreAttributes` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_score_data.rb b/lib/datadog_api_client/v2/models/tag_rule_score_data.rb similarity index 92% rename from lib/datadog_api_client/v2/models/tag_policy_score_data.rb rename to lib/datadog_api_client/v2/models/tag_rule_score_data.rb index ba9765bcbb59..dd2536c14e9b 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_score_data.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_score_data.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # A compliance score resource for a tag policy. - class TagPolicyScoreData + # A compliance score resource for a tag rule. + class TagRuleScoreData include BaseGenericModel - # Attributes of a tag policy compliance score. + # Attributes of a tag rule compliance score. attr_reader :attributes # The unique identifier of the compliance score resource. attr_reader :id - # JSON:API resource type for a tag policy compliance score. + # JSON:API resource type for a tag rule compliance score. attr_reader :type attr_accessor :additional_properties @@ -46,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'TagPolicyScoreAttributes', + :'attributes' => :'TagRuleScoreAttributes', :'id' => :'String', - :'type' => :'TagPolicyScoreResourceType' + :'type' => :'TagRuleScoreResourceType' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyScoreData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleScoreData` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_score_relationship.rb b/lib/datadog_api_client/v2/models/tag_rule_score_relationship.rb similarity index 93% rename from lib/datadog_api_client/v2/models/tag_policy_score_relationship.rb rename to lib/datadog_api_client/v2/models/tag_rule_score_relationship.rb index a0f0153eb7d5..e15ed9510ab4 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_score_relationship.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_score_relationship.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # A relationship to the compliance score resource for this policy. - class TagPolicyScoreRelationship + # A relationship to the compliance score resource for this rule. + class TagRuleScoreRelationship include BaseGenericModel # Identifier of the related compliance score resource. @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'TagPolicyScoreRelationshipData' + :'data' => :'TagRuleScoreRelationshipData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyScoreRelationship` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleScoreRelationship` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_score_relationship_data.rb b/lib/datadog_api_client/v2/models/tag_rule_score_relationship_data.rb similarity index 94% rename from lib/datadog_api_client/v2/models/tag_policy_score_relationship_data.rb rename to lib/datadog_api_client/v2/models/tag_rule_score_relationship_data.rb index d1ce4536c666..14a55ddbb7fc 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_score_relationship_data.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_score_relationship_data.rb @@ -18,13 +18,13 @@ module DatadogAPIClient::V2 # Identifier of the related compliance score resource. - class TagPolicyScoreRelationshipData + class TagRuleScoreRelationshipData include BaseGenericModel # The unique identifier of the related compliance score resource. attr_reader :id - # JSON:API resource type for a tag policy compliance score. + # JSON:API resource type for a tag rule compliance score. attr_reader :type attr_accessor :additional_properties @@ -43,7 +43,7 @@ def self.attribute_map def self.openapi_types { :'id' => :'String', - :'type' => :'TagPolicyScoreResourceType' + :'type' => :'TagRuleScoreResourceType' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyScoreRelationshipData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleScoreRelationshipData` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_score_resource_type.rb b/lib/datadog_api_client/v2/models/tag_rule_score_resource_type.rb similarity index 79% rename from lib/datadog_api_client/v2/models/tag_policy_score_resource_type.rb rename to lib/datadog_api_client/v2/models/tag_rule_score_resource_type.rb index 4185e47b90af..a99833a1b40d 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_score_resource_type.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_score_resource_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # JSON:API resource type for a tag policy compliance score. - class TagPolicyScoreResourceType + # JSON:API resource type for a tag rule compliance score. + class TagRuleScoreResourceType include BaseEnumModel - TAG_POLICY_SCORE = "tag_policy_score".freeze + TAG_RULE_SCORE = "tag_rule_score".freeze end end diff --git a/lib/datadog_api_client/v2/models/tag_policy_create_request.rb b/lib/datadog_api_client/v2/models/tag_rule_score_response.rb similarity index 93% rename from lib/datadog_api_client/v2/models/tag_policy_create_request.rb rename to lib/datadog_api_client/v2/models/tag_rule_score_response.rb index 09e079e48947..0127aad8d445 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_create_request.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_score_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Payload for creating a new tag policy. - class TagPolicyCreateRequest + # A tag rule compliance score. + class TagRuleScoreResponse include BaseGenericModel - # Data object for creating a tag policy. + # A compliance score resource for a tag rule. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'TagPolicyCreateData' + :'data' => :'TagRuleScoreData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyCreateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleScoreResponse` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_source.rb b/lib/datadog_api_client/v2/models/tag_rule_source.rb similarity index 89% rename from lib/datadog_api_client/v2/models/tag_policy_source.rb rename to lib/datadog_api_client/v2/models/tag_rule_source.rb index 142a261a8db6..daf06be95333 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_source.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_source.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # The telemetry source that a tag policy applies to. - class TagPolicySource + # The telemetry source that a tag rule applies to. + class TagRuleSource include BaseEnumModel LOGS = "logs".freeze diff --git a/lib/datadog_api_client/v2/models/tag_policy_type.rb b/lib/datadog_api_client/v2/models/tag_rule_type.rb similarity index 86% rename from lib/datadog_api_client/v2/models/tag_policy_type.rb rename to lib/datadog_api_client/v2/models/tag_rule_type.rb index 11a94f3b4a8f..57dfd1993638 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_type.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_type.rb @@ -17,9 +17,9 @@ require 'time' module DatadogAPIClient::V2 - # 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. - class TagPolicyType + class TagRuleType include BaseEnumModel BLOCKING = "blocking".freeze diff --git a/lib/datadog_api_client/v2/models/tag_policy_update_attributes.rb b/lib/datadog_api_client/v2/models/tag_rule_update_attributes.rb similarity index 77% rename from lib/datadog_api_client/v2/models/tag_policy_update_attributes.rb rename to lib/datadog_api_client/v2/models/tag_rule_update_attributes.rb index 882b6a469486..a6f1870719aa 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_update_attributes.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_update_attributes.rb @@ -17,31 +17,31 @@ require 'time' module DatadogAPIClient::V2 - # 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. - class TagPolicyUpdateAttributes + # 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. + class TagRuleUpdateAttributes include BaseGenericModel - # Whether the policy is currently enforced. + # Whether the rule is currently enforced. attr_accessor :enabled - # When `true`, the policy matches tag values that do NOT match any of the supplied patterns. - attr_accessor :negated - - # Human-readable name for the tag policy. - attr_accessor :policy_name + # Human-readable name for the tag rule. + attr_accessor :name - # How the policy is enforced. `blocking` rejects telemetry that violates the policy. - # `surfacing` only highlights non-compliant telemetry without blocking it. - attr_accessor :policy_type + # When `true`, the rule matches tag values that do NOT match any of the supplied patterns. + attr_accessor :negated # When `true`, telemetry without this tag is treated as a violation. attr_accessor :required - # The scope the policy applies within. + # How the rule is enforced. `blocking` rejects telemetry that violates the rule. + # `surfacing` only highlights non-compliant telemetry without blocking it. + attr_accessor :rule_type + + # The scope the rule applies within. attr_accessor :scope - # The tag key that the policy governs. + # The tag key that the rule governs. attr_accessor :tag_key # One or more patterns that valid values for the tag key must match. @@ -54,10 +54,10 @@ class TagPolicyUpdateAttributes def self.attribute_map { :'enabled' => :'enabled', + :'name' => :'name', :'negated' => :'negated', - :'policy_name' => :'policy_name', - :'policy_type' => :'policy_type', :'required' => :'required', + :'rule_type' => :'rule_type', :'scope' => :'scope', :'tag_key' => :'tag_key', :'tag_value_patterns' => :'tag_value_patterns' @@ -69,10 +69,10 @@ def self.attribute_map def self.openapi_types { :'enabled' => :'Boolean', + :'name' => :'String', :'negated' => :'Boolean', - :'policy_name' => :'String', - :'policy_type' => :'TagPolicyType', :'required' => :'Boolean', + :'rule_type' => :'TagRuleType', :'scope' => :'String', :'tag_key' => :'String', :'tag_value_patterns' => :'Array' @@ -84,7 +84,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyUpdateAttributes` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleUpdateAttributes` initialize method" end self.additional_properties = {} @@ -101,22 +101,22 @@ def initialize(attributes = {}) self.enabled = attributes[:'enabled'] end - if attributes.key?(:'negated') - self.negated = attributes[:'negated'] - end - - if attributes.key?(:'policy_name') - self.policy_name = attributes[:'policy_name'] + if attributes.key?(:'name') + self.name = attributes[:'name'] end - if attributes.key?(:'policy_type') - self.policy_type = attributes[:'policy_type'] + if attributes.key?(:'negated') + self.negated = attributes[:'negated'] end if attributes.key?(:'required') self.required = attributes[:'required'] end + if attributes.key?(:'rule_type') + self.rule_type = attributes[:'rule_type'] + end + if attributes.key?(:'scope') self.scope = attributes[:'scope'] end @@ -159,10 +159,10 @@ def ==(o) return true if self.equal?(o) self.class == o.class && enabled == o.enabled && + name == o.name && negated == o.negated && - policy_name == o.policy_name && - policy_type == o.policy_type && required == o.required && + rule_type == o.rule_type && scope == o.scope && tag_key == o.tag_key && tag_value_patterns == o.tag_value_patterns && @@ -173,7 +173,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [enabled, negated, policy_name, policy_type, required, scope, tag_key, tag_value_patterns, additional_properties].hash + [enabled, name, negated, required, rule_type, scope, tag_key, tag_value_patterns, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/tag_policy_update_data.rb b/lib/datadog_api_client/v2/models/tag_rule_update_data.rb similarity index 88% rename from lib/datadog_api_client/v2/models/tag_policy_update_data.rb rename to lib/datadog_api_client/v2/models/tag_rule_update_data.rb index a0bc2be1c418..67149617fc44 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_update_data.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_update_data.rb @@ -17,18 +17,18 @@ require 'time' module DatadogAPIClient::V2 - # Data object for updating a tag policy. - class TagPolicyUpdateData + # Data object for updating a tag rule. + class TagRuleUpdateData include BaseGenericModel - # 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. attr_accessor :attributes - # The unique identifier of the tag policy being updated. + # The unique identifier of the tag rule being updated. attr_reader :id - # JSON:API resource type for a tag policy. + # JSON:API resource type for a tag rule. attr_reader :type attr_accessor :additional_properties @@ -47,9 +47,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'TagPolicyUpdateAttributes', + :'attributes' => :'TagRuleUpdateAttributes', :'id' => :'String', - :'type' => :'TagPolicyResourceType' + :'type' => :'TagRuleResourceType' } end @@ -58,7 +58,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyUpdateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleUpdateData` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policy_update_request.rb b/lib/datadog_api_client/v2/models/tag_rule_update_request.rb similarity index 91% rename from lib/datadog_api_client/v2/models/tag_policy_update_request.rb rename to lib/datadog_api_client/v2/models/tag_rule_update_request.rb index d1c26e48a10c..d1a20186fe3a 100644 --- a/lib/datadog_api_client/v2/models/tag_policy_update_request.rb +++ b/lib/datadog_api_client/v2/models/tag_rule_update_request.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Payload for updating an existing tag policy. Only the supplied fields are modified. - class TagPolicyUpdateRequest + # Payload for updating an existing tag rule. Only the supplied fields are modified. + class TagRuleUpdateRequest include BaseGenericModel - # Data object for updating a tag policy. + # Data object for updating a tag rule. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'TagPolicyUpdateData' + :'data' => :'TagRuleUpdateData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPolicyUpdateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRuleUpdateRequest` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_policies_list_response.rb b/lib/datadog_api_client/v2/models/tag_rules_list_response.rb similarity index 89% rename from lib/datadog_api_client/v2/models/tag_policies_list_response.rb rename to lib/datadog_api_client/v2/models/tag_rules_list_response.rb index 58f7e00e4be6..e55138477ed7 100644 --- a/lib/datadog_api_client/v2/models/tag_policies_list_response.rb +++ b/lib/datadog_api_client/v2/models/tag_rules_list_response.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # A page of tag policies. - class TagPoliciesListResponse + # A page of tag rules. + class TagRulesListResponse include BaseGenericModel - # An array of tag policy data objects. + # An array of tag rule data objects. attr_reader :data - # Related resources fetched alongside the primary tag policies. Populated when an `include` query parameter is supplied. + # Related resources fetched alongside the primary tag rules. Populated when an `include` query parameter is supplied. attr_accessor :included attr_accessor :additional_properties @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array', - :'included' => :'Array' + :'data' => :'Array', + :'included' => :'Array' } end @@ -52,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagPoliciesListResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TagRulesListResponse` initialize method" end self.additional_properties = {}