Skip to content

Commit 5de8ac9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fc429a6 of spec repo (DataDog#3489)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0256aa7 commit 5de8ac9

35 files changed

Lines changed: 4677 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 968 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Create a tag policy returns "Created" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.create_tag_policy".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new
8+
9+
body = DatadogAPIClient::V2::TagPolicyCreateRequest.new({
10+
data: DatadogAPIClient::V2::TagPolicyCreateData.new({
11+
attributes: DatadogAPIClient::V2::TagPolicyCreateAttributes.new({
12+
enabled: true,
13+
negated: false,
14+
policy_name: "Service tag must be one of api or web",
15+
policy_type: DatadogAPIClient::V2::TagPolicyCreateType::SURFACING,
16+
required: true,
17+
scope: "env",
18+
source: DatadogAPIClient::V2::TagPolicySource::LOGS,
19+
tag_key: "service",
20+
tag_value_patterns: [
21+
"api",
22+
"web",
23+
],
24+
}),
25+
type: DatadogAPIClient::V2::TagPolicyResourceType::TAG_POLICY,
26+
}),
27+
})
28+
p api_instance.create_tag_policy(body)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Delete a tag policy returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_tag_policy".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new
8+
api_instance.delete_tag_policy("policy_id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get a tag policy returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_tag_policy".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new
8+
p api_instance.get_tag_policy("policy_id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get a tag policy compliance score returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_tag_policy_score".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new
8+
p api_instance.get_tag_policy_score("policy_id")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List tag policies returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_tag_policies".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new
8+
p api_instance.list_tag_policies()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Update a tag policy returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.update_tag_policy".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TagPoliciesAPI.new
8+
9+
body = DatadogAPIClient::V2::TagPolicyUpdateRequest.new({
10+
data: DatadogAPIClient::V2::TagPolicyUpdateData.new({
11+
attributes: DatadogAPIClient::V2::TagPolicyUpdateAttributes.new({
12+
policy_type: DatadogAPIClient::V2::TagPolicyType::SURFACING,
13+
tag_value_patterns: [],
14+
}),
15+
id: "123",
16+
type: DatadogAPIClient::V2::TagPolicyResourceType::TAG_POLICY,
17+
}),
18+
})
19+
p api_instance.update_tag_policy("policy_id", body)

features/scenarios_model_mapping.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5641,6 +5641,36 @@
56415641
"variable_id" => "String",
56425642
"body" => "GlobalVariableJsonPatchRequest",
56435643
},
5644+
"v2.ListTagPolicies" => {
5645+
"include_disabled" => "Boolean",
5646+
"include_deleted" => "Boolean",
5647+
"include" => "TagPolicyInclude",
5648+
"filter_source" => "TagPolicySource",
5649+
"ts_start" => "Integer",
5650+
"ts_end" => "Integer",
5651+
},
5652+
"v2.CreateTagPolicy" => {
5653+
"body" => "TagPolicyCreateRequest",
5654+
},
5655+
"v2.DeleteTagPolicy" => {
5656+
"policy_id" => "String",
5657+
"hard_delete" => "Boolean",
5658+
},
5659+
"v2.GetTagPolicy" => {
5660+
"policy_id" => "String",
5661+
"include" => "TagPolicyInclude",
5662+
"ts_start" => "Integer",
5663+
"ts_end" => "Integer",
5664+
},
5665+
"v2.UpdateTagPolicy" => {
5666+
"policy_id" => "String",
5667+
"body" => "TagPolicyUpdateRequest",
5668+
},
5669+
"v2.GetTagPolicyScore" => {
5670+
"policy_id" => "String",
5671+
"ts_start" => "Integer",
5672+
"ts_end" => "Integer",
5673+
},
56445674
"v2.ListTeams" => {
56455675
"page_number" => "Integer",
56465676
"page_size" => "Integer",

features/v2/tag_policies.feature

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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

features/v2/undo.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8655,6 +8655,49 @@
86558655
"type": "safe"
86568656
}
86578657
},
8658+
"ListTagPolicies": {
8659+
"tag": "Tag Policies",
8660+
"undo": {
8661+
"type": "safe"
8662+
}
8663+
},
8664+
"CreateTagPolicy": {
8665+
"tag": "Tag Policies",
8666+
"undo": {
8667+
"operationId": "DeleteTagPolicy",
8668+
"parameters": [
8669+
{
8670+
"name": "policy_id",
8671+
"source": "data.id"
8672+
}
8673+
],
8674+
"type": "unsafe"
8675+
}
8676+
},
8677+
"DeleteTagPolicy": {
8678+
"tag": "Tag Policies",
8679+
"undo": {
8680+
"type": "idempotent"
8681+
}
8682+
},
8683+
"GetTagPolicy": {
8684+
"tag": "Tag Policies",
8685+
"undo": {
8686+
"type": "safe"
8687+
}
8688+
},
8689+
"UpdateTagPolicy": {
8690+
"tag": "Tag Policies",
8691+
"undo": {
8692+
"type": "idempotent"
8693+
}
8694+
},
8695+
"GetTagPolicyScore": {
8696+
"tag": "Tag Policies",
8697+
"undo": {
8698+
"type": "safe"
8699+
}
8700+
},
86588701
"ListTagPipelinesRulesets": {
86598702
"tag": "Cloud Cost Management",
86608703
"undo": {

0 commit comments

Comments
 (0)