class LaunchDarklyApi::AccountUsageBetaApi
Attributes
Public Class Methods
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get evaluations usage Get time-series arrays of the number of times a flag is evaluated, broken down by the variation that resulted from that evaluation. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param proj_key [String] The project key. @param env_key [String] The environment key. @param flag_key [String] The feature flag's key. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :tz The timezone to use for breaks between days when returning daily data. @return [SeriesListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 32 def get_evaluations_usage(proj_key, env_key, flag_key, opts = {}) data, _status_code, _headers = get_evaluations_usage_with_http_info(proj_key, env_key, flag_key, opts) data end
Get evaluations usage Get time-series arrays of the number of times a flag is evaluated, broken down by the variation that resulted from that evaluation. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param proj_key [String] The project key. @param env_key [String] The environment key. @param flag_key [String] The feature flag's key. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :tz The timezone to use for breaks between days when returning daily data. @return [Array<(SeriesListRep
, Integer, Hash)>] SeriesListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 47 def get_evaluations_usage_with_http_info(proj_key, env_key, flag_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_evaluations_usage ...' end # verify the required parameter 'proj_key' is set if @api_client.config.client_side_validation && proj_key.nil? fail ArgumentError, "Missing the required parameter 'proj_key' when calling AccountUsageBetaApi.get_evaluations_usage" end # verify the required parameter 'env_key' is set if @api_client.config.client_side_validation && env_key.nil? fail ArgumentError, "Missing the required parameter 'env_key' when calling AccountUsageBetaApi.get_evaluations_usage" end # verify the required parameter 'flag_key' is set if @api_client.config.client_side_validation && flag_key.nil? fail ArgumentError, "Missing the required parameter 'flag_key' when calling AccountUsageBetaApi.get_evaluations_usage" end # resource path local_var_path = '/api/v2/usage/evaluations/{projKey}/{envKey}/{flagKey}'.sub('{' + 'projKey' + '}', CGI.escape(proj_key.to_s)).sub('{' + 'envKey' + '}', CGI.escape(env_key.to_s)).sub('{' + 'flagKey' + '}', CGI.escape(flag_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'tz'] = opts[:'tz'] if !opts[:'tz'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SeriesListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_evaluations_usage", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_evaluations_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get events usage Get time-series arrays of the number of times a flag is evaluated, broken down by the variation that resulted from that evaluation. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param type [String] The type of event to retrieve. Must be either `received` or `published`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 24 hours ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @return [SeriesListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 113 def get_events_usage(type, opts = {}) data, _status_code, _headers = get_events_usage_with_http_info(type, opts) data end
Get events usage Get time-series arrays of the number of times a flag is evaluated, broken down by the variation that resulted from that evaluation. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param type [String] The type of event to retrieve. Must be either `received` or `published`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 24 hours ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @return [Array<(SeriesListRep
, Integer, Hash)>] SeriesListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 125 def get_events_usage_with_http_info(type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_events_usage ...' end # verify the required parameter 'type' is set if @api_client.config.client_side_validation && type.nil? fail ArgumentError, "Missing the required parameter 'type' when calling AccountUsageBetaApi.get_events_usage" end # resource path local_var_path = '/api/v2/usage/events/{type}'.sub('{' + 'type' + '}', CGI.escape(type.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SeriesListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_events_usage", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_events_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get MAU SDKs by type Get a list of SDKs. These are all of the SDKs that have connected to LaunchDarkly by monthly active users (MAU) in the requested time period. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to seven days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :sdktype The type of SDK with monthly active users (MAU) to list. Must be either `client` or `server` @return [SdkListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 182 def get_mau_sdks_by_type(opts = {}) data, _status_code, _headers = get_mau_sdks_by_type_with_http_info(opts) data end
Get MAU SDKs by type Get a list of SDKs. These are all of the SDKs that have connected to LaunchDarkly by monthly active users (MAU) in the requested time period. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to seven days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :sdktype The type of SDK with monthly active users (MAU) to list. Must be either `client` or `server` @return [Array<(SdkListRep
, Integer, Hash)>] SdkListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 194 def get_mau_sdks_by_type_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_mau_sdks_by_type ...' end # resource path local_var_path = '/api/v2/usage/mau/sdks' # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'sdktype'] = opts[:'sdktype'] if !opts[:'sdktype'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SdkListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_mau_sdks_by_type", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_mau_sdks_by_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get MAU usage Get a time-series array of the number of monthly active users (MAU) seen by LaunchDarkly from your account. The granularity is always daily. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :project A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects. @option opts [String] :environment An environment key to filter results to. When using this parameter, exactly one project key must also be set. Can be specified multiple times as separate query parameters to view data for multiple environments within a single project. @option opts [String] :sdktype An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server @option opts [String] :sdk An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK. @option opts [String] :anonymous If specified, filters results to either anonymous or nonanonymous users. @option opts [String] :groupby If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions (for example, to group by both project and SDK). Valid values: project, environment, sdktype, sdk, anonymous @return [SeriesListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 253 def get_mau_usage(opts = {}) data, _status_code, _headers = get_mau_usage_with_http_info(opts) data end
Get MAU usage by category Get time-series arrays of the number of monthly active users (MAU) seen by LaunchDarkly from your account, broken down by the category of users. The category is either `browser`, `mobile`, or `backend`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @return [SeriesListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 328 def get_mau_usage_by_category(opts = {}) data, _status_code, _headers = get_mau_usage_by_category_with_http_info(opts) data end
Get MAU usage by category Get time-series arrays of the number of monthly active users (MAU) seen by LaunchDarkly from your account, broken down by the category of users. The category is either `browser`, `mobile`, or `backend`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @return [Array<(SeriesListRep
, Integer, Hash)>] SeriesListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 339 def get_mau_usage_by_category_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_mau_usage_by_category ...' end # resource path local_var_path = '/api/v2/usage/mau/bycategory' # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SeriesListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_mau_usage_by_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_mau_usage_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get MAU usage Get a time-series array of the number of monthly active users (MAU) seen by LaunchDarkly from your account. The granularity is always daily. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :project A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects. @option opts [String] :environment An environment key to filter results to. When using this parameter, exactly one project key must also be set. Can be specified multiple times as separate query parameters to view data for multiple environments within a single project. @option opts [String] :sdktype An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server @option opts [String] :sdk An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK. @option opts [String] :anonymous If specified, filters results to either anonymous or nonanonymous users. @option opts [String] :groupby If specified, returns data for each distinct value of the given field. Can be specified multiple times to group data by multiple dimensions (for example, to group by both project and SDK). Valid values: project, environment, sdktype, sdk, anonymous @return [Array<(SeriesListRep
, Integer, Hash)>] SeriesListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 270 def get_mau_usage_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_mau_usage ...' end # resource path local_var_path = '/api/v2/usage/mau' # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'project'] = opts[:'project'] if !opts[:'project'].nil? query_params[:'environment'] = opts[:'environment'] if !opts[:'environment'].nil? query_params[:'sdktype'] = opts[:'sdktype'] if !opts[:'sdktype'].nil? query_params[:'sdk'] = opts[:'sdk'] if !opts[:'sdk'].nil? query_params[:'anonymous'] = opts[:'anonymous'] if !opts[:'anonymous'].nil? query_params[:'groupby'] = opts[:'groupby'] if !opts[:'groupby'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SeriesListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_mau_usage", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_mau_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get stream usage Get a time-series array of the number of streaming connections to LaunchDarkly in each time period. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param source [String] The source of streaming connections to describe. Must be either `client` or `server`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :tz The timezone to use for breaks between days when returning daily data. @return [SeriesListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 393 def get_stream_usage(source, opts = {}) data, _status_code, _headers = get_stream_usage_with_http_info(source, opts) data end
Get stream usage by SDK version Get multiple series of the number of streaming connections to LaunchDarkly in each time period, separated by SDK type and version. Information about each series is in the metadata array. The granularity of the data depends on the age of the data requested. If the requested range is within the past 2 hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param source [String] The source of streaming connections to describe. Must be either `client` or `server`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 24 hours ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :tz The timezone to use for breaks between days when returning daily data. @option opts [String] :sdk If included, this filters the returned series to only those that match this SDK name. @option opts [String] :version If included, this filters the returned series to only those that match this SDK version. @return [SeriesListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 467 def get_stream_usage_by_sdk_version(source, opts = {}) data, _status_code, _headers = get_stream_usage_by_sdk_version_with_http_info(source, opts) data end
Get stream usage by SDK version Get multiple series of the number of streaming connections to LaunchDarkly in each time period, separated by SDK type and version. Information about each series is in the metadata array. The granularity of the data depends on the age of the data requested. If the requested range is within the past 2 hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param source [String] The source of streaming connections to describe. Must be either `client` or `server`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 24 hours ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :tz The timezone to use for breaks between days when returning daily data. @option opts [String] :sdk If included, this filters the returned series to only those that match this SDK name. @option opts [String] :version If included, this filters the returned series to only those that match this SDK version. @return [Array<(SeriesListRep
, Integer, Hash)>] SeriesListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 482 def get_stream_usage_by_sdk_version_with_http_info(source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_stream_usage_by_sdk_version ...' end # verify the required parameter 'source' is set if @api_client.config.client_side_validation && source.nil? fail ArgumentError, "Missing the required parameter 'source' when calling AccountUsageBetaApi.get_stream_usage_by_sdk_version" end # resource path local_var_path = '/api/v2/usage/streams/{source}/bysdkversion'.sub('{' + 'source' + '}', CGI.escape(source.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'tz'] = opts[:'tz'] if !opts[:'tz'].nil? query_params[:'sdk'] = opts[:'sdk'] if !opts[:'sdk'].nil? query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SeriesListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_stream_usage_by_sdk_version", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_stream_usage_by_sdk_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get stream usage SDK versions Get a list of SDK version objects, which contain an SDK name and version. These are all of the SDKs that have connected to LaunchDarkly from your account in the past 60 days. @param source [String] The source of streaming connections to describe. Must be either `client` or `server`. @param [Hash] opts the optional parameters @return [SdkVersionListRep]
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 540 def get_stream_usage_sdkversion(source, opts = {}) data, _status_code, _headers = get_stream_usage_sdkversion_with_http_info(source, opts) data end
Get stream usage SDK versions Get a list of SDK version objects, which contain an SDK name and version. These are all of the SDKs that have connected to LaunchDarkly from your account in the past 60 days. @param source [String] The source of streaming connections to describe. Must be either `client` or `server`. @param [Hash] opts the optional parameters @return [Array<(SdkVersionListRep
, Integer, Hash)>] SdkVersionListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 550 def get_stream_usage_sdkversion_with_http_info(source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_stream_usage_sdkversion ...' end # verify the required parameter 'source' is set if @api_client.config.client_side_validation && source.nil? fail ArgumentError, "Missing the required parameter 'source' when calling AccountUsageBetaApi.get_stream_usage_sdkversion" end # resource path local_var_path = '/api/v2/usage/streams/{source}/sdkversions'.sub('{' + 'source' + '}', CGI.escape(source.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SdkVersionListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_stream_usage_sdkversion", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_stream_usage_sdkversion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get stream usage Get a time-series array of the number of streaming connections to LaunchDarkly in each time period. The granularity of the data depends on the age of the data requested. If the requested range is within the past two hours, minutely data is returned. If it is within the last two days, hourly data is returned. Otherwise, daily data is returned. @param source [String] The source of streaming connections to describe. Must be either `client` or `server`. @param [Hash] opts the optional parameters @option opts [String] :from The series of data returned starts from this timestamp. Defaults
to 30 days ago. @option opts [String] :to The series of data returned ends at this timestamp. Defaults
to the current time. @option opts [String] :tz The timezone to use for breaks between days when returning daily data. @return [Array<(SeriesListRep
, Integer, Hash)>] SeriesListRep
data, response status code and response headers
# File lib/launchdarkly_api/api/account_usage_beta_api.rb, line 406 def get_stream_usage_with_http_info(source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_stream_usage ...' end # verify the required parameter 'source' is set if @api_client.config.client_side_validation && source.nil? fail ArgumentError, "Missing the required parameter 'source' when calling AccountUsageBetaApi.get_stream_usage" end # resource path local_var_path = '/api/v2/usage/streams/{source}'.sub('{' + 'source' + '}', CGI.escape(source.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil? query_params[:'tz'] = opts[:'tz'] if !opts[:'tz'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SeriesListRep' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"AccountUsageBetaApi.get_stream_usage", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountUsageBetaApi#get_stream_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end