=begin #Datadog API V1 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'cgi' module DatadogAPIClient::V1 class UsageMeteringAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Get the list of available daily custom reports. # # @see #get_daily_custom_reports_with_http_info def get_daily_custom_reports(opts = {}) data, _status_code, _headers = get_daily_custom_reports_with_http_info(opts) data end # 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](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size The number of files to return in the response. `[default=60]`. # @option opts [Integer] :page_number The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`. # @option opts [UsageSortDirection] :sort_dir The direction to sort by: `[desc, asc]`. # @option opts [UsageSort] :sort The field to sort by: `[computed_on, size, start_date, end_date]`. # @return [Array<(UsageCustomReportsResponse, Integer, Hash)>] UsageCustomReportsResponse data, response status code and response headers def get_daily_custom_reports_with_http_info(opts = {}) warn "[DEPRECATION] `GetDailyCustomReports` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_daily_custom_reports ...' end allowable_values = ['desc', 'asc'] if @api_client.config.client_side_validation && opts[:'sort_dir'] && !allowable_values.include?(opts[:'sort_dir']) fail ArgumentError, "invalid value for \"sort_dir\", must be one of #{allowable_values}" end allowable_values = ['computed_on', 'size', 'start_date', 'end_date'] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" 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] || [: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, :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_daily_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage attribution. # # @see #get_hourly_usage_attribution_with_http_info 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. # # 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 # ``` # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param usage_type [HourlyUsageAttributionUsageType] Usage type to retrieve. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @option opts [String] :next_record_id List following results with a next_record_id provided in the previous query. # @option opts [String] :tag_breakdown_keys 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. # @option opts [Boolean] :include_descendants Include child org usage in the response. Defaults to `true`. # @return [Array<(HourlyUsageAttributionResponse, Integer, Hash)>] HourlyUsageAttributionResponse data, response status code and response headers def get_hourly_usage_attribution_with_http_info(start_hr, usage_type, opts = {}) 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 # verify enum value allowable_values = ['api_usage', 'apm_fargate_usage', 'apm_host_usage', 'apm_usm_usage', 'appsec_fargate_usage', 'appsec_usage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'browser_usage', 'ci_pipeline_indexed_spans_usage', 'ci_test_indexed_spans_usage', 'ci_visibility_itr_usage', 'cloud_siem_usage', 'container_excl_agent_usage', 'container_usage', 'cspm_containers_usage', 'cspm_hosts_usage', 'custom_event_usage', 'custom_ingested_timeseries_usage', 'custom_timeseries_usage', 'cws_containers_usage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_stream_monitoring_usage', 'dbm_hosts_usage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_ingested_spans_usage', 'fargate_usage', 'functions_usage', 'incident_management_monthly_active_users_usage', 'indexed_spans_usage', 'infra_host_usage', 'ingested_logs_bytes_usage', 'ingested_spans_bytes_usage', 'invocations_usage', 'lambda_traced_invocations_usage', 'logs_indexed_15day_usage', 'logs_indexed_180day_usage', 'logs_indexed_1day_usage', 'logs_indexed_30day_usage', 'logs_indexed_360day_usage', 'logs_indexed_3day_usage', 'logs_indexed_45day_usage', 'logs_indexed_60day_usage', 'logs_indexed_7day_usage', 'logs_indexed_90day_usage', 'logs_indexed_custom_retention_usage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'npm_host_usage', 'obs_pipeline_bytes_usage', 'obs_pipelines_vcpu_usage', 'online_archive_usage', 'profiled_container_usage', 'profiled_fargate_usage', 'profiled_host_usage', 'rum_browser_mobile_sessions_usage', 'rum_replay_sessions_usage', 'sca_fargate_usage', 'sds_scanned_bytes_usage', 'serverless_apps_usage', 'siem_analyzed_logs_add_on_usage', 'siem_ingested_bytes_usage', 'snmp_usage', 'universal_service_monitoring_usage', 'vuln_management_hosts_usage', 'workflow_executions_usage'] if @api_client.config.client_side_validation && !allowable_values.include?(usage_type) fail ArgumentError, "invalid value for \"usage_type\", must be one of #{allowable_values}" 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? query_params[:'include_descendants'] = opts[:'include_descendants'] if !opts[:'include_descendants'].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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_hourly_usage_attribution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for incident management. # # @see #get_incident_management_with_http_info def get_incident_management(start_hr, opts = {}) data, _status_code, _headers = get_incident_management_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageIncidentManagementResponse, Integer, Hash)>] UsageIncidentManagementResponse data, response status code and response headers def get_incident_management_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetIncidentManagement` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_incident_management\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for ingested spans. # # @see #get_ingested_spans_with_http_info def get_ingested_spans(start_hr, opts = {}) data, _status_code, _headers = get_ingested_spans_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageIngestedSpansResponse, Integer, Hash)>] UsageIngestedSpansResponse data, response status code and response headers def get_ingested_spans_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetIngestedSpans` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_ingested_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the list of available monthly custom reports. # # @see #get_monthly_custom_reports_with_http_info def get_monthly_custom_reports(opts = {}) data, _status_code, _headers = get_monthly_custom_reports_with_http_info(opts) data end # 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](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size The number of files to return in the response `[default=60].` # @option opts [Integer] :page_number The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`. # @option opts [UsageSortDirection] :sort_dir The direction to sort by: `[desc, asc]`. # @option opts [UsageSort] :sort The field to sort by: `[computed_on, size, start_date, end_date]`. # @return [Array<(UsageCustomReportsResponse, Integer, Hash)>] UsageCustomReportsResponse data, response status code and response headers def get_monthly_custom_reports_with_http_info(opts = {}) warn "[DEPRECATION] `GetMonthlyCustomReports` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_monthly_custom_reports ...' end allowable_values = ['desc', 'asc'] if @api_client.config.client_side_validation && opts[:'sort_dir'] && !allowable_values.include?(opts[:'sort_dir']) fail ArgumentError, "invalid value for \"sort_dir\", must be one of #{allowable_values}" end allowable_values = ['computed_on', 'size', 'start_date', 'end_date'] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" 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] || [: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, :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_monthly_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get monthly usage attribution. # # @see #get_monthly_usage_attribution_with_http_info 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. # # 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 # ``` # # @param 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. # @param fields [MonthlyUsageAttributionSupportedMetrics] Comma-separated list of usage types to return, or `*` for all usage types. # @param opts [Hash] the optional parameters # @option opts [Time] :end_month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. # @option opts [UsageSortDirection] :sort_direction The direction to sort by: `[desc, asc]`. # @option opts [MonthlyUsageAttributionSupportedMetrics] :sort_name The field to sort by. # @option opts [String] :tag_breakdown_keys 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. # @option opts [String] :next_record_id List following results with a next_record_id provided in the previous query. # @option opts [Boolean] :include_descendants Include child org usage in the response. Defaults to `true`. # @return [Array<(MonthlyUsageAttributionResponse, Integer, Hash)>] MonthlyUsageAttributionResponse data, response status code and response headers def get_monthly_usage_attribution_with_http_info(start_month, fields, opts = {}) 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 # verify enum value allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'cloud_siem_usage', 'cloud_siem_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_jobs_monitoring_percentage', 'data_stream_monitoring_usage', 'data_stream_monitoring_percentage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'functions_usage', 'functions_percentage', 'incident_management_monthly_active_users_usage', 'incident_management_monthly_active_users_percentage', 'infra_host_usage', 'infra_host_percentage', 'invocations_usage', 'invocations_percentage', 'lambda_traced_invocations_usage', 'lambda_traced_invocations_percentage', 'mobile_app_testing_percentage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'ndm_netflow_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'obs_pipelines_vcpu_usage', 'obs_pipelines_vcpu_percentage', 'online_archive_usage', 'online_archive_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'serverless_apps_usage', 'serverless_apps_percentage', 'snmp_usage', 'snmp_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', 'ci_test_indexed_spans_usage', 'ci_test_indexed_spans_percentage', 'ingested_logs_bytes_usage', 'ingested_logs_bytes_percentage', 'ci_pipeline_indexed_spans_usage', 'ci_pipeline_indexed_spans_percentage', 'indexed_spans_usage', 'indexed_spans_percentage', 'custom_event_usage', 'custom_event_percentage', 'logs_indexed_custom_retention_usage', 'logs_indexed_custom_retention_percentage', 'logs_indexed_360day_usage', 'logs_indexed_360day_percentage', 'logs_indexed_180day_usage', 'logs_indexed_180day_percentage', 'logs_indexed_90day_usage', 'logs_indexed_90day_percentage', 'logs_indexed_60day_usage', 'logs_indexed_60day_percentage', 'logs_indexed_45day_usage', 'logs_indexed_45day_percentage', 'logs_indexed_30day_usage', 'logs_indexed_30day_percentage', 'logs_indexed_15day_usage', 'logs_indexed_15day_percentage', 'logs_indexed_7day_usage', 'logs_indexed_7day_percentage', 'logs_indexed_3day_usage', 'logs_indexed_3day_percentage', 'logs_indexed_1day_usage', 'logs_indexed_1day_percentage', 'rum_replay_sessions_usage', 'rum_replay_sessions_percentage', 'rum_browser_mobile_sessions_usage', 'rum_browser_mobile_sessions_percentage', 'ingested_spans_bytes_usage', 'ingested_spans_bytes_percentage', 'siem_analyzed_logs_add_on_usage', 'siem_analyzed_logs_add_on_percentage', 'siem_ingested_bytes_usage', 'siem_ingested_bytes_percentage', 'workflow_executions_usage', 'workflow_executions_percentage', 'sca_fargate_usage', 'sca_fargate_percentage', '*'] if @api_client.config.client_side_validation && !allowable_values.include?(fields) fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}" end allowable_values = ['desc', 'asc'] if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction']) fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}" end allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'cloud_siem_usage', 'cloud_siem_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_jobs_monitoring_percentage', 'data_stream_monitoring_usage', 'data_stream_monitoring_percentage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'functions_usage', 'functions_percentage', 'incident_management_monthly_active_users_usage', 'incident_management_monthly_active_users_percentage', 'infra_host_usage', 'infra_host_percentage', 'invocations_usage', 'invocations_percentage', 'lambda_traced_invocations_usage', 'lambda_traced_invocations_percentage', 'mobile_app_testing_percentage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'ndm_netflow_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'obs_pipelines_vcpu_usage', 'obs_pipelines_vcpu_percentage', 'online_archive_usage', 'online_archive_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'serverless_apps_usage', 'serverless_apps_percentage', 'snmp_usage', 'snmp_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', 'ci_test_indexed_spans_usage', 'ci_test_indexed_spans_percentage', 'ingested_logs_bytes_usage', 'ingested_logs_bytes_percentage', 'ci_pipeline_indexed_spans_usage', 'ci_pipeline_indexed_spans_percentage', 'indexed_spans_usage', 'indexed_spans_percentage', 'custom_event_usage', 'custom_event_percentage', 'logs_indexed_custom_retention_usage', 'logs_indexed_custom_retention_percentage', 'logs_indexed_360day_usage', 'logs_indexed_360day_percentage', 'logs_indexed_180day_usage', 'logs_indexed_180day_percentage', 'logs_indexed_90day_usage', 'logs_indexed_90day_percentage', 'logs_indexed_60day_usage', 'logs_indexed_60day_percentage', 'logs_indexed_45day_usage', 'logs_indexed_45day_percentage', 'logs_indexed_30day_usage', 'logs_indexed_30day_percentage', 'logs_indexed_15day_usage', 'logs_indexed_15day_percentage', 'logs_indexed_7day_usage', 'logs_indexed_7day_percentage', 'logs_indexed_3day_usage', 'logs_indexed_3day_percentage', 'logs_indexed_1day_usage', 'logs_indexed_1day_percentage', 'rum_replay_sessions_usage', 'rum_replay_sessions_percentage', 'rum_browser_mobile_sessions_usage', 'rum_browser_mobile_sessions_percentage', 'ingested_spans_bytes_usage', 'ingested_spans_bytes_percentage', 'siem_analyzed_logs_add_on_usage', 'siem_analyzed_logs_add_on_percentage', 'siem_ingested_bytes_usage', 'siem_ingested_bytes_percentage', 'workflow_executions_usage', 'workflow_executions_percentage', 'sca_fargate_usage', 'sca_fargate_percentage', '*'] if @api_client.config.client_side_validation && opts[:'sort_name'] && !allowable_values.include?(opts[:'sort_name']) fail ArgumentError, "invalid value for \"sort_name\", must be one of #{allowable_values}" 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? query_params[:'include_descendants'] = opts[:'include_descendants'] if !opts[:'include_descendants'].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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_monthly_usage_attribution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get specified daily custom reports. # # @see #get_specified_daily_custom_reports_with_http_info 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. # # 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](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param report_id [String] Date of the report in the format `YYYY-MM-DD`. # @param opts [Hash] the optional parameters # @return [Array<(UsageSpecifiedCustomReportsResponse, Integer, Hash)>] UsageSpecifiedCustomReportsResponse data, response status code and response headers def get_specified_daily_custom_reports_with_http_info(report_id, opts = {}) warn "[DEPRECATION] `GetSpecifiedDailyCustomReports` is deprecated." 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).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json;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] || [: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, :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_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. # # @see #get_specified_monthly_custom_reports_with_http_info 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. # # 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](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param report_id [String] Date of the report in the format `YYYY-MM-DD`. # @param opts [Hash] the optional parameters # @return [Array<(UsageSpecifiedCustomReportsResponse, Integer, Hash)>] UsageSpecifiedCustomReportsResponse data, response status code and response headers def get_specified_monthly_custom_reports_with_http_info(report_id, opts = {}) warn "[DEPRECATION] `GetSpecifiedMonthlyCustomReports` is deprecated." 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).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json;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] || [: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, :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_specified_monthly_custom_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for analyzed logs. # # @see #get_usage_analyzed_logs_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageAnalyzedLogsResponse, Integer, Hash)>] UsageAnalyzedLogsResponse data, response status code and response headers def get_usage_analyzed_logs_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageAnalyzedLogs` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_analyzed_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for audit logs. # # @see #get_usage_audit_logs_with_http_info 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 hourly usage for audit logs. # # Get hourly usage for audit logs. # **Note:** This endpoint has been deprecated. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageAuditLogsResponse, Integer, Hash)>] UsageAuditLogsResponse data, response status code and response headers def get_usage_audit_logs_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageAuditLogs` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_audit_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get billable usage across your account. # # @see #get_usage_billable_summary_with_http_info def get_usage_billable_summary(opts = {}) data, _status_code, _headers = get_usage_billable_summary_with_http_info(opts) data end # Get billable usage across your account. # # Get billable usage across your account. # # This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/). # # @param opts [Hash] the optional parameters # @option opts [Time] :month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage starting this month. # @option opts [Boolean] :include_connected_accounts Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`. # @return [Array<(UsageBillableSummaryResponse, Integer, Hash)>] UsageBillableSummaryResponse data, response status code and response headers def get_usage_billable_summary_with_http_info(opts = {}) 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? query_params[:'include_connected_accounts'] = opts[:'include_connected_accounts'] if !opts[:'include_connected_accounts'].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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_billable_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for CI visibility. # # @see #get_usage_ci_app_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageCIVisibilityResponse, Integer, Hash)>] UsageCIVisibilityResponse data, response status code and response headers 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 hourly usage for CSM Pro. # # @see #get_usage_cloud_security_posture_management_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageCloudSecurityPostureManagementResponse, Integer, Hash)>] UsageCloudSecurityPostureManagementResponse data, response status code and response headers def get_usage_cloud_security_posture_management_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageCloudSecurityPostureManagement` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_cloud_security_posture_management\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for cloud workload security. # # @see #get_usage_cws_with_http_info def get_usage_cws(start_hr, opts = {}) data, _status_code, _headers = get_usage_cws_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageCWSResponse, Integer, Hash)>] UsageCWSResponse data, response status code and response headers def get_usage_cws_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageCWS` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_cws\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for database monitoring. # # @see #get_usage_dbm_with_http_info def get_usage_dbm(start_hr, opts = {}) data, _status_code, _headers = get_usage_dbm_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageDBMResponse, Integer, Hash)>] UsageDBMResponse data, response status code and response headers def get_usage_dbm_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageDBM` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_dbm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for Fargate. # # @see #get_usage_fargate_with_http_info def get_usage_fargate(start_hr, opts = {}) data, _status_code, _headers = get_usage_fargate_with_http_info(start_hr, opts) data end # Get hourly usage for Fargate. # # Get hourly usage for [Fargate](https://docs.datadoghq.com/integrations/ecs_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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageFargateResponse, Integer, Hash)>] UsageFargateResponse data, response status code and response headers def get_usage_fargate_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageFargate` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_fargate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for hosts and containers. # # @see #get_usage_hosts_with_http_info def get_usage_hosts(start_hr, opts = {}) data, _status_code, _headers = get_usage_hosts_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageHostsResponse, Integer, Hash)>] UsageHostsResponse data, response status code and response headers def get_usage_hosts_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageHosts` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for indexed spans. # # @see #get_usage_indexed_spans_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageIndexedSpansResponse, Integer, Hash)>] UsageIndexedSpansResponse data, response status code and response headers def get_usage_indexed_spans_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageIndexedSpans` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_indexed_spans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for IoT. # # @see #get_usage_internet_of_things_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageIoTResponse, Integer, Hash)>] UsageIoTResponse data, response status code and response headers def get_usage_internet_of_things_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageInternetOfThings` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_internet_of_things\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for Lambda. # # @see #get_usage_lambda_with_http_info def get_usage_lambda(start_hr, opts = {}) data, _status_code, _headers = get_usage_lambda_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageLambdaResponse, Integer, Hash)>] UsageLambdaResponse data, response status code and response headers def get_usage_lambda_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageLambda` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_lambda\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for logs. # # @see #get_usage_logs_with_http_info def get_usage_logs(start_hr, opts = {}) data, _status_code, _headers = get_usage_logs_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageLogsResponse, Integer, Hash)>] UsageLogsResponse data, response status code and response headers def get_usage_logs_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageLogs` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for logs by index. # # @see #get_usage_logs_by_index_with_http_info 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 hourly usage for logs by index. # # Get hourly usage for logs by index. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @option opts [Array] :index_name Comma-separated list of log index names. # @return [Array<(UsageLogsByIndexResponse, Integer, Hash)>] UsageLogsByIndexResponse data, response status code and response headers def get_usage_logs_by_index_with_http_info(start_hr, opts = {}) 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :api_version => "V1" ) new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER 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_logs_by_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly logs usage by retention. # # @see #get_usage_logs_by_retention_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageLogsByRetentionResponse, Integer, Hash)>] UsageLogsByRetentionResponse data, response status code and response headers def get_usage_logs_by_retention_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageLogsByRetention` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_logs_by_retention\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # get hourly usage for network flows. # # @see #get_usage_network_flows_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageNetworkFlowsResponse, Integer, Hash)>] UsageNetworkFlowsResponse data, response status code and response headers def get_usage_network_flows_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageNetworkFlows` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_network_flows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for network hosts. # # @see #get_usage_network_hosts_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageNetworkHostsResponse, Integer, Hash)>] UsageNetworkHostsResponse data, response status code and response headers def get_usage_network_hosts_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageNetworkHosts` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_network_hosts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for online archive. # # @see #get_usage_online_archive_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageOnlineArchiveResponse, Integer, Hash)>] UsageOnlineArchiveResponse data, response status code and response headers 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 hourly usage for profiled hosts. # # @see #get_usage_profiling_with_http_info def get_usage_profiling(start_hr, opts = {}) data, _status_code, _headers = get_usage_profiling_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageProfilingResponse, Integer, Hash)>] UsageProfilingResponse data, response status code and response headers def get_usage_profiling_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageProfiling` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_profiling\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for RUM sessions. # # @see #get_usage_rum_sessions_with_http_info 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 hourly usage for RUM sessions. # # Get hourly usage for [RUM](https://docs.datadoghq.com/real_user_monitoring/) 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @option opts [String] :type RUM type: `[browser, mobile]`. Defaults to `browser`. # @return [Array<(UsageRumSessionsResponse, Integer, Hash)>] UsageRumSessionsResponse data, response status code and response headers def get_usage_rum_sessions_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageRumSessions` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_rum_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for RUM units. # # @see #get_usage_rum_units_with_http_info 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 hourly usage for RUM units. # # Get hourly usage for [RUM](https://docs.datadoghq.com/real_user_monitoring/) 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageRumUnitsResponse, Integer, Hash)>] UsageRumUnitsResponse data, response status code and response headers def get_usage_rum_units_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageRumUnits` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_rum_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for sensitive data scanner. # # @see #get_usage_sds_with_http_info def get_usage_sds(start_hr, opts = {}) data, _status_code, _headers = get_usage_sds_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageSDSResponse, Integer, Hash)>] UsageSDSResponse data, response status code and response headers def get_usage_sds_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageSDS` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_sds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for SNMP devices. # # @see #get_usage_snmp_with_http_info def get_usage_snmp(start_hr, opts = {}) data, _status_code, _headers = get_usage_snmp_with_http_info(start_hr, opts) data end # 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. # @return [Array<(UsageSNMPResponse, Integer, Hash)>] UsageSNMPResponse data, response status code and response headers def get_usage_snmp_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageSNMP` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_snmp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get usage across your account. # # @see #get_usage_summary_with_http_info def get_usage_summary(start_month, opts = {}) data, _status_code, _headers = get_usage_summary_with_http_info(start_month, opts) data end # Get usage across your account. # # Get all usage across your account. # # This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/). # # @param 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. # @param opts [Hash] the optional parameters # @option opts [Time] :end_month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. # @option opts [Boolean] :include_org_details Include usage summaries for each sub-org. # @option opts [Boolean] :include_connected_accounts Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`. # @return [Array<(UsageSummaryResponse, Integer, Hash)>] UsageSummaryResponse data, response status code and response headers def get_usage_summary_with_http_info(start_month, opts = {}) 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? query_params[:'include_connected_accounts'] = opts[:'include_connected_accounts'] if !opts[:'include_connected_accounts'].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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for synthetics checks. # # @see #get_usage_synthetics_with_http_info def get_usage_synthetics(start_hr, opts = {}) data, _status_code, _headers = get_usage_synthetics_with_http_info(start_hr, opts) data end # Get hourly usage for synthetics checks. # # Get hourly usage for [synthetics checks](https://docs.datadoghq.com/synthetics/). # **Note:** This endpoint has been deprecated. Hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageSyntheticsResponse, Integer, Hash)>] UsageSyntheticsResponse data, response status code and response headers def get_usage_synthetics_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageSynthetics` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_synthetics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for synthetics API checks. # # @see #get_usage_synthetics_api_with_http_info 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 hourly usage for synthetics API checks. # # Get hourly usage for [synthetics API checks](https://docs.datadoghq.com/synthetics/). # **Note:** This endpoint has been deprecated. Hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageSyntheticsAPIResponse, Integer, Hash)>] UsageSyntheticsAPIResponse data, response status code and response headers def get_usage_synthetics_api_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageSyntheticsAPI` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_synthetics_api\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for synthetics browser checks. # # @see #get_usage_synthetics_browser_with_http_info 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 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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageSyntheticsBrowserResponse, Integer, Hash)>] UsageSyntheticsBrowserResponse data, response status code and response headers def get_usage_synthetics_browser_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageSyntheticsBrowser` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_synthetics_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get hourly usage for custom metrics. # # @see #get_usage_timeseries_with_http_info def get_usage_timeseries(start_hr, opts = {}) data, _status_code, _headers = get_usage_timeseries_with_http_info(start_hr, opts) data end # Get hourly usage for custom metrics. # # Get hourly usage for [custom metrics](https://docs.datadoghq.com/developers/metrics/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](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide. # # @deprecated This API is deprecated. # # @param start_hr [Time] Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. # @param opts [Hash] the optional parameters # @option opts [Time] :end_hr Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage ending **before** this hour. # @return [Array<(UsageTimeseriesResponse, Integer, Hash)>] UsageTimeseriesResponse data, response status code and response headers def get_usage_timeseries_with_http_info(start_hr, opts = {}) warn "[DEPRECATION] `GetUsageTimeseries` is deprecated." 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :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_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all custom metrics by hourly average. # # @see #get_usage_top_avg_metrics_with_http_info def get_usage_top_avg_metrics(opts = {}) data, _status_code, _headers = get_usage_top_avg_metrics_with_http_info(opts) data end # Get all custom metrics by hourly average. # # Get all [custom metrics](https://docs.datadoghq.com/developers/metrics/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. # # @param opts [Hash] the optional parameters # @option opts [Time] :month 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) # @option opts [Time] :day 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) # @option opts [Array] :names Comma-separated list of metric names. # @option opts [Integer] :limit Maximum number of results to return (between 1 and 5000) - defaults to 500 results if limit not specified. # @option opts [String] :next_record_id List following results with a next_record_id provided in the previous query. # @return [Array<(UsageTopAvgMetricsResponse, Integer, Hash)>] UsageTopAvgMetricsResponse data, response status code and response headers def get_usage_top_avg_metrics_with_http_info(opts = {}) 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] 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, :api_version => "V1" ) new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER 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_top_avg_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end