Sha256: 2870e6312f57c038137a49ceb1e302c3fc13fc0fc97447ca31286951de32d6fb

Contents?: true

Size: 945 Bytes

Versions: 7

Compression:

Stored size: 945 Bytes

Contents

# Update a custom destination returns "OK" response

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

# there is a valid "custom_destination" in the system
CUSTOM_DESTINATION_DATA_ID = ENV["CUSTOM_DESTINATION_DATA_ID"]

body = DatadogAPIClient::V2::CustomDestinationUpdateRequest.new({
  data: DatadogAPIClient::V2::CustomDestinationUpdateRequestDefinition.new({
    attributes: DatadogAPIClient::V2::CustomDestinationUpdateRequestAttributes.new({
      name: "Nginx logs (Updated)",
      query: "source:nginx",
      enabled: false,
      forward_tags: false,
      forward_tags_restriction_list_type: DatadogAPIClient::V2::CustomDestinationAttributeTagsRestrictionListType::BLOCK_LIST,
    }),
    type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION,
    id: CUSTOM_DESTINATION_DATA_ID,
  }),
})
p api_instance.update_logs_custom_destination(CUSTOM_DESTINATION_DATA_ID, body)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb
datadog_api_client-2.27.1 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb
datadog_api_client-2.26.1 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb
datadog_api_client-2.26.0 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb
datadog_api_client-2.25.0 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb
datadog_api_client-2.24.0 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb
datadog_api_client-2.22.0 examples/v2/logs-custom-destinations/UpdateLogsCustomDestination.rb