Class: DatadogAPIClient::V1::UsageMeteringAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v1/api/usage_metering_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ UsageMeteringAPI

Returns a new instance of UsageMeteringAPI.



22
23
24
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 22

def initialize(api_client = APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#get_daily_custom_reports(opts = {}) ⇒ Object

Get the list of available daily custom reports.



33
34
35
36
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 33

def get_daily_custom_reports(opts = {})
  data, _status_code, _headers = get_daily_custom_reports_with_http_info(opts)
  data
end

#get_daily_custom_reports_with_http_info(opts = {}) ⇒ Array<(UsageCustomReportsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get the list of available daily custom reports.

Get daily custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of files to return in the response. [default=60].

  • :page_number (Integer)

    The identifier of the first page to return. This parameter is used for the pagination feature [default=0].

  • :sort_dir (UsageSortDirection)

    The direction to sort by: [desc, asc].

  • :sort (UsageSort)

    The field to sort by: [computed_on, size, start_date, end_date].

Returns:

  • (Array<(UsageCustomReportsResponse, Integer, Hash)>)

    UsageCustomReportsResponse data, response status code and response headers



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/v1/api/usage_metering_api.rb', line 46

def get_daily_custom_reports_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_daily_custom_reports)
    unstable_enabled = @api_client.config.unstable_operations[:get_daily_custom_reports]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_daily_custom_reports")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_daily_custom_reports"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_daily_custom_reports ...'
  end
  # resource path
  local_var_path = '/api/v1/daily_custom_reports'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageCustomReportsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_daily_custom_reports,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_daily_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_hourly_usage_attribution(start_hr, usage_type, opts = {}) ⇒ Object

Get hourly usage attribution.



113
114
115
116
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 113

def get_hourly_usage_attribution(start_hr, usage_type, opts = {})
  data, _status_code, _headers = get_hourly_usage_attribution_with_http_info(start_hr, usage_type, opts)
  data
end

#get_hourly_usage_attribution_with_http_info(start_hr, usage_type, opts = {}) ⇒ Array<(HourlyUsageAttributionResponse, Integer, Hash)>

Get hourly usage attribution.

Get hourly usage attribution. Multi-region data is available starting March 1, 2023.

This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetHourlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetHourlyUsageAttribution(start_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • usage_type (HourlyUsageAttributionUsageType)

    Usage type to retrieve.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

  • :next_record_id (String)

    List following results with a next_record_id provided in the previous query.

  • :tag_breakdown_keys (String)

    Comma separated list of tags used to group usage. If no value is provided the usage will not be broken down by tags. To see which tags are available, look for the value of tag_config_source in the API response.

  • :include_descendants (Boolean)

    Include child org usage in the response. Defaults to true.

Returns:



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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 127

def get_hourly_usage_attribution_with_http_info(start_hr, usage_type, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_hourly_usage_attribution)
    unstable_enabled = @api_client.config.unstable_operations[:get_hourly_usage_attribution]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_hourly_usage_attribution")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_hourly_usage_attribution"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_hourly_usage_attribution ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_hourly_usage_attribution"
  end
  # verify the required parameter 'usage_type' is set
  if @api_client.config.client_side_validation && usage_type.nil?
    fail ArgumentError, "Missing the required parameter 'usage_type' when calling UsageMeteringAPI.get_hourly_usage_attribution"
  end
  # resource path
  local_var_path = '/api/v1/usage/hourly-attribution'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'usage_type'] = usage_type
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?
  query_params[:'next_record_id'] = opts[:'next_record_id'] if !opts[:'next_record_id'].nil?
  query_params[:'tag_breakdown_keys'] = opts[:'tag_breakdown_keys'] if !opts[:'tag_breakdown_keys'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'HourlyUsageAttributionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_hourly_usage_attribution,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_hourly_usage_attribution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_incident_management(start_hr, opts = {}) ⇒ Object

Get hourly usage for incident management.



200
201
202
203
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 200

def get_incident_management(start_hr, opts = {})
  data, _status_code, _headers = get_incident_management_with_http_info(start_hr, opts)
  data
end

#get_incident_management_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageIncidentManagementResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for incident management.

Get hourly usage for incident management. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:



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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 211

def get_incident_management_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_incident_management)
    unstable_enabled = @api_client.config.unstable_operations[:get_incident_management]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_incident_management")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_incident_management"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_incident_management ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_incident_management"
  end
  # resource path
  local_var_path = '/api/v1/usage/incident-management'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageIncidentManagementResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_incident_management,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_incident_management\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ingested_spans(start_hr, opts = {}) ⇒ Object

Get hourly usage for ingested spans.



277
278
279
280
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 277

def get_ingested_spans(start_hr, opts = {})
  data, _status_code, _headers = get_ingested_spans_with_http_info(start_hr, opts)
  data
end

#get_ingested_spans_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageIngestedSpansResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for ingested spans.

Get hourly usage for ingested spans. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageIngestedSpansResponse, Integer, Hash)>)

    UsageIngestedSpansResponse data, response status code and response headers



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
340
341
342
343
344
345
346
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 288

def get_ingested_spans_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_ingested_spans)
    unstable_enabled = @api_client.config.unstable_operations[:get_ingested_spans]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_ingested_spans")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_ingested_spans"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_ingested_spans ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_ingested_spans"
  end
  # resource path
  local_var_path = '/api/v1/usage/ingested-spans'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageIngestedSpansResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_ingested_spans,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_ingested_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_monthly_custom_reports(opts = {}) ⇒ Object

Get the list of available monthly custom reports.



356
357
358
359
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 356

def get_monthly_custom_reports(opts = {})
  data, _status_code, _headers = get_monthly_custom_reports_with_http_info(opts)
  data
end

#get_monthly_custom_reports_with_http_info(opts = {}) ⇒ Array<(UsageCustomReportsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get the list of available monthly custom reports.

Get monthly custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of files to return in the response [default=60].

  • :page_number (Integer)

    The identifier of the first page to return. This parameter is used for the pagination feature [default=0].

  • :sort_dir (UsageSortDirection)

    The direction to sort by: [desc, asc].

  • :sort (UsageSort)

    The field to sort by: [computed_on, size, start_date, end_date].

Returns:

  • (Array<(UsageCustomReportsResponse, Integer, Hash)>)

    UsageCustomReportsResponse data, response status code and response headers



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 369

def get_monthly_custom_reports_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_monthly_custom_reports)
    unstable_enabled = @api_client.config.unstable_operations[:get_monthly_custom_reports]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_monthly_custom_reports")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_monthly_custom_reports"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_monthly_custom_reports ...'
  end
  # resource path
  local_var_path = '/api/v1/monthly_custom_reports'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'sort_dir'] = opts[:'sort_dir'] if !opts[:'sort_dir'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageCustomReportsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_monthly_custom_reports,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_monthly_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_monthly_usage_attribution(start_month, fields, opts = {}) ⇒ Object

Get monthly usage attribution.



438
439
440
441
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 438

def get_monthly_usage_attribution(start_month, fields, opts = {})
  data, _status_code, _headers = get_monthly_usage_attribution_with_http_info(start_month, fields, opts)
  data
end

#get_monthly_usage_attribution_with_http_info(start_month, fields, opts = {}) ⇒ Array<(MonthlyUsageAttributionResponse, Integer, Hash)>

Get monthly usage attribution.

Get monthly usage attribution. Multi-region data is available starting March 1, 2023.

This API endpoint is paginated. To make sure you receive all records, check if the value of next_record_id is set in the response. If it is, make another request and pass next_record_id as a parameter. Pseudo code example:

response := GetMonthlyUsageAttribution(start_month)
cursor := response.metadata.pagination.next_record_id
WHILE cursor != null BEGIN
  sleep(5 seconds)  # Avoid running into rate limit
  response := GetMonthlyUsageAttribution(start_month, next_record_id=cursor)
  cursor := response.metadata.pagination.next_record_id
END

Parameters:

  • start_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning in this month. Maximum of 15 months ago.

  • fields (MonthlyUsageAttributionSupportedMetrics)

    Comma-separated list of usage types to return, or * for all usage types.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage ending this month.

  • :sort_direction (UsageSortDirection)

    The direction to sort by: [desc, asc].

  • :sort_name (MonthlyUsageAttributionSupportedMetrics)

    The field to sort by.

  • :tag_breakdown_keys (String)

    Comma separated list of tag keys used to group usage. If no value is provided the usage will not be broken down by tags. To see which tags are available, look for the value of tag_config_source in the API response.

  • :next_record_id (String)

    List following results with a next_record_id provided in the previous query.

  • :include_descendants (Boolean)

    Include child org usage in the response. Defaults to true.

Returns:



454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 454

def get_monthly_usage_attribution_with_http_info(start_month, fields, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_monthly_usage_attribution)
    unstable_enabled = @api_client.config.unstable_operations[:get_monthly_usage_attribution]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_monthly_usage_attribution")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_monthly_usage_attribution"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_monthly_usage_attribution ...'
  end
  # verify the required parameter 'start_month' is set
  if @api_client.config.client_side_validation && start_month.nil?
    fail ArgumentError, "Missing the required parameter 'start_month' when calling UsageMeteringAPI.get_monthly_usage_attribution"
  end
  # verify the required parameter 'fields' is set
  if @api_client.config.client_side_validation && fields.nil?
    fail ArgumentError, "Missing the required parameter 'fields' when calling UsageMeteringAPI.get_monthly_usage_attribution"
  end
  # resource path
  local_var_path = '/api/v1/usage/monthly-attribution'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_month'] = start_month
  query_params[:'fields'] = fields
  query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil?
  query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
  query_params[:'sort_name'] = opts[:'sort_name'] if !opts[:'sort_name'].nil?
  query_params[:'tag_breakdown_keys'] = opts[:'tag_breakdown_keys'] if !opts[:'tag_breakdown_keys'].nil?
  query_params[:'next_record_id'] = opts[:'next_record_id'] if !opts[:'next_record_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MonthlyUsageAttributionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_monthly_usage_attribution,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_monthly_usage_attribution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_specified_daily_custom_reports(report_id, opts = {}) ⇒ Object

Get specified daily custom reports.



528
529
530
531
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 528

def get_specified_daily_custom_reports(report_id, opts = {})
  data, _status_code, _headers = get_specified_daily_custom_reports_with_http_info(report_id, opts)
  data
end

#get_specified_daily_custom_reports_with_http_info(report_id, opts = {}) ⇒ Array<(UsageSpecifiedCustomReportsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get specified daily custom reports.

Get specified daily custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Parameters:

  • report_id (String)

    Date of the report in the format YYYY-MM-DD.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 538

def get_specified_daily_custom_reports_with_http_info(report_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_specified_daily_custom_reports)
    unstable_enabled = @api_client.config.unstable_operations[:get_specified_daily_custom_reports]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_specified_daily_custom_reports")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_specified_daily_custom_reports"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_specified_daily_custom_reports ...'
  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 UsageMeteringAPI.get_specified_daily_custom_reports"
  end
  # resource path
  local_var_path = '/api/v1/daily_custom_reports/{report_id}'.sub('{' + 'report_id' + '}', CGI.escape(report_id.to_s))

  # 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;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSpecifiedCustomReportsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_specified_daily_custom_reports,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_specified_daily_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_specified_monthly_custom_reports(report_id, opts = {}) ⇒ Object

Get specified monthly custom reports.



601
602
603
604
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 601

def get_specified_monthly_custom_reports(report_id, opts = {})
  data, _status_code, _headers = get_specified_monthly_custom_reports_with_http_info(report_id, opts)
  data
end

#get_specified_monthly_custom_reports_with_http_info(report_id, opts = {}) ⇒ Array<(UsageSpecifiedCustomReportsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get specified monthly custom reports.

Get specified monthly custom reports. Note: This endpoint will be fully deprecated on December 1, 2022. Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.

Parameters:

  • report_id (String)

    Date of the report in the format YYYY-MM-DD.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 611

def get_specified_monthly_custom_reports_with_http_info(report_id, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_specified_monthly_custom_reports)
    unstable_enabled = @api_client.config.unstable_operations[:get_specified_monthly_custom_reports]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_specified_monthly_custom_reports")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_specified_monthly_custom_reports"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_specified_monthly_custom_reports ...'
  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 UsageMeteringAPI.get_specified_monthly_custom_reports"
  end
  # resource path
  local_var_path = '/api/v1/monthly_custom_reports/{report_id}'.sub('{' + 'report_id' + '}', CGI.escape(report_id.to_s))

  # 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;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSpecifiedCustomReportsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_specified_monthly_custom_reports,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_specified_monthly_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_analyzed_logs(start_hr, opts = {}) ⇒ Object

Get hourly usage for analyzed logs.



675
676
677
678
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 675

def get_usage_analyzed_logs(start_hr, opts = {})
  data, _status_code, _headers = get_usage_analyzed_logs_with_http_info(start_hr, opts)
  data
end

#get_usage_analyzed_logs_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageAnalyzedLogsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for analyzed logs.

Get hourly usage for analyzed logs (Security Monitoring). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageAnalyzedLogsResponse, Integer, Hash)>)

    UsageAnalyzedLogsResponse data, response status code and response headers



686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 686

def get_usage_analyzed_logs_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_analyzed_logs)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_analyzed_logs]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_analyzed_logs")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_analyzed_logs"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_analyzed_logs ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_analyzed_logs"
  end
  # resource path
  local_var_path = '/api/v1/usage/analyzed_logs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageAnalyzedLogsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_analyzed_logs,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_analyzed_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_attribution(start_month, fields, opts = {}) ⇒ UsageAttributionResponse

Get Usage Attribution Get Usage Attribution.

Parameters:

  • start_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago.

  • fields (UsageAttributionSupportedMetrics)

    Comma-separated list of usage types to return, or `*` for all usage types.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month.

  • :sort_direction (UsageSortDirection)

    The direction to sort by: `[desc, asc]`. (default to 'desc')

  • :sort_name (UsageAttributionSort)

    The field to sort by. (default to 'custom_timeseries_usage')

  • :include_descendants (Boolean)

    Include child org usage in the response. Defaults to false. (default to false)

  • :offset (Integer)

    Number of records to skip before beginning to return. (default to 0)

  • :limit (Integer)

    Maximum number of records to be returned. (default to 5000)

Returns:



758
759
760
761
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 758

def get_usage_attribution(start_month, fields, opts = {})
  data, _status_code, _headers = get_usage_attribution_with_http_info(start_month, fields, opts)
  data
end

#get_usage_attribution_with_http_info(start_month, fields, opts = {}) ⇒ Array<(UsageAttributionResponse, Integer, Hash)>

Get Usage Attribution Get Usage Attribution.

Parameters:

  • start_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage beginning in this month. Maximum of 15 months ago.

  • fields (UsageAttributionSupportedMetrics)

    Comma-separated list of usage types to return, or `*` for all usage types.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month.

  • :sort_direction (UsageSortDirection)

    The direction to sort by: `[desc, asc]`.

  • :sort_name (UsageAttributionSort)

    The field to sort by.

  • :include_descendants (Boolean)

    Include child org usage in the response. Defaults to false.

  • :offset (Integer)

    Number of records to skip before beginning to return.

  • :limit (Integer)

    Maximum number of records to be returned.

Returns:

  • (Array<(UsageAttributionResponse, Integer, Hash)>)

    UsageAttributionResponse data, response status code and response headers



775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 775

def get_usage_attribution_with_http_info(start_month, fields, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_attribution)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_attribution]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_attribution")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_attribution"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_attribution ...'
  end
  # verify the required parameter 'start_month' is set
  if @api_client.config.client_side_validation && start_month.nil?
    fail ArgumentError, "Missing the required parameter 'start_month' when calling UsageMeteringAPI.get_usage_attribution"
  end
  # verify the required parameter 'fields' is set
  if @api_client.config.client_side_validation && fields.nil?
    fail ArgumentError, "Missing the required parameter 'fields' when calling UsageMeteringAPI.get_usage_attribution"
  end
  # resource path
  local_var_path = '/api/v1/usage/attribution'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_month'] = start_month
  query_params[:'fields'] = fields
  query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil?
  query_params[:'sort_direction'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
  query_params[:'sort_name'] = opts[:'sort_name'] if !opts[:'sort_name'].nil?
  query_params[:'include_descendants'] = opts[:'include_descendants'] if !opts[:'include_descendants'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageAttributionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_attribution,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_attribution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_audit_logs(start_hr, opts = {}) ⇒ Object

Get hourly usage for audit logs.



851
852
853
854
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 851

def get_usage_audit_logs(start_hr, opts = {})
  data, _status_code, _headers = get_usage_audit_logs_with_http_info(start_hr, opts)
  data
end

#get_usage_audit_logs_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageAuditLogsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for audit logs.

Get hourly usage for audit logs. Note: This endpoint has been deprecated.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageAuditLogsResponse, Integer, Hash)>)

    UsageAuditLogsResponse data, response status code and response headers



862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 862

def get_usage_audit_logs_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_audit_logs)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_audit_logs]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_audit_logs")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_audit_logs"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_audit_logs ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_audit_logs"
  end
  # resource path
  local_var_path = '/api/v1/usage/audit_logs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageAuditLogsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_audit_logs,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_audit_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_billable_summary(opts = {}) ⇒ Object

Get billable usage across your account.



927
928
929
930
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 927

def get_usage_billable_summary(opts = {})
  data, _status_code, _headers = get_usage_billable_summary_with_http_info(opts)
  data
end

#get_usage_billable_summary_with_http_info(opts = {}) ⇒ Array<(UsageBillableSummaryResponse, Integer, Hash)>

Get billable usage across your account.

Get billable usage across your account.

This endpoint is only accessible for parent-level organizations.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage starting this month.

  • :include_connected_accounts (Boolean)

    Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to false.

Returns:



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 937

def get_usage_billable_summary_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_billable_summary)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_billable_summary]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_billable_summary")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_billable_summary"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_billable_summary ...'
  end
  # resource path
  local_var_path = '/api/v1/usage/billable-summary'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'month'] = opts[:'month'] if !opts[:'month'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageBillableSummaryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_billable_summary,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_billable_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_ci_app(start_hr, opts = {}) ⇒ Object

Get hourly usage for CI visibility.



895
896
897
898
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 895

def get_usage_ci_app(start_hr, opts = {})
  data, _status_code, _headers = get_usage_ci_app_with_http_info(start_hr, opts)
  data
end

#get_usage_ci_app_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageCIVisibilityResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for CI visibility.

Get hourly usage for CI visibility (tests, pipeline, and spans). Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageCIVisibilityResponse, Integer, Hash)>)

    UsageCIVisibilityResponse data, response status code and response headers



911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 911

def get_usage_ci_app_with_http_info(start_hr, opts = {})
  warn "[DEPRECATION] `GetUsageCIApp` is deprecated."

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_ci_app ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_ci_app"
  end
  # resource path
  local_var_path = '/api/v1/usage/ci-app'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageCIVisibilityResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_usage_ci_app,
    :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 => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_ci_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_cloud_security_posture_management(start_hr, opts = {}) ⇒ Object

Get hourly usage for CSM Pro.



998
999
1000
1001
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 998

def get_usage_cloud_security_posture_management(start_hr, opts = {})
  data, _status_code, _headers = get_usage_cloud_security_posture_management_with_http_info(start_hr, opts)
  data
end

#get_usage_cloud_security_posture_management_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageCloudSecurityPostureManagementResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for CSM Pro.

Get hourly usage for cloud security management (CSM) pro. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:



1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1009

def get_usage_cloud_security_posture_management_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_cloud_security_posture_management)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_cloud_security_posture_management]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_cloud_security_posture_management")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_cloud_security_posture_management"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_cloud_security_posture_management ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_cloud_security_posture_management"
  end
  # resource path
  local_var_path = '/api/v1/usage/cspm'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageCloudSecurityPostureManagementResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_cloud_security_posture_management,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_cloud_security_posture_management\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_cws(start_hr, opts = {}) ⇒ Object

Get hourly usage for cloud workload security.



1075
1076
1077
1078
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1075

def get_usage_cws(start_hr, opts = {})
  data, _status_code, _headers = get_usage_cws_with_http_info(start_hr, opts)
  data
end

#get_usage_cws_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageCWSResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for cloud workload security.

Get hourly usage for cloud workload security. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageCWSResponse, Integer, Hash)>)

    UsageCWSResponse data, response status code and response headers



1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1086

def get_usage_cws_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_cws)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_cws]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_cws")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_cws"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_cws ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_cws"
  end
  # resource path
  local_var_path = '/api/v1/usage/cws'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageCWSResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_cws,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_cws\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_dbm(start_hr, opts = {}) ⇒ Object

Get hourly usage for database monitoring.



1152
1153
1154
1155
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1152

def get_usage_dbm(start_hr, opts = {})
  data, _status_code, _headers = get_usage_dbm_with_http_info(start_hr, opts)
  data
end

#get_usage_dbm_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageDBMResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for database monitoring.

Get hourly usage for database monitoring Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageDBMResponse, Integer, Hash)>)

    UsageDBMResponse data, response status code and response headers



1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1163

