Class: LaunchDarklyApi::AccountUsageBetaApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/account_usage_beta_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountUsageBetaApi

Returns a new instance of AccountUsageBetaApi.



19
20
21
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_data_export_events_usage(opts = {}) ⇒ SeriesIntervalsRep

Get data export events usage Get a time-series array of the number of monthly data export events from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, `environmentKey` is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, `projectKey` is required and results apply to the corresponding environment in this project.

Returns:



30
31
32
33
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 30

def get_data_export_events_usage(opts = {})
  data, _status_code, _headers = get_data_export_events_usage_with_http_info(opts)
  data
end

#get_data_export_events_usage_with_http_info(opts = {}) ⇒ Array<(SeriesIntervalsRep, Integer, Hash)>

Get data export events usage Get a time-series array of the number of monthly data export events from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:

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

    SeriesIntervalsRep data, response status code and response headers



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 43

def get_data_export_events_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_data_export_events_usage ...'
  end
  # resource path
  local_var_path = '/api/v2/usage/data-export-events'

  # 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[:'projectKey'] = opts[:'project_key'] if !opts[:'project_key'].nil?
  query_params[:'environmentKey'] = opts[:'environment_key'] if !opts[:'environment_key'].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] || 'SeriesIntervalsRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"AccountUsageBetaApi.get_data_export_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_data_export_events_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_evaluations_usage(project_key, environment_key, feature_flag_key, opts = {}) ⇒ SeriesListRep

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.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • feature_flag_key (String)

    The feature flag key

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :tz (String)

    The timezone to use for breaks between days when returning daily data.

Returns:



101
102
103
104
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 101

def get_evaluations_usage(project_key, environment_key, feature_flag_key, opts = {})
  data, _status_code, _headers = get_evaluations_usage_with_http_info(project_key, environment_key, feature_flag_key, opts)
  data
end

#get_evaluations_usage_with_http_info(project_key, environment_key, feature_flag_key, opts = {}) ⇒ Array<(SeriesListRep, Integer, Hash)>

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.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • feature_flag_key (String)

    The feature flag key

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :tz (String)

    The timezone to use for breaks between days when returning daily data.

Returns:

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

    SeriesListRep data, response status code and response headers



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 116

def get_evaluations_usage_with_http_info(project_key, environment_key, feature_flag_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_evaluations_usage ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling AccountUsageBetaApi.get_evaluations_usage"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling AccountUsageBetaApi.get_evaluations_usage"
  end
  # verify the required parameter 'feature_flag_key' is set
  if @api_client.config.client_side_validation && feature_flag_key.nil?
    fail ArgumentError, "Missing the required parameter 'feature_flag_key' when calling AccountUsageBetaApi.get_evaluations_usage"
  end
  # resource path
  local_var_path = '/api/v2/usage/evaluations/{projectKey}/{environmentKey}/{featureFlagKey}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'featureFlagKey' + '}', CGI.escape(feature_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(type, opts = {}) ⇒ SeriesListRep

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.

Parameters:

  • type (String)

    The type of event to retrieve. Must be either &#x60;received&#x60; or &#x60;published&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 24 hours ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

Returns:



182
183
184
185
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 182

def get_events_usage(type, opts = {})
  data, _status_code, _headers = get_events_usage_with_http_info(type, opts)
  data
end

#get_events_usage_with_http_info(type, opts = {}) ⇒ Array<(SeriesListRep, Integer, Hash)>

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.

Parameters:

  • type (String)

    The type of event to retrieve. Must be either &#x60;received&#x60; or &#x60;published&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 24 hours ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

Returns:

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

    SeriesListRep data, response status code and response headers



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 194

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_experimentation_keys_usage(opts = {}) ⇒ SeriesIntervalsRep

Get experimentation keys usage Get a time-series array of the number of monthly experimentation keys from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:



252
253
254
255
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 252

def get_experimentation_keys_usage(opts = {})
  data, _status_code, _headers = get_experimentation_keys_usage_with_http_info(opts)
  data
end

#get_experimentation_keys_usage_with_http_info(opts = {}) ⇒ Array<(SeriesIntervalsRep, Integer, Hash)>

Get experimentation keys usage Get a time-series array of the number of monthly experimentation keys from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:

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

    SeriesIntervalsRep data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 265

def get_experimentation_keys_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_experimentation_keys_usage ...'
  end
  # resource path
  local_var_path = '/api/v2/usage/experimentation-keys'

  # 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[:'projectKey'] = opts[:'project_key'] if !opts[:'project_key'].nil?
  query_params[:'environmentKey'] = opts[:'environment_key'] if !opts[:'environment_key'].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] || 'SeriesIntervalsRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"AccountUsageBetaApi.get_experimentation_keys_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_experimentation_keys_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_experimentation_units_usage(opts = {}) ⇒ SeriesIntervalsRep

Get experimentation units usage Get a time-series array of the number of monthly experimentation units from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:



321
322
323
324
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 321

def get_experimentation_units_usage(opts = {})
  data, _status_code, _headers = get_experimentation_units_usage_with_http_info(opts)
  data
end

#get_experimentation_units_usage_with_http_info(opts = {}) ⇒ Array<(SeriesIntervalsRep, Integer, Hash)>

Get experimentation units usage Get a time-series array of the number of monthly experimentation units from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:

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

    SeriesIntervalsRep data, response status code and response headers



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 334

def get_experimentation_units_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_experimentation_units_usage ...'
  end
  # resource path
  local_var_path = '/api/v2/usage/experimentation-units'

  # 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[:'projectKey'] = opts[:'project_key'] if !opts[:'project_key'].nil?
  query_params[:'environmentKey'] = opts[:'environment_key'] if !opts[:'environment_key'].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] || 'SeriesIntervalsRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"AccountUsageBetaApi.get_experimentation_units_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_experimentation_units_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_mau_sdks_by_type(opts = {}) ⇒ SdkListRep

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.<br/><br/>Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](launchdarkly.com/docs/home/account/metrics).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The data returned starts from this timestamp. Defaults to seven days ago. The timestamp is in Unix milliseconds, for example, 1656694800000.

  • :to (String)

    The data returned ends at this timestamp. Defaults to the current time. The timestamp is in Unix milliseconds, for example, 1657904400000.

  • :sdktype (String)

    The type of SDK with monthly active users (MAU) to list. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

Returns:



389
390
391
392
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 389

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_with_http_info(opts = {}) ⇒ Array<(SdkListRep, Integer, Hash)>

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.&lt;br/&gt;&lt;br/&gt;Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](launchdarkly.com/docs/home/account/metrics).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The data returned starts from this timestamp. Defaults to seven days ago. The timestamp is in Unix milliseconds, for example, 1656694800000.

  • :to (String)

    The data returned ends at this timestamp. Defaults to the current time. The timestamp is in Unix milliseconds, for example, 1657904400000.

  • :sdktype (String)

    The type of SDK with monthly active users (MAU) to list. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

Returns:

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

    SdkListRep data, response status code and response headers



401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 401

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(opts = {}) ⇒ SeriesListRep

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.<br/><br/>Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](launchdarkly.com/docs/home/account/metrics).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :project (String)

    A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects.

  • :environment (String)

    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.

  • :sdktype (String)

    An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server

  • :sdk (String)

    An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK.

  • :anonymous (String)

    If specified, filters results to either anonymous or nonanonymous users.

  • :groupby (String)

    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, contextKind, sdkAppId

  • :aggregation_type (String)

    If specified, queries for rolling 30-day, month-to-date, or daily incremental counts. Default is rolling 30-day. Valid values: rolling_30d, month_to_date, daily_incremental

  • :context_kind (String)

    Filters results to the specified context kinds. Can be specified multiple times, one query parameter per context kind. If not set, queries for the user context kind.

Returns:



462
463
464
465
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 462

def get_mau_usage(opts = {})
  data, _status_code, _headers = get_mau_usage_with_http_info(opts)
  data
end

