Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
695 changes: 695 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/v2/policy-management/EvaluatePolicyResult.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Evaluate policy result returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.evaluate_policy_result".to_sym] = true
end
api_instance = DatadogAPIClient::V2::PolicyManagementAPI.new
p api_instance.evaluate_policy_result("SAML")
27 changes: 27 additions & 0 deletions examples/v2/tag-policies/CreateTagPolicy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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::TagPolicyDataRequest.new({
attributes: DatadogAPIClient::V2::TagPolicyAttributesRequest.new({
enabled: true,
negated: false,
policy_name: "production-tags-policy",
required: true,
scope: "env",
source: "logs",
tag_key: "service",
tag_value_patterns: [
"api",
"web",
],
}),
type: DatadogAPIClient::V2::TagPolicyType::TAG_POLICY,
}),
})
p api_instance.create_tag_policy(body)
8 changes: 8 additions & 0 deletions examples/v2/tag-policies/DeleteTagPolicy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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("123")
8 changes: 8 additions & 0 deletions examples/v2/tag-policies/GetTagPolicy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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("123")
8 changes: 8 additions & 0 deletions examples/v2/tag-policies/GetTagPolicyScore.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get tag policy 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("123")
8 changes: 8 additions & 0 deletions examples/v2/tag-policies/ListTagPolicies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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()
27 changes: 27 additions & 0 deletions examples/v2/tag-policies/UpdateTagPolicy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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::TagPolicyDataUpdateRequest.new({
attributes: DatadogAPIClient::V2::TagPolicyAttributesUpdateRequest.new({
enabled: true,
negated: false,
policy_name: "production-tags-policy",
required: true,
scope: "env",
source: "logs",
tag_key: "service",
tag_value_patterns: [
"api",
"web",
],
}),
type: DatadogAPIClient::V2::TagPolicyType::TAG_POLICY,
}),
})
p api_instance.update_tag_policy("123", body)
22 changes: 22 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,9 @@
"role_id" => "String",
"body" => "RelationshipToUser",
},
"v2.EvaluatePolicyResult" => {
"policy_type" => "String",
},
"v2.ListPowerpacks" => {
"page_limit" => "Integer",
"page_offset" => "Integer",
Expand Down Expand Up @@ -3518,6 +3521,25 @@
"variable_id" => "String",
"body" => "GlobalVariableJsonPatchRequest",
},
"v2.ListTagPolicies" => {
"filter_source" => "String",
},
"v2.CreateTagPolicy" => {
"body" => "TagPolicyCreateRequest",
},
"v2.DeleteTagPolicy" => {
"policy_id" => "String",
},
"v2.GetTagPolicy" => {
"policy_id" => "String",
},
"v2.UpdateTagPolicy" => {
"policy_id" => "String",
"body" => "TagPolicyUpdateRequest",
},
"v2.GetTagPolicyScore" => {
"policy_id" => "String",
},
"v2.ListTeams" => {
"page_number" => "Integer",
"page_size" => "Integer",
Expand Down
28 changes: 28 additions & 0 deletions features/v2/policy_management.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@endpoint(policy-management) @endpoint(policy-management-v2)
Feature: Policy Management
Manage and evaluate organizational policies.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "PolicyManagement" API
And operation "EvaluatePolicyResult" enabled
And new "EvaluatePolicyResult" request

@generated @skip @team:DataDog/aaa-omg
Scenario: Evaluate policy result returns "Bad Request" response
Given request contains "policy_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/aaa-omg
Scenario: Evaluate policy result returns "Not Found" response
Given request contains "policy_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/aaa-omg
Scenario: Evaluate policy result returns "OK" response
Given request contains "policy_type" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
137 changes: 137 additions & 0 deletions features/v2/tag_policies.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
@endpoint(tag-policies) @endpoint(tag-policies-v2)
Feature: Tag Policies
Manage tag policies to enforce tagging standards across your organization.

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-omg
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": "production-tags-policy", "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-omg
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": "production-tags-policy", "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-omg
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-omg
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-omg
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-omg
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-omg
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-omg
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-omg
Scenario: Get tag policy 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-omg
Scenario: Get tag policy 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-omg
Scenario: Get tag policy 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-omg
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-omg
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-omg
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": {"enabled": true, "negated": false, "policy_name": "production-tags-policy", "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-omg
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": {"enabled": true, "negated": false, "policy_name": "production-tags-policy", "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 404 Not Found

@generated @skip @team:DataDog/aaa-omg
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": {"enabled": true, "negated": false, "policy_name": "production-tags-policy", "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 200 OK
49 changes: 49 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3344,6 +3344,12 @@
"type": "safe"
}
},
"EvaluatePolicyResult": {
"tag": "Policy Management",
"undo": {
"type": "safe"
}
},
"ListFindings": {
"tag": "Security Monitoring",
"undo": {
Expand Down Expand Up @@ -5060,6 +5066,49 @@
"type": "safe"
}
},
"ListTagPolicies": {
"tag": "Tag Policies",
"undo": {
"type": "safe"
}
},
"CreateTagPolicy": {
"tag": "Tag Policies",
"undo": {
"operationId": "DeleteTagPolicy",
"parameters": [
{
"name": "policy_id",
"source": "<RESPONSE_PATH>"
}
],
"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": {
Expand Down
7 changes: 7 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def initialize
"v2.validate_existing_monitor_user_template": false,
"v2.validate_monitor_user_template": false,
"v2.list_role_templates": false,
"v2.evaluate_policy_result": false,
"v2.create_connection": false,
"v2.delete_connection": false,
"v2.get_account_facet_info": false,
Expand Down Expand Up @@ -364,6 +365,12 @@ def initialize
"v2.list_custom_rule_revisions": false,
"v2.revert_custom_rule_revision": 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,
Expand Down
Loading
Loading