Class: DatadogAPIClient::V2::UsageMeteringAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::UsageMeteringAPI
- Defined in:
- lib/datadog_api_client/v2/api/usage_metering_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_cost_by_org(start_month, opts = {}) ⇒ Object
Get cost across multi-org account.
-
#get_cost_by_org_with_http_info(start_month, opts = {}) ⇒ Array<(CostByOrgResponse, Integer, Hash)>
deprecated
Deprecated.
This API is deprecated.
-
#get_estimated_cost_by_org(opts = {}) ⇒ Object
Get estimated cost across your account.
-
#get_estimated_cost_by_org_with_http_info(opts = {}) ⇒ Array<(CostByOrgResponse, Integer, Hash)>
Get estimated cost across your account.
-
#get_historical_cost_by_org(start_month, opts = {}) ⇒ Object
Get historical cost across your account.
-
#get_historical_cost_by_org_with_http_info(start_month, opts = {}) ⇒ Array<(CostByOrgResponse, Integer, Hash)>
Get historical cost across your account.
-
#get_hourly_usage(filter_timestamp_start, filter_product_families, opts = {}) ⇒ Object
Get hourly usage by product family.
-
#get_hourly_usage_with_http_info(filter_timestamp_start, filter_product_families, opts = {}) ⇒ Array<(HourlyUsageResponse, Integer, Hash)>
Get hourly usage by product family.
-
#get_usage_application_security_monitoring(start_hr, opts = {}) ⇒ Object
Get hourly usage for application security.
-
#get_usage_application_security_monitoring_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageApplicationSecurityMonitoringResponse, Integer, Hash)>
Get hourly usage for application security.
-
#get_usage_lambda_traced_invocations(start_hr, opts = {}) ⇒ Object
Get hourly usage for lambda traced invocations.
-
#get_usage_lambda_traced_invocations_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageLambdaTracedInvocationsResponse, Integer, Hash)>
Get hourly usage for lambda traced invocations.
-
#get_usage_observability_pipelines(start_hr, opts = {}) ⇒ Object
Get hourly usage for observability pipelines.
-
#get_usage_observability_pipelines_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageObservabilityPipelinesResponse, Integer, Hash)>
Get hourly usage for observability pipelines.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ UsageMeteringAPI
constructor
A new instance of UsageMeteringAPI.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ UsageMeteringAPI
Returns a new instance of UsageMeteringAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#get_cost_by_org(start_month, opts = {}) ⇒ Object
Get cost across multi-org account.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 29 def get_cost_by_org(start_month, opts = {}) data, _status_code, _headers = get_cost_by_org_with_http_info(start_month, opts) data end |
#get_cost_by_org_with_http_info(start_month, opts = {}) ⇒ Array<(CostByOrgResponse, Integer, Hash)>
This API is deprecated.
Get cost across multi-org account.
Get cost across multi-org account. Cost by org data for a given month becomes available no later than the 16th of the following month. Note: This endpoint has been deprecated. Please use the new endpoint [/historical_cost](docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account) instead.
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 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 48 def get_cost_by_org_with_http_info(start_month, opts = {}) warn "[DEPRECATION] `GetCostByOrg` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_cost_by_org ...' 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_cost_by_org" end # resource path local_var_path = '/api/v2/usage/cost_by_org' # 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? # 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] || 'CostByOrgResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_cost_by_org, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_cost_by_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_estimated_cost_by_org(opts = {}) ⇒ Object
Get estimated cost across your account.
104 105 106 107 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 104 def get_estimated_cost_by_org(opts = {}) data, _status_code, _headers = get_estimated_cost_by_org_with_http_info(opts) data end |
#get_estimated_cost_by_org_with_http_info(opts = {}) ⇒ Array<(CostByOrgResponse, Integer, Hash)>
Get estimated cost across your account.
Get estimated cost across multi-org and single root-org accounts. Estimated cost data is only available for the current month and previous month and is delayed by up to 72 hours from when it was incurred. To access historical costs prior to this, use the /historical_cost endpoint.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 123 def get_estimated_cost_by_org_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_estimated_cost_by_org ...' end # resource path local_var_path = '/api/v2/usage/estimated_cost' # query parameters query_params = opts[:query_params] || {} query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil? query_params[:'start_month'] = opts[:'start_month'] if !opts[:'start_month'].nil? query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil? query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].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] || 'CostByOrgResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_estimated_cost_by_org, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_estimated_cost_by_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_historical_cost_by_org(start_month, opts = {}) ⇒ Object
Get historical cost across your account.
177 178 179 180 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 177 def get_historical_cost_by_org(start_month, opts = {}) data, _status_code, _headers = get_historical_cost_by_org_with_http_info(start_month, opts) data end |
#get_historical_cost_by_org_with_http_info(start_month, opts = {}) ⇒ Array<(CostByOrgResponse, Integer, Hash)>
Get historical cost across your account.
Get historical cost across multi-org and single root-org accounts. Cost data for a given month becomes available no later than the 16th of the following month.
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 192 def get_historical_cost_by_org_with_http_info(start_month, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_historical_cost_by_org ...' 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_historical_cost_by_org" end # resource path local_var_path = '/api/v2/usage/historical_cost' # query parameters query_params = opts[:query_params] || {} query_params[:'start_month'] = start_month query_params[:'view'] = opts[:'view'] if !opts[:'view'].nil? query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_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] || 'CostByOrgResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_historical_cost_by_org, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_historical_cost_by_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_hourly_usage(filter_timestamp_start, filter_product_families, opts = {}) ⇒ Object
Get hourly usage by product family.
248 249 250 251 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 248 def get_hourly_usage(, filter_product_families, opts = {}) data, _status_code, _headers = get_hourly_usage_with_http_info(, filter_product_families, opts) data end |
#get_hourly_usage_with_http_info(filter_timestamp_start, filter_product_families, opts = {}) ⇒ Array<(HourlyUsageResponse, Integer, Hash)>
Get hourly usage by product family.
Get hourly usage by product family.
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 266 def get_hourly_usage_with_http_info(, filter_product_families, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_hourly_usage ...' end # verify the required parameter 'filter_timestamp_start' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'filter_timestamp_start' when calling UsageMeteringAPI.get_hourly_usage" end # verify the required parameter 'filter_product_families' is set if @api_client.config.client_side_validation && filter_product_families.nil? fail ArgumentError, "Missing the required parameter 'filter_product_families' when calling UsageMeteringAPI.get_hourly_usage" end if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling UsageMeteringAPI.get_hourly_usage, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"page_limit"]" when calling UsageMeteringAPI.get_hourly_usage, must be greater than or equal to 1.' end # resource path local_var_path = '/api/v2/usage/hourly_usage' # query parameters query_params = opts[:query_params] || {} query_params[:'filter[timestamp][start]'] = query_params[:'filter[product_families]'] = filter_product_families query_params[:'filter[timestamp][end]'] = opts[:'filter_timestamp_end'] if !opts[:'filter_timestamp_end'].nil? query_params[:'filter[include_descendants]'] = opts[:'filter_include_descendants'] if !opts[:'filter_include_descendants'].nil? query_params[:'filter[versions]'] = opts[:'filter_versions'] if !opts[:'filter_versions'].nil? query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? query_params[:'page[next_record_id]'] = opts[:'page_next_record_id'] if !opts[:'page_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] || 'HourlyUsageResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_hourly_usage, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_hourly_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_usage_application_security_monitoring(start_hr, opts = {}) ⇒ Object
Get hourly usage for application security.
336 337 338 339 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 336 def get_usage_application_security_monitoring(start_hr, opts = {}) data, _status_code, _headers = get_usage_application_security_monitoring_with_http_info(start_hr, opts) data end |
#get_usage_application_security_monitoring_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageApplicationSecurityMonitoringResponse, Integer, Hash)>
Get hourly usage for application security.
Get hourly usage for application security . Note: hourly usage data for all products is now available in the [Get hourly usage by product family API](docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 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 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 350 def get_usage_application_security_monitoring_with_http_info(start_hr, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_application_security_monitoring ...' 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_application_security_monitoring" end # resource path local_var_path = '/api/v2/usage/application_security' # 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] || 'UsageApplicationSecurityMonitoringResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_usage_application_security_monitoring, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_application_security_monitoring\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_usage_lambda_traced_invocations(start_hr, opts = {}) ⇒ Object
Get hourly usage for lambda traced invocations.
405 406 407 408 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 405 def get_usage_lambda_traced_invocations(start_hr, opts = {}) data, _status_code, _headers = get_usage_lambda_traced_invocations_with_http_info(start_hr, opts) data end |
#get_usage_lambda_traced_invocations_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageLambdaTracedInvocationsResponse, Integer, Hash)>
Get hourly usage for lambda traced invocations.
Get hourly usage for lambda traced invocations. Note: hourly usage data for all products is now available in the [Get hourly usage by product family API](docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 419 def get_usage_lambda_traced_invocations_with_http_info(start_hr, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_lambda_traced_invocations ...' 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_traced_invocations" end # resource path local_var_path = '/api/v2/usage/lambda_traced_invocations' # 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] || 'UsageLambdaTracedInvocationsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_usage_lambda_traced_invocations, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_lambda_traced_invocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_usage_observability_pipelines(start_hr, opts = {}) ⇒ Object
Get hourly usage for observability pipelines.
474 475 476 477 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 474 def get_usage_observability_pipelines(start_hr, opts = {}) data, _status_code, _headers = get_usage_observability_pipelines_with_http_info(start_hr, opts) data end |
#get_usage_observability_pipelines_with_http_info(start_hr, opts = {}) ⇒ Array<(UsageObservabilityPipelinesResponse, Integer, Hash)>
Get hourly usage for observability pipelines.
Get hourly usage for observability pipelines. Note: hourly usage data for all products is now available in the [Get hourly usage by product family API](docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)
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 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
# File 'lib/datadog_api_client/v2/api/usage_metering_api.rb', line 488 def get_usage_observability_pipelines_with_http_info(start_hr, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_usage_observability_pipelines ...' 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_observability_pipelines" end # resource path local_var_path = '/api/v2/usage/observability_pipelines' # 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] || 'UsageObservabilityPipelinesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_usage_observability_pipelines, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageMeteringAPI#get_usage_observability_pipelines\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |