Sha256: f55b0cd89a4866189bfe53b6f47813cf0de322be41db4de9396d9280aa8a3cec

Contents?: true

Size: 789 Bytes

Versions: 31

Compression:

Stored size: 789 Bytes

Contents

# Update a Cloud Workload Security Agent rule returns "OK" response

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

# there is a valid "agent_rule" in the system
AGENT_RULE_DATA_ID = ENV["AGENT_RULE_DATA_ID"]

body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateRequest.new({
  data: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateData.new({
    attributes: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateAttributes.new({
      description: "Test Agent rule",
      enabled: true,
      expression: 'exec.file.name == "sh"',
    }),
    type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
  }),
})
p api_instance.update_cloud_workload_security_agent_rule(AGENT_RULE_DATA_ID, body)

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
datadog_api_client-2.2.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.1.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.0.2 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.0.1 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.0.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-1.11.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-1.10.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-1.9.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-1.8.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-1.7.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-1.6.0 examples/v2/cloud-workload-security/UpdateCloudWorkloadSecurityAgentRule.rb