|
| 1 | +@endpoint(tag-policies) @endpoint(tag-policies-v2) |
| 2 | +Feature: Tag Policies |
| 3 | + Tag Policies define rules that govern which tag values are accepted for a |
| 4 | + given tag key, scoped to a particular telemetry source (such as logs, |
| 5 | + spans, or metrics). Policies can be `blocking` (data not matching the |
| 6 | + policy is rejected) or `surfacing` (matching data is highlighted but not |
| 7 | + blocked). Each policy reports a compliance `score` derived from how much |
| 8 | + recent telemetry adheres to the policy. |
| 9 | + |
| 10 | + Background: |
| 11 | + Given a valid "apiKeyAuth" key in the system |
| 12 | + And a valid "appKeyAuth" key in the system |
| 13 | + And an instance of "TagPolicies" API |
| 14 | + |
| 15 | + @generated @skip @team:DataDog/aaa-governance-console |
| 16 | + Scenario: Create a tag policy returns "Bad Request" response |
| 17 | + Given operation "CreateTagPolicy" enabled |
| 18 | + And new "CreateTagPolicy" request |
| 19 | + 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"}} |
| 20 | + When the request is sent |
| 21 | + Then the response status is 400 Bad Request |
| 22 | + |
| 23 | + @generated @skip @team:DataDog/aaa-governance-console |
| 24 | + Scenario: Create a tag policy returns "Conflict" response |
| 25 | + Given operation "CreateTagPolicy" enabled |
| 26 | + And new "CreateTagPolicy" request |
| 27 | + 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"}} |
| 28 | + When the request is sent |
| 29 | + Then the response status is 409 Conflict |
| 30 | + |
| 31 | + @generated @skip @team:DataDog/aaa-governance-console |
| 32 | + Scenario: Create a tag policy returns "Created" response |
| 33 | + Given operation "CreateTagPolicy" enabled |
| 34 | + And new "CreateTagPolicy" request |
| 35 | + 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"}} |
| 36 | + When the request is sent |
| 37 | + Then the response status is 201 Created |
| 38 | + |
| 39 | + @generated @skip @team:DataDog/aaa-governance-console |
| 40 | + Scenario: Delete a tag policy returns "Bad Request" response |
| 41 | + Given operation "DeleteTagPolicy" enabled |
| 42 | + And new "DeleteTagPolicy" request |
| 43 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 44 | + When the request is sent |
| 45 | + Then the response status is 400 Bad Request |
| 46 | + |
| 47 | + @generated @skip @team:DataDog/aaa-governance-console |
| 48 | + Scenario: Delete a tag policy returns "No Content" response |
| 49 | + Given operation "DeleteTagPolicy" enabled |
| 50 | + And new "DeleteTagPolicy" request |
| 51 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 52 | + When the request is sent |
| 53 | + Then the response status is 204 No Content |
| 54 | + |
| 55 | + @generated @skip @team:DataDog/aaa-governance-console |
| 56 | + Scenario: Delete a tag policy returns "Not Found" response |
| 57 | + Given operation "DeleteTagPolicy" enabled |
| 58 | + And new "DeleteTagPolicy" request |
| 59 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 60 | + When the request is sent |
| 61 | + Then the response status is 404 Not Found |
| 62 | + |
| 63 | + @generated @skip @team:DataDog/aaa-governance-console |
| 64 | + Scenario: Get a tag policy compliance score returns "Bad Request" response |
| 65 | + Given operation "GetTagPolicyScore" enabled |
| 66 | + And new "GetTagPolicyScore" request |
| 67 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 68 | + When the request is sent |
| 69 | + Then the response status is 400 Bad Request |
| 70 | + |
| 71 | + @generated @skip @team:DataDog/aaa-governance-console |
| 72 | + Scenario: Get a tag policy compliance score returns "Not Found" response |
| 73 | + Given operation "GetTagPolicyScore" enabled |
| 74 | + And new "GetTagPolicyScore" request |
| 75 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 76 | + When the request is sent |
| 77 | + Then the response status is 404 Not Found |
| 78 | + |
| 79 | + @generated @skip @team:DataDog/aaa-governance-console |
| 80 | + Scenario: Get a tag policy compliance score returns "OK" response |
| 81 | + Given operation "GetTagPolicyScore" enabled |
| 82 | + And new "GetTagPolicyScore" request |
| 83 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 84 | + When the request is sent |
| 85 | + Then the response status is 200 OK |
| 86 | + |
| 87 | + @generated @skip @team:DataDog/aaa-governance-console |
| 88 | + Scenario: Get a tag policy returns "Bad Request" response |
| 89 | + Given operation "GetTagPolicy" enabled |
| 90 | + And new "GetTagPolicy" request |
| 91 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 92 | + When the request is sent |
| 93 | + Then the response status is 400 Bad Request |
| 94 | + |
| 95 | + @generated @skip @team:DataDog/aaa-governance-console |
| 96 | + Scenario: Get a tag policy returns "Not Found" response |
| 97 | + Given operation "GetTagPolicy" enabled |
| 98 | + And new "GetTagPolicy" request |
| 99 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 100 | + When the request is sent |
| 101 | + Then the response status is 404 Not Found |
| 102 | + |
| 103 | + @generated @skip @team:DataDog/aaa-governance-console |
| 104 | + Scenario: Get a tag policy returns "OK" response |
| 105 | + Given operation "GetTagPolicy" enabled |
| 106 | + And new "GetTagPolicy" request |
| 107 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 108 | + When the request is sent |
| 109 | + Then the response status is 200 OK |
| 110 | + |
| 111 | + @generated @skip @team:DataDog/aaa-governance-console |
| 112 | + Scenario: List tag policies returns "Bad Request" response |
| 113 | + Given operation "ListTagPolicies" enabled |
| 114 | + And new "ListTagPolicies" request |
| 115 | + When the request is sent |
| 116 | + Then the response status is 400 Bad Request |
| 117 | + |
| 118 | + @generated @skip @team:DataDog/aaa-governance-console |
| 119 | + Scenario: List tag policies returns "OK" response |
| 120 | + Given operation "ListTagPolicies" enabled |
| 121 | + And new "ListTagPolicies" request |
| 122 | + When the request is sent |
| 123 | + Then the response status is 200 OK |
| 124 | + |
| 125 | + @generated @skip @team:DataDog/aaa-governance-console |
| 126 | + Scenario: Update a tag policy returns "Bad Request" response |
| 127 | + Given operation "UpdateTagPolicy" enabled |
| 128 | + And new "UpdateTagPolicy" request |
| 129 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 130 | + And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} |
| 131 | + When the request is sent |
| 132 | + Then the response status is 400 Bad Request |
| 133 | + |
| 134 | + @generated @skip @team:DataDog/aaa-governance-console |
| 135 | + Scenario: Update a tag policy returns "Not Found" response |
| 136 | + Given operation "UpdateTagPolicy" enabled |
| 137 | + And new "UpdateTagPolicy" request |
| 138 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 139 | + And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} |
| 140 | + When the request is sent |
| 141 | + Then the response status is 404 Not Found |
| 142 | + |
| 143 | + @generated @skip @team:DataDog/aaa-governance-console |
| 144 | + Scenario: Update a tag policy returns "OK" response |
| 145 | + Given operation "UpdateTagPolicy" enabled |
| 146 | + And new "UpdateTagPolicy" request |
| 147 | + And request contains "policy_id" parameter from "REPLACE.ME" |
| 148 | + And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} |
| 149 | + When the request is sent |
| 150 | + Then the response status is 200 OK |
0 commit comments