Class: Shipeasy::Admin::Generated::ErrorsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/shipeasy_admin/api/errors_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ErrorsApi

Returns a new instance of ErrorsApi.



19
20
21
# File 'lib/shipeasy_admin/api/errors_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/shipeasy_admin/api/errors_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#file_error_ticket(id, opts = {}) ⇒ FileErrorTicketResponse

File a feedback ticket for an error Files a feedback ticket (type: \"error\") for a tracked production error — the "File an issue" action on the errors dashboard. The ticket carries the error's fingerprint as its sourceRef so it dedupes against, and joins back to, the tracked error. Takes no body. Idempotent: if an open error ticket already tracks this fingerprint (hand- or auto-filed), that existing ticket is returned instead of creating a duplicate. Returns 404 if the error does not exist. Use case: Promote a noisy tracked error into an actionable ticket in the ops queue (the same item the worker auto-files once an error crosses its occurrence threshold), so it can be triaged, assigned, and burned down via /shipeasy:ops:work.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:



28
29
30
31
# File 'lib/shipeasy_admin/api/errors_api.rb', line 28

def file_error_ticket(id, opts = {})
  data, _status_code, _headers = file_error_ticket_with_http_info(id, opts)
  data
end

#file_error_ticket_with_http_info(id, opts = {}) ⇒ Array<(FileErrorTicketResponse, Integer, Hash)>

File a feedback ticket for an error Files a feedback ticket (`type: &quot;error&quot;`) for a tracked production error — the &quot;File an issue&quot; action on the errors dashboard. The ticket carries the error's fingerprint as its `sourceRef` so it dedupes against, and joins back to, the tracked error. Takes no body. Idempotent: if an open `error` ticket already tracks this fingerprint (hand- or auto-filed), that existing ticket is returned instead of creating a duplicate. Returns `404` if the error does not exist. Use case: Promote a noisy tracked error into an actionable ticket in the ops queue (the same item the worker auto-files once an error crosses its occurrence threshold), so it can be triaged, assigned, and burned down via `/shipeasy:ops:work`.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:

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

    FileErrorTicketResponse data, response status code and response headers



39
40
41
42
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
# File 'lib/shipeasy_admin/api/errors_api.rb', line 39

def file_error_ticket_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ErrorsApi.file_error_ticket ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ErrorsApi.file_error_ticket"
  end
  # resource path
  local_var_path = '/api/admin/errors/{id}/file'.sub('{id}', CGI.escape(id.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']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FileErrorTicketResponse'

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

  new_options = opts.merge(
    :operation => :"ErrorsApi.file_error_ticket",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ErrorsApi#file_error_ticket\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_error(id, opts = {}) ⇒ ErrorRecord

Get a tracked error Returns a single tracked error by its id, including the latest occurrence's stack, extras, and consequence. Returns 404 if no such error exists in the project. Use case: Drill into one issue — fetch its full stack and seenUrls to investigate, or to render the detail panel behind a row in the errors list.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:



94
95
96
97
# File 'lib/shipeasy_admin/api/errors_api.rb', line 94

def get_error(id, opts = {})
  data, _status_code, _headers = get_error_with_http_info(id, opts)
  data
end

#get_error_series(id, error_series_request, opts = {}) ⇒ ErrorSeriesResponse

Get an error's occurrence series Returns a bucketed occurrence timeseries for one tracked error (by its fingerprint), read from the shipeasy_errors Analytics Engine dataset (near-real-time; ingest lag is seconds). The window bounds are epoch seconds; to must be strictly greater than from. The response echoes the SQL that produced the rows. Use case: Render the trend sparkline / occurrence chart on the error detail panel, or pull the raw bucketed counts to alert when an issue's rate spikes.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:



157
158
159
160
# File 'lib/shipeasy_admin/api/errors_api.rb', line 157

def get_error_series(id, error_series_request, opts = {})
  data, _status_code, _headers = get_error_series_with_http_info(id, error_series_request, opts)
  data
end

#get_error_series_with_http_info(id, error_series_request, opts = {}) ⇒ Array<(ErrorSeriesResponse, Integer, Hash)>

Get an error's occurrence series Returns a bucketed occurrence timeseries for one tracked error (by its fingerprint), read from the `shipeasy_errors` Analytics Engine dataset (near-real-time; ingest lag is seconds). The window bounds are epoch seconds; `to` must be strictly greater than `from`. The response echoes the SQL that produced the rows. Use case: Render the trend sparkline / occurrence chart on the error detail panel, or pull the raw bucketed counts to alert when an issue's rate spikes.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:

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

    ErrorSeriesResponse data, response status code and response headers



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/shipeasy_admin/api/errors_api.rb', line 169

def get_error_series_with_http_info(id, error_series_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ErrorsApi.get_error_series ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ErrorsApi.get_error_series"
  end
  # verify the required parameter 'error_series_request' is set
  if @api_client.config.client_side_validation && error_series_request.nil?
    fail ArgumentError, "Missing the required parameter 'error_series_request' when calling ErrorsApi.get_error_series"
  end
  # resource path
  local_var_path = '/api/admin/errors/{id}/series'.sub('{id}', CGI.escape(id.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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(error_series_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ErrorSeriesResponse'

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

  new_options = opts.merge(
    :operation => :"ErrorsApi.get_error_series",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ErrorsApi#get_error_series\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_error_with_http_info(id, opts = {}) ⇒ Array<(ErrorRecord, Integer, Hash)>

Get a tracked error Returns a single tracked error by its id, including the latest occurrence's stack, extras, and consequence. Returns `404` if no such error exists in the project. Use case: Drill into one issue — fetch its full stack and `seenUrls` to investigate, or to render the detail panel behind a row in the errors list.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:

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

    ErrorRecord data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
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
# File 'lib/shipeasy_admin/api/errors_api.rb', line 105

def get_error_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ErrorsApi.get_error ...'
  end
  # resource path
  local_var_path = '/api/admin/errors/{id}'.sub('{id}', CGI.escape(id.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']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ErrorRecord'

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

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

#list_errors(opts = {}) ⇒ Array<ErrorRecord>

List tracked errors Returns a single page of tracked production errors as a bare JSON array (no pagination envelope), ordered by lastSeenAt desc. Filter with status, free-text-search with q, and cap the page with limit. Tracked errors are never filed by hand — an ingestion path (worker log drain / the see() SDK reporter) folds each occurrence into a row keyed by fingerprint, bumping count and lastSeenAt. This surface only reads them and (via PATCH) flips their status. Use case: Snapshot the project's open issues for a triage dashboard, or drive a CI gate that fails the build when any open error of kind: uncaught exists in prod.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

  • :status (String)

    Filter by triage state. `all` (the default) returns every status. (default to 'all')

  • :q (String)

    Case-insensitive substring match against `message`, `errorType`, and `subject`.

  • :limit (Integer)

    Maximum number of rows to return (1–500). Defaults to 200. (default to 200)

Returns:



235
236
237
238
# File 'lib/shipeasy_admin/api/errors_api.rb', line 235

def list_errors(opts = {})
  data, _status_code, _headers = list_errors_with_http_info(opts)
  data
end

#list_errors_with_http_info(opts = {}) ⇒ Array<(Array<ErrorRecord>, Integer, Hash)>

List tracked errors Returns a single page of tracked production errors as a bare JSON array (no pagination envelope), ordered by `lastSeenAt desc`. Filter with `status`, free-text-search with `q`, and cap the page with `limit`. Tracked errors are never filed by hand — an ingestion path (worker log drain / the `see()` SDK reporter) folds each occurrence into a row keyed by `fingerprint`, bumping `count` and `lastSeenAt`. This surface only reads them and (via PATCH) flips their `status`. Use case: Snapshot the project's open issues for a triage dashboard, or drive a CI gate that fails the build when any `open` error of `kind: uncaught` exists in `prod`.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

  • :status (String)

    Filter by triage state. `all` (the default) returns every status. (default to 'all')

  • :q (String)

    Case-insensitive substring match against `message`, `errorType`, and `subject`.

  • :limit (Integer)

    Maximum number of rows to return (1–500). Defaults to 200. (default to 200)

Returns:

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

    Array data, response status code and response headers



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
# File 'lib/shipeasy_admin/api/errors_api.rb', line 248

def list_errors_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ErrorsApi.list_errors ...'
  end
  allowable_values = ["open", "resolved", "ignored", "all"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'q'].nil? && opts[:'q'].to_s.length > 200
    fail ArgumentError, 'invalid value for "opts[:"q"]" when calling ErrorsApi.list_errors, the character length must be smaller than or equal to 200.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ErrorsApi.list_errors, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ErrorsApi.list_errors, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/admin/errors'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ErrorRecord>'

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

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

#update_error_status(id, update_error_status_request, opts = {}) ⇒ ErrorRecord

Update a tracked error's status Flips the triage state of one error — the only mutation this surface allows. Valid transitions are between open, resolved, and ignored; the body must carry exactly { \"status\": … }. A resolved error reopens automatically (ingestion-side) if it recurs; ignored is sticky until flipped back here. Returns the updated row. Use cases - Triage{ \"status\": \"ignored\" } to suppress a known-benign issue from the open list. - Close out{ \"status\": \"resolved\" } once the fix lands; it reopens on its own if the error recurs.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:



319
320
321
322
# File 'lib/shipeasy_admin/api/errors_api.rb', line 319

def update_error_status(id, update_error_status_request, opts = {})
  data, _status_code, _headers = update_error_status_with_http_info(id, update_error_status_request, opts)
  data
end

#update_error_status_with_http_info(id, update_error_status_request, opts = {}) ⇒ Array<(ErrorRecord, Integer, Hash)>

Update a tracked error's status Flips the triage state of one error — the only mutation this surface allows. Valid transitions are between `open`, `resolved`, and `ignored`; the body must carry exactly `{ &quot;status&quot;: … }`. A `resolved` error reopens automatically (ingestion-side) if it recurs; `ignored` is sticky until flipped back here. Returns the updated row. Use cases - Triage — `{ &quot;status&quot;: &quot;ignored&quot; }` to suppress a known-benign issue from the open list. - Close out — `{ &quot;status&quot;: &quot;resolved&quot; }` once the fix lands; it reopens on its own if the error recurs.

Parameters:

  • id (String)

    Stable opaque error id (`err_…`).

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

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Returns:

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

    ErrorRecord data, response status code and response headers



331
332
333
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
381
382
383
384
385
386
387
# File 'lib/shipeasy_admin/api/errors_api.rb', line 331

def update_error_status_with_http_info(id, update_error_status_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ErrorsApi.update_error_status ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ErrorsApi.update_error_status"
  end
  # verify the required parameter 'update_error_status_request' is set
  if @api_client.config.client_side_validation && update_error_status_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_error_status_request' when calling ErrorsApi.update_error_status"
  end
  # resource path
  local_var_path = '/api/admin/errors/{id}'.sub('{id}', CGI.escape(id.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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_error_status_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ErrorRecord'

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

  new_options = opts.merge(
    :operation => :"ErrorsApi.update_error_status",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ErrorsApi#update_error_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end