Class: DatadogAPIClient::V2::ServiceLevelObjectivesAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::ServiceLevelObjectivesAPI
- Defined in:
- lib/datadog_api_client/v2/api/service_level_objectives_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_slo_report_job(body, opts = {}) ⇒ Object
Create a new SLO report.
-
#create_slo_report_job_with_http_info(body, opts = {}) ⇒ Array<(SLOReportPostResponse, Integer, Hash)>
deprecated
Deprecated.
This API is deprecated.
-
#get_slo_report(report_id, opts = {}) ⇒ Object
Get SLO report.
-
#get_slo_report_job_status(report_id, opts = {}) ⇒ Object
Get SLO report status.
-
#get_slo_report_job_status_with_http_info(report_id, opts = {}) ⇒ Array<(SLOReportStatusGetResponse, Integer, Hash)>
deprecated
Deprecated.
This API is deprecated.
-
#get_slo_report_with_http_info(report_id, opts = {}) ⇒ Array<(String, Integer, Hash)>
deprecated
Deprecated.
This API is deprecated.
-
#get_slo_status(slo_id, from_ts, to_ts, opts = {}) ⇒ Object
Get SLO status.
-
#get_slo_status_with_http_info(slo_id, from_ts, to_ts, opts = {}) ⇒ Array<(SloStatusResponse, Integer, Hash)>
Get SLO status.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ ServiceLevelObjectivesAPI
constructor
A new instance of ServiceLevelObjectivesAPI.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ ServiceLevelObjectivesAPI
Returns a new instance of ServiceLevelObjectivesAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#create_slo_report_job(body, opts = {}) ⇒ Object
Create a new SLO report.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 29 def create_slo_report_job(body, opts = {}) data, _status_code, _headers = create_slo_report_job_with_http_info(body, opts) data end |
#create_slo_report_job_with_http_info(body, opts = {}) ⇒ Array<(SLOReportPostResponse, Integer, Hash)>
This API is deprecated.
Create a new SLO report.
Create a job to generate an SLO report. The report job is processed asynchronously and eventually results in a CSV report being available for download.
Check the status of the job and download the CSV report using the returned report_id.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 45 def create_slo_report_job_with_http_info(body, opts = {}) warn "[DEPRECATION] `CreateSLOReportJob` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.create_slo_report_job".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_slo_report_job") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_slo_report_job")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.create_slo_report_job ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ServiceLevelObjectivesAPI.create_slo_report_job" end # resource path local_var_path = '/api/v2/slo/report' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SLOReportPostResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :create_slo_report_job, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#create_slo_report_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_slo_report(report_id, opts = {}) ⇒ Object
Get SLO report.
107 108 109 110 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 107 def get_slo_report(report_id, opts = {}) data, _status_code, _headers = get_slo_report_with_http_info(report_id, opts) data end |
#get_slo_report_job_status(report_id, opts = {}) ⇒ Object
Get SLO report status.
183 184 185 186 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 183 def get_slo_report_job_status(report_id, opts = {}) data, _status_code, _headers = get_slo_report_job_status_with_http_info(report_id, opts) data end |
#get_slo_report_job_status_with_http_info(report_id, opts = {}) ⇒ Array<(SLOReportStatusGetResponse, Integer, Hash)>
This API is deprecated.
Get SLO report status.
Get the status of the SLO report job.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 197 def get_slo_report_job_status_with_http_info(report_id, opts = {}) warn "[DEPRECATION] `GetSLOReportJobStatus` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_report_job_status".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_report_job_status") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_slo_report_job_status")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.get_slo_report_job_status ...' end # verify the required parameter 'report_id' is set if @api_client.config.client_side_validation && report_id.nil? fail ArgumentError, "Missing the required parameter 'report_id' when calling ServiceLevelObjectivesAPI.get_slo_report_job_status" end # resource path local_var_path = '/api/v2/slo/report/{report_id}/status'.sub('{report_id}', CGI.escape(report_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SLOReportStatusGetResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_slo_report_job_status, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#get_slo_report_job_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_slo_report_with_http_info(report_id, opts = {}) ⇒ Array<(String, Integer, Hash)>
This API is deprecated.
Get SLO report.
Download an SLO report. This can only be performed after the report job has completed.
Reports are not guaranteed to exist indefinitely. Datadog recommends that you download the report as soon as it is available.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 123 def get_slo_report_with_http_info(report_id, opts = {}) warn "[DEPRECATION] `GetSLOReport` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_report".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_report") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_slo_report")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.get_slo_report ...' end # verify the required parameter 'report_id' is set if @api_client.config.client_side_validation && report_id.nil? fail ArgumentError, "Missing the required parameter 'report_id' when calling ServiceLevelObjectivesAPI.get_slo_report" end # resource path local_var_path = '/api/v2/slo/report/{report_id}/download'.sub('{report_id}', CGI.escape(report_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'String' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_slo_report, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#get_slo_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_slo_status(slo_id, from_ts, to_ts, opts = {}) ⇒ Object
Get SLO status.
257 258 259 260 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 257 def get_slo_status(slo_id, from_ts, to_ts, opts = {}) data, _status_code, _headers = get_slo_status_with_http_info(slo_id, from_ts, to_ts, opts) data end |
#get_slo_status_with_http_info(slo_id, from_ts, to_ts, opts = {}) ⇒ Array<(SloStatusResponse, Integer, Hash)>
Get SLO status.
Get the status of a Service Level Objective (SLO) for a given time period.
This endpoint returns the current SLI value, error budget remaining, and other status information for the specified SLO.
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/datadog_api_client/v2/api/service_level_objectives_api.rb', line 274 def get_slo_status_with_http_info(slo_id, from_ts, to_ts, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_status".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_status") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_slo_status")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.get_slo_status ...' end # verify the required parameter 'slo_id' is set if @api_client.config.client_side_validation && slo_id.nil? fail ArgumentError, "Missing the required parameter 'slo_id' when calling ServiceLevelObjectivesAPI.get_slo_status" end # verify the required parameter 'from_ts' is set if @api_client.config.client_side_validation && from_ts.nil? fail ArgumentError, "Missing the required parameter 'from_ts' when calling ServiceLevelObjectivesAPI.get_slo_status" end # verify the required parameter 'to_ts' is set if @api_client.config.client_side_validation && to_ts.nil? fail ArgumentError, "Missing the required parameter 'to_ts' when calling ServiceLevelObjectivesAPI.get_slo_status" end # resource path local_var_path = '/api/v2/slo/{slo_id}/status'.sub('{slo_id}', CGI.escape(slo_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'from_ts'] = from_ts query_params[:'to_ts'] = to_ts query_params[:'disable_corrections'] = opts[:'disable_corrections'] if !opts[:'disable_corrections'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SloStatusResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_slo_status, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServiceLevelObjectivesAPI#get_slo_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |