Sha256: 4a8efdce0121540f02356b892f63389ca0b626c43d4f6e41671a5e93ee3cec30
Contents?: true
Size: 918 Bytes
Versions: 23
Compression:
Stored size: 918 Bytes
Contents
# Update an SLO returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V1::ServiceLevelObjectivesAPI.new # there is a valid "slo" in the system SLO_DATA_0_ID = ENV["SLO_DATA_0_ID"] SLO_DATA_0_NAME = ENV["SLO_DATA_0_NAME"] body = DatadogAPIClient::V1::ServiceLevelObjective.new({ type: DatadogAPIClient::V1::SLOType::METRIC, name: SLO_DATA_0_NAME, thresholds: [ DatadogAPIClient::V1::SLOThreshold.new({ target: 97.0, timeframe: DatadogAPIClient::V1::SLOTimeframe::SEVEN_DAYS, warning: 98.0, }), ], timeframe: DatadogAPIClient::V1::SLOTimeframe::SEVEN_DAYS, target_threshold: 97.0, warning_threshold: 98, query: DatadogAPIClient::V1::ServiceLevelObjectiveQuery.new({ numerator: "sum:httpservice.hits{code:2xx}.as_count()", denominator: "sum:httpservice.hits{!code:3xx}.as_count()", }), }) p api_instance.update_slo(SLO_DATA_0_ID, body)
Version data entries
23 entries across 23 versions & 1 rubygems