Sha256: 78bbb96ff151a5fea16b6f615e4b3f51168a4ec5b9d7aa338ee762b303ade620

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::ServiceLevelObjectivesAPI.new
body = DatadogAPIClient::V1::ServiceLevelObjectiveRequest.new({ name: "Custom Metric SLO", thresholds: [DatadogAPIClient::V1::SLOThreshold.new({ target: 99.9, timeframe: DatadogAPIClient::V1::SLOTimeframe::SEVEN_DAYS })], type: DatadogAPIClient::V1::SLOType::METRIC }) # ServiceLevelObjectiveRequest | Service level objective request object.

begin
  # Create an SLO object
  result = api_instance.create_slo(body)
  p result
rescue DatadogAPIClient::V1::APIError => e
  puts "Error when calling ServiceLevelObjectivesAPI->create_slo: #{e}"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datadog_api_client-1.7.0 examples/generated/v1/service-level-objectives/CreateSLO.rb