def get_usage_dbm_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_dbm)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_dbm]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_dbm")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_dbm"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_dbm ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_dbm"
  end
  # resource path
  local_var_path = '/api/v1/usage/dbm'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageDBMResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_dbm,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_dbm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_fargate(start_hr, opts = {}) ⇒ Object

Get hourly usage for Fargate.



1229
1230
1231
1232
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1229

def get_usage_fargate(start_hr, opts = {})
  data, _status_code, _headers = get_usage_fargate_with_http_info(start_hr, opts)
  data
end

#get_usage_fargate_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageFargateResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for Fargate.

Get hourly usage for Fargate. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageFargateResponse, Integer, Hash)>)

    UsageFargateResponse data, response status code and response headers



1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1240

def get_usage_fargate_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_fargate)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_fargate]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_fargate")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_fargate"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_fargate ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_fargate"
  end
  # resource path
  local_var_path = '/api/v1/usage/fargate'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageFargateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_fargate,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_fargate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_hosts(start_hr, opts = {}) ⇒ Object

Get hourly usage for hosts and containers.



1306
1307
1308
1309
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1306

def get_usage_hosts(start_hr, opts = {})
  data, _status_code, _headers = get_usage_hosts_with_http_info(start_hr, opts)
  data
end

#get_usage_hosts_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageHostsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for hosts and containers.

Get hourly usage for hosts and containers. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageHostsResponse, Integer, Hash)>)

    UsageHostsResponse data, response status code and response headers



1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1317

def get_usage_hosts_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_hosts)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_hosts]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_hosts")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_hosts"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_hosts ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_hosts"
  end
  # resource path
  local_var_path = '/api/v1/usage/hosts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageHostsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_hosts,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_indexed_spans(start_hr, opts = {}) ⇒ Object

Get hourly usage for indexed spans.



1383
1384
1385
1386
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1383

def get_usage_indexed_spans(start_hr, opts = {})
  data, _status_code, _headers = get_usage_indexed_spans_with_http_info(start_hr, opts)
  data
end

#get_usage_indexed_spans_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageIndexedSpansResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for indexed spans.

Get hourly usage for indexed spans. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageIndexedSpansResponse, Integer, Hash)>)

    UsageIndexedSpansResponse data, response status code and response headers



1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1394

def get_usage_indexed_spans_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_indexed_spans)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_indexed_spans]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_indexed_spans")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_indexed_spans"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_indexed_spans ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_indexed_spans"
  end
  # resource path
  local_var_path = '/api/v1/usage/indexed-spans'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageIndexedSpansResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_indexed_spans,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_indexed_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_internet_of_things(start_hr, opts = {}) ⇒ Object

Get hourly usage for IoT.



1460
1461
1462
1463
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1460

def get_usage_internet_of_things(start_hr, opts = {})
  data, _status_code, _headers = get_usage_internet_of_things_with_http_info(start_hr, opts)
  data
end

#get_usage_internet_of_things_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageIoTResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for IoT.

Get hourly usage for IoT. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageIoTResponse, Integer, Hash)>)

    UsageIoTResponse data, response status code and response headers



1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1471

def get_usage_internet_of_things_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_internet_of_things)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_internet_of_things]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_internet_of_things")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_internet_of_things"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_internet_of_things ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_internet_of_things"
  end
  # resource path
  local_var_path = '/api/v1/usage/iot'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageIoTResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_internet_of_things,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_internet_of_things\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_lambda(start_hr, opts = {}) ⇒ Object

Get hourly usage for Lambda.



1537
1538
1539
1540
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1537

def get_usage_lambda(start_hr, opts = {})
  data, _status_code, _headers = get_usage_lambda_with_http_info(start_hr, opts)
  data
end

#get_usage_lambda_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageLambdaResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for Lambda.

Get hourly usage for Lambda. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageLambdaResponse, Integer, Hash)>)

    UsageLambdaResponse data, response status code and response headers



1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1548

def get_usage_lambda_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_lambda)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_lambda]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_lambda")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_lambda"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_lambda ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_lambda"
  end
  # resource path
  local_var_path = '/api/v1/usage/aws_lambda'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageLambdaResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_lambda,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_lambda\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_logs(start_hr, opts = {}) ⇒ Object

Get hourly usage for logs.



1614
1615
1616
1617
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1614

def get_usage_logs(start_hr, opts = {})
  data, _status_code, _headers = get_usage_logs_with_http_info(start_hr, opts)
  data
end

#get_usage_logs_by_index(start_hr, opts = {}) ⇒ Object

Get hourly usage for logs by index.



1692
1693
1694
1695
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1692

def get_usage_logs_by_index(start_hr, opts = {})
  data, _status_code, _headers = get_usage_logs_by_index_with_http_info(start_hr, opts)
  data
end

#get_usage_logs_by_index_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageLogsByIndexResponse, Integer, Hash)>

Get hourly usage for logs by index.

Get hourly usage for logs by index.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

  • :index_name (Array<String>)

    Comma-separated list of log index names.

Returns:

  • (Array<(UsageLogsByIndexResponse, Integer, Hash)>)

    UsageLogsByIndexResponse data, response status code and response headers



1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1704

def get_usage_logs_by_index_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_logs_by_index)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_logs_by_index]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_logs_by_index")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_logs_by_index"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_logs_by_index ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_logs_by_index"
  end
  # resource path
  local_var_path = '/api/v1/usage/logs_by_index'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?
  query_params[:'index_name'] = @api_client.build_collection_param(opts[:'index_name'], :multi) if !opts[:'index_name'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageLogsByIndexResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_logs_by_index,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_logs_by_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_logs_by_retention(start_hr, opts = {}) ⇒ Object

Get hourly logs usage by retention.



1771
1772
1773
1774
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1771

def get_usage_logs_by_retention(start_hr, opts = {})
  data, _status_code, _headers = get_usage_logs_by_retention_with_http_info(start_hr, opts)
  data
end

#get_usage_logs_by_retention_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageLogsByRetentionResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly logs usage by retention.

Get hourly usage for indexed logs by retention period. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:



1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1782

def get_usage_logs_by_retention_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_logs_by_retention)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_logs_by_retention]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_logs_by_retention")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_logs_by_retention"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_logs_by_retention ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_logs_by_retention"
  end
  # resource path
  local_var_path = '/api/v1/usage/logs-by-retention'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageLogsByRetentionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_logs_by_retention,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_logs_by_retention\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_logs_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageLogsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for logs.

Get hourly usage for logs. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageLogsResponse, Integer, Hash)>)

    UsageLogsResponse data, response status code and response headers



1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1625

def get_usage_logs_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_logs)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_logs]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_logs")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_logs"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_logs ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_logs"
  end
  # resource path
  local_var_path = '/api/v1/usage/logs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageLogsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_logs,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_network_flows(start_hr, opts = {}) ⇒ Object

get hourly usage for network flows.



1848
1849
1850
1851
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1848

def get_usage_network_flows(start_hr, opts = {})
  data, _status_code, _headers = get_usage_network_flows_with_http_info(start_hr, opts)
  data
end

#get_usage_network_flows_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageNetworkFlowsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

get hourly usage for network flows.

Get hourly usage for network flows. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageNetworkFlowsResponse, Integer, Hash)>)

    UsageNetworkFlowsResponse data, response status code and response headers



1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1859

def get_usage_network_flows_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_network_flows)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_network_flows]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_network_flows")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_network_flows"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_network_flows ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_network_flows"
  end
  # resource path
  local_var_path = '/api/v1/usage/network_flows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageNetworkFlowsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_network_flows,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_network_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_network_hosts(start_hr, opts = {}) ⇒ Object

Get hourly usage for network hosts.



1925
1926
1927
1928
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1925

def get_usage_network_hosts(start_hr, opts = {})
  data, _status_code, _headers = get_usage_network_hosts_with_http_info(start_hr, opts)
  data
end

#get_usage_network_hosts_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageNetworkHostsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for network hosts.

Get hourly usage for network hosts. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageNetworkHostsResponse, Integer, Hash)>)

    UsageNetworkHostsResponse data, response status code and response headers



1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1936

def get_usage_network_hosts_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_network_hosts)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_network_hosts]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_network_hosts")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_network_hosts"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_network_hosts ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_network_hosts"
  end
  # resource path
  local_var_path = '/api/v1/usage/network_hosts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageNetworkHostsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_network_hosts,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_network_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_online_archive(start_hr, opts = {}) ⇒ Object

Get hourly usage for online archive.



1902
1903
1904
1905
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1902

def get_usage_online_archive(start_hr, opts = {})
  data, _status_code, _headers = get_usage_online_archive_with_http_info(start_hr, opts)
  data
end

#get_usage_online_archive_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageOnlineArchiveResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for online archive.

Get hourly usage for online archive. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageOnlineArchiveResponse, Integer, Hash)>)

    UsageOnlineArchiveResponse data, response status code and response headers



1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 1918

def get_usage_online_archive_with_http_info(start_hr, opts = {})
  warn "[DEPRECATION] `GetUsageOnlineArchive` is deprecated."

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_online_archive ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_online_archive"
  end
  # resource path
  local_var_path = '/api/v1/usage/online-archive'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageOnlineArchiveResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_usage_online_archive,
    :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 => "V1"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_online_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_profiling(start_hr, opts = {}) ⇒ Object

Get hourly usage for profiled hosts.



2002
2003
2004
2005
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2002

def get_usage_profiling(start_hr, opts = {})
  data, _status_code, _headers = get_usage_profiling_with_http_info(start_hr, opts)
  data
end

#get_usage_profiling_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageProfilingResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for profiled hosts.

Get hourly usage for profiled hosts. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageProfilingResponse, Integer, Hash)>)

    UsageProfilingResponse data, response status code and response headers



2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2013

def get_usage_profiling_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_profiling)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_profiling]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_profiling")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_profiling"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_profiling ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_profiling"
  end
  # resource path
  local_var_path = '/api/v1/usage/profiling'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageProfilingResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_profiling,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_profiling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_rum_sessions(start_hr, opts = {}) ⇒ Object

Get hourly usage for RUM sessions.



2080
2081
2082
2083
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2080

def get_usage_rum_sessions(start_hr, opts = {})
  data, _status_code, _headers = get_usage_rum_sessions_with_http_info(start_hr, opts)
  data
end

#get_usage_rum_sessions_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageRumSessionsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for RUM sessions.

Get hourly usage for RUM Sessions. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

  • :type (String)

    RUM type: [browser, mobile]. Defaults to browser.

Returns:

  • (Array<(UsageRumSessionsResponse, Integer, Hash)>)

    UsageRumSessionsResponse data, response status code and response headers



