Skip to content

Commit

Permalink
Regenerate client from commit a7ed33a4 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Mar 1, 2024
1 parent 8707a2c commit 81ce634
Show file tree
Hide file tree
Showing 12 changed files with 672 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-29 14:49:22.788128",
"spec_repo_commit": "bb5305bc"
"regenerated": "2024-03-01 11:03:58.750185",
"spec_repo_commit": "a7ed33a4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-02-29 14:49:22.878520",
"spec_repo_commit": "bb5305bc"
"regenerated": "2024-03-01 11:03:58.811111",
"spec_repo_commit": "a7ed33a4"
}
}
}
128 changes: 128 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29578,6 +29578,129 @@ paths:
We are gradually onboarding support for more sources. If you have any

feedback, contact [Datadog Support](https://docs.datadoghq.com/help/).'
/api/v2/remote_config/products/cws/agent_rules:
get:
description: Get the list of Cloud Security Management Threats Agent rules.
operationId: ListCSMThreatsAgentRules
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRulesListResponse'
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get all CSM Threats Agent rules
tags:
- Cloud Workload Security
post:
description: Create a new Cloud Security Management Threats Agent rule with
the given parameters.
operationId: CreateCSMThreatsAgentRule
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateRequest'
description: The definition of the new Agent rule.
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'409':
$ref: '#/components/responses/ConflictResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Create a CSM Threats Agent rule
tags:
- Cloud Workload Security
x-codegen-request-body-name: body
/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}:
delete:
description: Delete a specific Cloud Security Management Threats Agent rule.
operationId: DeleteCSMThreatsAgentRule
parameters:
- $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID'
responses:
'204':
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Delete a CSM Threats Agent rule
tags:
- Cloud Workload Security
get:
description: Get the details of a specific Cloud Security Management Threats
Agent rule.
operationId: GetCSMThreatsAgentRule
parameters:
- $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse'
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get a CSM Threats Agent rule
tags:
- Cloud Workload Security
patch:
description: 'Update a specific Cloud Security Management Threats Agent rule.

Returns the Agent rule object when the request is successful.'
operationId: UpdateCSMThreatsAgentRule
parameters:
- $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateRequest'
description: New definition of the Agent rule.
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'409':
$ref: '#/components/responses/ConcurrentModificationResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Update a CSM Threats Agent rule
tags:
- Cloud Workload Security
x-codegen-request-body-name: body
/api/v2/restriction_policy/{resource_id}:
delete:
description: Deletes the restriction policy associated with a specified resource.
Expand Down Expand Up @@ -34817,6 +34940,11 @@ tags:
[Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more
information.
name: CI Visibility Tests
- description: Cloud Security Management Threats (CSM Threats) monitors file, network,
and process activity across your environment to detect real-time threats to your
infrastructure. See the [Setting up CSM Threats page](https://docs.datadoghq.com/security/threats/)
for more information.
name: CSM Threats
- description: View and manage cases and projects within Case Management. See the
[Case Management page](https://docs.datadoghq.com/service_management/case_management/)
for more information.
Expand Down
17 changes: 17 additions & 0 deletions examples/v2/cloud-workload-security/CreateCSMThreatsAgentRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Create a CSM Threats Agent rule returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudWorkloadSecurityAPI.new

body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateRequest.new({
data: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateData.new({
attributes: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateAttributes.new({
description: "My Agent rule",
enabled: true,
expression: 'exec.file.name == \\"sh\\"',
name: "my_agent_rule",
}),
type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
}),
})
p api_instance.create_csm_threats_agent_rule(body)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete a CSM Threats Agent rule returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudWorkloadSecurityAPI.new
api_instance.delete_csm_threats_agent_rule("agent_rule_id")
5 changes: 5 additions & 0 deletions examples/v2/cloud-workload-security/GetCSMThreatsAgentRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get a CSM Threats Agent rule returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudWorkloadSecurityAPI.new
p api_instance.get_csm_threats_agent_rule("agent_rule_id")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get all CSM Threats Agent rules returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudWorkloadSecurityAPI.new
p api_instance.list_csm_threats_agent_rules()
16 changes: 16 additions & 0 deletions examples/v2/cloud-workload-security/UpdateCSMThreatsAgentRule.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Update a CSM Threats Agent rule returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudWorkloadSecurityAPI.new

body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateRequest.new({
data: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateData.new({
attributes: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateAttributes.new({
description: "My Agent rule",
enabled: true,
expression: 'exec.file.name == \\"sh\\"',
}),
type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
}),
})
p api_instance.update_csm_threats_agent_rule("agent_rule_id", body)
39 changes: 26 additions & 13 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,32 @@
"page_limit" => "Integer",
"page_cursor" => "String",
},
"v2.CreateCSMThreatsAgentRule" => {
"body" => "CloudWorkloadSecurityAgentRuleCreateRequest",
},
"v2.DeleteCSMThreatsAgentRule" => {
"agent_rule_id" => "String",
},
"v2.GetCSMThreatsAgentRule" => {
"agent_rule_id" => "String",
},
"v2.UpdateCSMThreatsAgentRule" => {
"agent_rule_id" => "String",
"body" => "CloudWorkloadSecurityAgentRuleUpdateRequest",
},
"v2.CreateCloudWorkloadSecurityAgentRule" => {
"body" => "CloudWorkloadSecurityAgentRuleCreateRequest",
},
"v2.DeleteCloudWorkloadSecurityAgentRule" => {
"agent_rule_id" => "String",
},
"v2.GetCloudWorkloadSecurityAgentRule" => {
"agent_rule_id" => "String",
},
"v2.UpdateCloudWorkloadSecurityAgentRule" => {
"agent_rule_id" => "String",
"body" => "CloudWorkloadSecurityAgentRuleUpdateRequest",
},
"v2.DeleteRestrictionPolicy" => {
"resource_id" => "String",
},
Expand Down Expand Up @@ -1755,19 +1781,6 @@
"v2.DeleteScorecardRule" => {
"rule_id" => "String",
},
"v2.CreateCloudWorkloadSecurityAgentRule" => {
"body" => "CloudWorkloadSecurityAgentRuleCreateRequest",
},
"v2.DeleteCloudWorkloadSecurityAgentRule" => {
"agent_rule_id" => "String",
},
"v2.GetCloudWorkloadSecurityAgentRule" => {
"agent_rule_id" => "String",
},
"v2.UpdateCloudWorkloadSecurityAgentRule" => {
"agent_rule_id" => "String",
"body" => "CloudWorkloadSecurityAgentRuleUpdateRequest",
},
"v2.ReorderScanningGroups" => {
"body" => "SensitiveDataScannerConfigRequest",
},
Expand Down
87 changes: 87 additions & 0 deletions features/v2/cloud_workload_security.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ Feature: Cloud Workload Security
And a valid "appKeyAuth" key in the system
And an instance of "CloudWorkloadSecurity" API

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Create a CSM Threats Agent rule returns "Bad Request" response
Given new "CreateCSMThreatsAgentRule" request
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\"", "name": "my_agent_rule"}, "type": "agent_rule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Create a CSM Threats Agent rule returns "Conflict" response
Given new "CreateCSMThreatsAgentRule" request
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\"", "name": "my_agent_rule"}, "type": "agent_rule"}}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Create a CSM Threats Agent rule returns "OK" response
Given new "CreateCSMThreatsAgentRule" request
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\"", "name": "my_agent_rule"}, "type": "agent_rule"}}
When the request is sent
Then the response status is 200 OK

