=begin #Sematext Cloud API #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. OpenAPI spec version: v3 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' module SematextCloud class MetricsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get metrics data points for an app # Default value of interval is 5m # @param app_id appId # @param request_body Metric data points request # @param [Hash] opts the optional parameters # @return [GenericApiResponse] def list_data_series_using_post(app_id, request_body, opts = {}) data, _status_code, _headers = list_data_series_using_post_with_http_info(app_id, request_body, opts) data end # Get metrics data points for an app # Default value of interval is 5m # @param app_id appId # @param request_body Metric data points request # @param [Hash] opts the optional parameters # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers def list_data_series_using_post_with_http_info(app_id, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.list_data_series_using_post ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_data_series_using_post" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling MetricsApi.list_data_series_using_post" end # resource path local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics/data'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsApi#list_data_series_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get metrics filters and their values for an app # Default value of interval is 5m # @param app_id appId # @param request_body Metric filters request # @param [Hash] opts the optional parameters # @return [GenericApiResponse] def list_filters_using_post(app_id, request_body, opts = {}) data, _status_code, _headers = list_filters_using_post_with_http_info(app_id, request_body, opts) data end # Get metrics filters and their values for an app # Default value of interval is 5m # @param app_id appId # @param request_body Metric filters request # @param [Hash] opts the optional parameters # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers def list_filters_using_post_with_http_info(app_id, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.list_filters_using_post ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_filters_using_post" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling MetricsApi.list_filters_using_post" end # resource path local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics/filters'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsApi#list_filters_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get metrics keys for an app # @param app_id appId # @param [Hash] opts the optional parameters # @return [GenericApiResponse] def list_metrics_keys_using_get(app_id, opts = {}) data, _status_code, _headers = list_metrics_keys_using_get_with_http_info(app_id, opts) data end # Get metrics keys for an app # @param app_id appId # @param [Hash] opts the optional parameters # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers def list_metrics_keys_using_get_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.list_metrics_keys_using_get ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_metrics_keys_using_get" end # resource path local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics/keys'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsApi#list_metrics_keys_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get metrics info for an app # @param app_id appId # @param [Hash] opts the optional parameters # @return [GenericApiResponse] def list_metrics_using_get(app_id, opts = {}) data, _status_code, _headers = list_metrics_using_get_with_http_info(app_id, opts) data end # Get metrics info for an app # @param app_id appId # @param [Hash] opts the optional parameters # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers def list_metrics_using_get_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.list_metrics_using_get ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_metrics_using_get" end # resource path local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics'.sub('{' + 'appId' + '}', app_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GenericApiResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsApi#list_metrics_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end