Sha256: 1971c36b0abb5e1aeccb3a51b8fda9e1e22fb7dca6a2c2512a5039f161d25052

Contents?: true

Size: 719 Bytes

Versions: 13

Compression:

Stored size: 719 Bytes

Contents

# Create a Cloud Workload Security 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: "Test Agent rule",
      enabled: true,
      expression: 'exec.file.name == "sh"',
      name: "examplecloudworkloadsecurity",
    }),
    type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
  }),
})
p api_instance.create_cloud_workload_security_agent_rule(body)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
datadog_api_client-2.22.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.21.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.20.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.19.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.18.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.17.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.16.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.15.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.14.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.13.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.12.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.11.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.10.0 examples/v2/cloud-workload-security/CreateCloudWorkloadSecurityAgentRule.rb