#get_mau_usage_by_category(opts = {}) ⇒ SeriesListRep

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`.<br/><br/>Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](launchdarkly.com/docs/home/account/metrics).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

Returns:



541
542
543
544
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 541

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_with_http_info(opts = {}) ⇒ Array<(SeriesListRep, Integer, Hash)>

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 &#x60;browser&#x60;, &#x60;mobile&#x60;, or &#x60;backend&#x60;.&lt;br/&gt;&lt;br/&gt;Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](launchdarkly.com/docs/home/account/metrics).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

Returns:

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

    SeriesListRep data, response status code and response headers



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 552

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_with_http_info(opts = {}) ⇒ Array<(SeriesListRep, Integer, Hash)>

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.&lt;br/&gt;&lt;br/&gt;Endpoints for retrieving monthly active users (MAU) do not return information about active context instances. After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should not rely on this endpoint. To learn more, read [Account usage metrics](launchdarkly.com/docs/home/account/metrics).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :project (String)

    A project key to filter results to. Can be specified multiple times, one query parameter per project key, to view data for multiple projects.

  • :environment (String)

    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.

  • :sdktype (String)

    An SDK type to filter results to. Can be specified multiple times, one query parameter per SDK type. Valid values: client, server

  • :sdk (String)

    An SDK name to filter results to. Can be specified multiple times, one query parameter per SDK.

  • :anonymous (String)

    If specified, filters results to either anonymous or nonanonymous users.

  • :groupby (String)

    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, contextKind, sdkAppId

  • :aggregation_type (String)

    If specified, queries for rolling 30-day, month-to-date, or daily incremental counts. Default is rolling 30-day. Valid values: rolling_30d, month_to_date, daily_incremental

  • :context_kind (String)

    Filters results to the specified context kinds. Can be specified multiple times, one query parameter per context kind. If not set, queries for the user context kind.

Returns:

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

    SeriesListRep data, response status code and response headers



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 481

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?
  query_params[:'aggregationType'] = opts[:'aggregation_type'] if !opts[:'aggregation_type'].nil?
  query_params[:'contextKind'] = opts[:'context_kind'] if !opts[:'context_kind'].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_service_connection_usage(opts = {}) ⇒ SeriesIntervalsRep

Get service connection usage Get a time-series array of the number of monthly service connections from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:



606
607
608
609
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 606

def get_service_connection_usage(opts = {})
  data, _status_code, _headers = get_service_connection_usage_with_http_info(opts)
  data
end

#get_service_connection_usage_with_http_info(opts = {}) ⇒ Array<(SeriesIntervalsRep, Integer, Hash)>

Get service connection usage Get a time-series array of the number of monthly service connections from your account. The granularity is always daily, with a maximum of 31 days.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp (Unix seconds). Defaults to the beginning of the current month.

  • :to (String)

    The series of data returned ends at this timestamp (Unix seconds). Defaults to the current time.

  • :project_key (String)

    A project key. If specified, &#x60;environmentKey&#x60; is required and results apply to the corresponding environment in this project.

  • :environment_key (String)

    An environment key. If specified, &#x60;projectKey&#x60; is required and results apply to the corresponding environment in this project.

Returns:

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

    SeriesIntervalsRep data, response status code and response headers



619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 619

def get_service_connection_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountUsageBetaApi.get_service_connection_usage ...'
  end
  # resource path
  local_var_path = '/api/v2/usage/service-connections'

  # 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[:'projectKey'] = opts[:'project_key'] if !opts[:'project_key'].nil?
  query_params[:'environmentKey'] = opts[:'environment_key'] if !opts[:'environment_key'].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] || 'SeriesIntervalsRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"AccountUsageBetaApi.get_service_connection_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_service_connection_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stream_usage(source, opts = {}) ⇒ SeriesListRep

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.

Parameters:

  • source (String)

    The source of streaming connections to describe. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :tz (String)

    The timezone to use for breaks between days when returning daily data.

Returns:



675
676
677
678
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 675

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(source, opts = {}) ⇒ SeriesListRep

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.

Parameters:

  • source (String)

    The source of streaming connections to describe. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 24 hours ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :tz (String)

    The timezone to use for breaks between days when returning daily data.

  • :sdk (String)

    If included, this filters the returned series to only those that match this SDK name.

  • :version (String)

    If included, this filters the returned series to only those that match this SDK version.

Returns:



749
750
751
752
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 749

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_with_http_info(source, opts = {}) ⇒ Array<(SeriesListRep, Integer, Hash)>

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.

Parameters:

  • source (String)

    The source of streaming connections to describe. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 24 hours ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :tz (String)

    The timezone to use for breaks between days when returning daily data.

  • :sdk (String)

    If included, this filters the returned series to only those that match this SDK name.

  • :version (String)

    If included, this filters the returned series to only those that match this SDK version.

Returns:

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

    SeriesListRep data, response status code and response headers



764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 764

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_sdkversion(source, opts = {}) ⇒ SdkVersionListRep

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.

Parameters:

  • source (String)

    The source of streaming connections to describe. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

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

    the optional parameters

Returns:



822
823
824
825
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 822

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_sdkversion_with_http_info(source, opts = {}) ⇒ Array<(SdkVersionListRep, Integer, Hash)>

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.

Parameters:

  • source (String)

    The source of streaming connections to describe. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

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

    the optional parameters

Returns:

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

    SdkVersionListRep data, response status code and response headers



832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
# File 'lib/launchdarkly_api/api/account_usage_beta_api.rb', line 832

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_with_http_info(source, opts = {}) ⇒ Array<(SeriesListRep, Integer, Hash)>

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.

Parameters:

  • source (String)

    The source of streaming connections to describe. Must be either &#x60;client&#x60; or &#x60;server&#x60;.

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

    the optional parameters

Options Hash (opts):

  • :from (String)

    The series of data returned starts from this timestamp. Defaults to 30 days ago.

  • :to (String)

    The series of data returned ends at this timestamp. Defaults to the current time.

  • :tz (String)

    The timezone to use for breaks between days when returning daily data.

Returns:

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

    SeriesListRep data, response status code and response headers



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

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