2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2092

def get_usage_rum_sessions_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_rum_sessions)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_rum_sessions]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_rum_sessions")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_rum_sessions"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_sessions ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_sessions"
  end
  # resource path
  local_var_path = '/api/v1/usage/rum_sessions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageRumSessionsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_rum_sessions,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_rum_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_rum_units(start_hr, opts = {}) ⇒ Object

Get hourly usage for RUM units.



2159
2160
2161
2162
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2159

def get_usage_rum_units(start_hr, opts = {})
  data, _status_code, _headers = get_usage_rum_units_with_http_info(start_hr, opts)
  data
end

#get_usage_rum_units_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageRumUnitsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for RUM units.

Get hourly usage for RUM Units. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageRumUnitsResponse, Integer, Hash)>)

    UsageRumUnitsResponse data, response status code and response headers



2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2170

def get_usage_rum_units_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_rum_units)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_rum_units]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_rum_units")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_rum_units"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_rum_units ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_rum_units"
  end
  # resource path
  local_var_path = '/api/v1/usage/rum'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageRumUnitsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_rum_units,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_rum_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_sds(start_hr, opts = {}) ⇒ Object

Get hourly usage for sensitive data scanner.



2236
2237
2238
2239
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2236

def get_usage_sds(start_hr, opts = {})
  data, _status_code, _headers = get_usage_sds_with_http_info(start_hr, opts)
  data
end

#get_usage_sds_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageSDSResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for sensitive data scanner.

Get hourly usage for sensitive data scanner. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageSDSResponse, Integer, Hash)>)

    UsageSDSResponse data, response status code and response headers



2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2247

def get_usage_sds_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_sds)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_sds]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_sds")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_sds"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_sds ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_sds"
  end
  # resource path
  local_var_path = '/api/v1/usage/sds'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSDSResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_sds,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_sds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_snmp(start_hr, opts = {}) ⇒ Object

Get hourly usage for SNMP devices.



2313
2314
2315
2316
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2313

def get_usage_snmp(start_hr, opts = {})
  data, _status_code, _headers = get_usage_snmp_with_http_info(start_hr, opts)
  data
end

#get_usage_snmp_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageSNMPResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for SNMP devices.

Get hourly usage for SNMP devices. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageSNMPResponse, Integer, Hash)>)

    UsageSNMPResponse data, response status code and response headers



2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2324

def get_usage_snmp_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_snmp)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_snmp]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_snmp")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_snmp"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_snmp ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_snmp"
  end
  # resource path
  local_var_path = '/api/v1/usage/snmp'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSNMPResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_snmp,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_snmp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_summary(start_month, opts = {}) ⇒ Object

Get usage across your account.



2391
2392
2393
2394
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2391

def get_usage_summary(start_month, opts = {})
  data, _status_code, _headers = get_usage_summary_with_http_info(start_month, opts)
  data
end

#get_usage_summary_with_http_info(start_month, opts = {}) ⇒ Array<(UsageSummaryResponse, Integer, Hash)>

Get usage across your account.

Get all usage across your account.

This endpoint is only accessible for parent-level organizations.

Parameters:

  • start_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning in this month. Maximum of 15 months ago.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage ending this month.

  • :include_org_details (Boolean)

    Include usage summaries for each sub-org.

  • :include_connected_accounts (Boolean)

    Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to false.

Returns:

  • (Array<(UsageSummaryResponse, Integer, Hash)>)

    UsageSummaryResponse data, response status code and response headers



2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2403

def get_usage_summary_with_http_info(start_month, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_summary)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_summary]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_summary")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_summary"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_summary ...'
  end
  # verify the required parameter 'start_month' is set
  if @api_client.config.client_side_validation && start_month.nil?
    fail ArgumentError, "Missing the required parameter 'start_month' when calling UsageMeteringAPI.get_usage_summary"
  end
  # resource path
  local_var_path = '/api/v1/usage/summary'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_month'] = start_month
  query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil?
  query_params[:'include_org_details'] = opts[:'include_org_details'] if !opts[:'include_org_details'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSummaryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_summary,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_synthetics(start_hr, opts = {}) ⇒ Object

Get hourly usage for synthetics checks.



2470
2471
2472
2473
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2470

def get_usage_synthetics(start_hr, opts = {})
  data, _status_code, _headers = get_usage_synthetics_with_http_info(start_hr, opts)
  data
end

#get_usage_synthetics_api(start_hr, opts = {}) ⇒ Object

Get hourly usage for synthetics API checks.



2547
2548
2549
2550
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2547

def get_usage_synthetics_api(start_hr, opts = {})
  data, _status_code, _headers = get_usage_synthetics_api_with_http_info(start_hr, opts)
  data
end

#get_usage_synthetics_api_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageSyntheticsAPIResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for synthetics API checks.

Get hourly usage for synthetics API checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageSyntheticsAPIResponse, Integer, Hash)>)

    UsageSyntheticsAPIResponse data, response status code and response headers



2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2558

def get_usage_synthetics_api_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_synthetics_api)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_synthetics_api]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_synthetics_api")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_synthetics_api"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_synthetics_api ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_synthetics_api"
  end
  # resource path
  local_var_path = '/api/v1/usage/synthetics_api'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSyntheticsAPIResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_synthetics_api,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_synthetics_api\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_synthetics_browser(start_hr, opts = {}) ⇒ Object

