Sha256: 90a3938efb0df34ec813f00a2e41c180d69d45852a0ebeaf59ec9882285e507a

Contents?: true

Size: 1.01 KB

Versions: 12

Compression:

Stored size: 1.01 KB

Contents

# Create outcomes batch returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.create_scorecard_outcomes_batch".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ServiceScorecardsAPI.new

# there is a valid "create_scorecard_rule" in the system
CREATE_SCORECARD_RULE_DATA_ID = ENV["CREATE_SCORECARD_RULE_DATA_ID"]

body = DatadogAPIClient::V2::OutcomesBatchRequest.new({
  data: DatadogAPIClient::V2::OutcomesBatchRequestData.new({
    attributes: DatadogAPIClient::V2::OutcomesBatchAttributes.new({
      results: [
        DatadogAPIClient::V2::OutcomesBatchRequestItem.new({
          remarks: 'See: <a href="https://app.datadoghq.com/services">Services</a>',
          rule_id: CREATE_SCORECARD_RULE_DATA_ID,
          service_name: "my-service",
          state: DatadogAPIClient::V2::State::PASS,
        }),
      ],
    }),
    type: DatadogAPIClient::V2::OutcomesBatchType::BATCHED_OUTCOME,
  }),
})
p api_instance.create_scorecard_outcomes_batch(body)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.27.1 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.26.1 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.26.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.25.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.24.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.22.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.21.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.20.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.19.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.18.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb
datadog_api_client-2.17.0 examples/v2/service-scorecards/CreateScorecardOutcomesBatch.rb