@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Create a Cloud Workload Security Agent rule returns "Bad Request" response
Given new "CreateCloudWorkloadSecurityAgentRule" request
Expand All @@ -33,6 +54,20 @@ Feature: Cloud Workload Security
And the response "data.type" is equal to "agent_rule"
And the response "data.attributes.description" is equal to "Test Agent rule"

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Delete a CSM Threats Agent rule returns "Not Found" response
Given new "DeleteCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Delete a CSM Threats Agent rule returns "OK" response
Given new "DeleteCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 OK

@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Delete a Cloud Workload Security Agent rule returns "Not Found" response
Given new "DeleteCloudWorkloadSecurityAgentRule" request
Expand All @@ -48,6 +83,20 @@ Feature: Cloud Workload Security
When the request is sent
Then the response status is 204 OK

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Get a CSM Threats Agent rule returns "Not Found" response
Given new "GetCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Get a CSM Threats Agent rule returns "OK" response
Given new "GetCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Get a Cloud Workload Security Agent rule returns "Not Found" response
Given new "GetCloudWorkloadSecurityAgentRule" request
Expand All @@ -65,6 +114,12 @@ Feature: Cloud Workload Security
And the response "data.type" is equal to "agent_rule"
And the response "data.attributes.description" is equal to "My Agent rule"

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Get all CSM Threats Agent rules returns "OK" response
Given new "ListCSMThreatsAgentRules" request
When the request is sent
Then the response status is 200 OK

@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Get all Cloud Workload Security Agent rules returns "OK" response
Given there is a valid "agent_rule" in the system
Expand All @@ -79,6 +134,38 @@ Feature: Cloud Workload Security
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Update a CSM Threats Agent rule returns "Bad Request" response
Given new "UpdateCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\""}, "type": "agent_rule"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Update a CSM Threats Agent rule returns "Concurrent Modification" response
Given new "UpdateCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\""}, "type": "agent_rule"}}
When the request is sent
Then the response status is 409 Concurrent Modification

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Update a CSM Threats Agent rule returns "Not Found" response
Given new "UpdateCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\""}, "type": "agent_rule"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Update a CSM Threats Agent rule returns "OK" response
Given new "UpdateCSMThreatsAgentRule" request
And request contains "agent_rule_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \\\"sh\\\""}, "type": "agent_rule"}}
When the request is sent
Then the response status is 200 OK

@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
Scenario: Update a Cloud Workload Security Agent rule returns "Bad Request" response
Given there is a valid "agent_rule" in the system
Expand Down
Loading

0 comments on commit 81ce634

Please sign in to comment.