Get hourly usage for synthetics browser checks.



2624
2625
2626
2627
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2624

def get_usage_synthetics_browser(start_hr, opts = {})
  data, _status_code, _headers = get_usage_synthetics_browser_with_http_info(start_hr, opts)
  data
end

#get_usage_synthetics_browser_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageSyntheticsBrowserResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for synthetics browser checks.

Get hourly usage for synthetics browser checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:



2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2635

def get_usage_synthetics_browser_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_synthetics_browser)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_synthetics_browser]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_synthetics_browser")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_synthetics_browser"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_synthetics_browser ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_synthetics_browser"
  end
  # resource path
  local_var_path = '/api/v1/usage/synthetics_browser'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSyntheticsBrowserResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_synthetics_browser,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_synthetics_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_synthetics_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageSyntheticsResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for synthetics checks.

Get hourly usage for synthetics checks. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageSyntheticsResponse, Integer, Hash)>)

    UsageSyntheticsResponse data, response status code and response headers



2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2481

def get_usage_synthetics_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_synthetics)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_synthetics]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_synthetics")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_synthetics"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_synthetics ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_synthetics"
  end
  # resource path
  local_var_path = '/api/v1/usage/synthetics'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageSyntheticsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_synthetics,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_synthetics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_timeseries(start_hr, opts = {}) ⇒ Object

Get hourly usage for custom metrics.



2701
2702
2703
2704
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2701

def get_usage_timeseries(start_hr, opts = {})
  data, _status_code, _headers = get_usage_timeseries_with_http_info(start_hr, opts)
  data
end

#get_usage_timeseries_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageTimeseriesResponse, Integer, Hash)>

Deprecated.

This API is deprecated.

Get hourly usage for custom metrics.

Get hourly usage for custom metrics. Note: This endpoint has been deprecated. Hourly usage data for all products is now available in the Get hourly usage by product family API. Refer to Migrating from the V1 Hourly Usage APIs to V2 for the associated migration guide.

Parameters:

  • start_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_hr (Time)

    Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending before this hour.

Returns:

  • (Array<(UsageTimeseriesResponse, Integer, Hash)>)

    UsageTimeseriesResponse data, response status code and response headers



2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2712

def get_usage_timeseries_with_http_info(start_hr, opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_timeseries)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_timeseries]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_timeseries")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_timeseries"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_timeseries ...'
  end
  # verify the required parameter 'start_hr' is set
  if @api_client.config.client_side_validation && start_hr.nil?
    fail ArgumentError, "Missing the required parameter 'start_hr' when calling UsageMeteringAPI.get_usage_timeseries"
  end
  # resource path
  local_var_path = '/api/v1/usage/timeseries'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_hr'] = start_hr
  query_params[:'end_hr'] = opts[:'end_hr'] if !opts[:'end_hr'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageTimeseriesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_timeseries,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_top_avg_metrics(opts = {}) ⇒ Object

Get all custom metrics by hourly average.



2781
2782
2783
2784
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2781

def get_usage_top_avg_metrics(opts = {})
  data, _status_code, _headers = get_usage_top_avg_metrics_with_http_info(opts)
  data
end

#get_usage_top_avg_metrics_with_http_info(opts = {}) ⇒ Array<(UsageTopAvgMetricsResponse, Integer, Hash)>

Get all custom metrics by hourly average.

Get all custom metrics by hourly average. Use the month parameter to get a month-to-date data resolution or use the day parameter to get a daily resolution. One of the two is required, and only one of the two is allowed.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :month (Time)

    Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for usage beginning at this hour. (Either month or day should be specified, but not both)

  • :day (Time)

    Datetime in ISO-8601 format, UTC, precise to day: [YYYY-MM-DD] for usage beginning at this hour. (Either month or day should be specified, but not both)

  • :names (Array<String>)

    Comma-separated list of metric names.

  • :limit (Integer)

    Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified.

  • :next_record_id (String)

    List following results with a next_record_id provided in the previous query.

Returns:

  • (Array<(UsageTopAvgMetricsResponse, Integer, Hash)>)

    UsageTopAvgMetricsResponse data, response status code and response headers



2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
# File 'lib/datadog_api_client/v1/api/usage_metering_api.rb', line 2795

def get_usage_top_avg_metrics_with_http_info(opts = {})

  if @api_client.config.unstable_operations.has_key?(:get_usage_top_avg_metrics)
    unstable_enabled = @api_client.config.unstable_operations[:get_usage_top_avg_metrics]
    if unstable_enabled
      @api_client.config.logger.warn format("Using unstable operation '%s'", "get_usage_top_avg_metrics")
    else
      raise APIError.new(message: format("Unstable operation '%s' is disabled", "get_usage_top_avg_metrics"))
    end
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_top_avg_metrics ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsageMeteringAPI.get_usage_top_avg_metrics, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling UsageMeteringAPI.get_usage_top_avg_metrics, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/v1/usage/top_avg_metrics'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'month'] = opts[:'month'] if !opts[:'month'].nil?
  query_params[:'day'] = opts[:'day'] if !opts[:'day'].nil?
  query_params[:'names'] = @api_client.build_collection_param(opts[:'names'], :multi) if !opts[:'names'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'next_record_id'] = opts[:'next_record_id'] if !opts[:'next_record_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json;datetime-format=rfc3339'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsageTopAvgMetricsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:AuthZ, :apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_usage_top_avg_metrics,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_top_avg_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end