Class: HatchetSdkRest::WorkflowRunsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WorkflowRunsApi

Returns a new instance of WorkflowRunsApi.



19
20
21
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_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/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#v1_workflow_run_create(tenant, v1_trigger_workflow_run_request, opts = {}) ⇒ V1WorkflowRunDetails

Create workflow run Trigger a new workflow run

Parameters:

  • tenant (String)

    The tenant id

  • v1_trigger_workflow_run_request (V1TriggerWorkflowRunRequest)

    The workflow run to create

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 28

def v1_workflow_run_create(tenant, v1_trigger_workflow_run_request, opts = {})
  data, _status_code, _headers = v1_workflow_run_create_with_http_info(tenant, v1_trigger_workflow_run_request, opts)
  data
end

#v1_workflow_run_create_with_http_info(tenant, v1_trigger_workflow_run_request, opts = {}) ⇒ Array<(V1WorkflowRunDetails, Integer, Hash)>

Create workflow run Trigger a new workflow run

Parameters:

  • tenant (String)

    The tenant id

  • v1_trigger_workflow_run_request (V1TriggerWorkflowRunRequest)

    The workflow run to create

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

    the optional parameters

Returns:

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

    V1WorkflowRunDetails 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 39

def v1_workflow_run_create_with_http_info(tenant, v1_trigger_workflow_run_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_create ...'
  end
  # verify the required parameter 'tenant' is set
  if @api_client.config.client_side_validation && tenant.nil?
    fail ArgumentError, "Missing the required parameter 'tenant' when calling WorkflowRunsApi.v1_workflow_run_create"
  end
  if @api_client.config.client_side_validation && tenant.to_s.length > 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_create, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && tenant.to_s.length < 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_create, the character length must be greater than or equal to 36.'
  end

  # verify the required parameter 'v1_trigger_workflow_run_request' is set
  if @api_client.config.client_side_validation && v1_trigger_workflow_run_request.nil?
    fail ArgumentError, "Missing the required parameter 'v1_trigger_workflow_run_request' when calling WorkflowRunsApi.v1_workflow_run_create"
  end
  # resource path
  local_var_path = '/api/v1/stable/tenants/{tenant}/workflow-runs/trigger'.sub('{' + 'tenant' + '}', CGI.escape(tenant.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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_display_names_list(tenant, external_ids, opts = {}) ⇒ V1WorkflowRunDisplayNameList

List workflow runs Lists displayable names of workflow runs for a tenant

Parameters:

  • tenant (String)

    The tenant id

  • external_ids (Array<String>)

    The external ids of the workflow runs to get display names for

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

    the optional parameters

Returns:



110
111
112
113
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 110

def v1_workflow_run_display_names_list(tenant, external_ids, opts = {})
  data, _status_code, _headers = v1_workflow_run_display_names_list_with_http_info(tenant, external_ids, opts)
  data
end

#v1_workflow_run_display_names_list_with_http_info(tenant, external_ids, opts = {}) ⇒ Array<(V1WorkflowRunDisplayNameList, Integer, Hash)>

List workflow runs Lists displayable names of workflow runs for a tenant

Parameters:

  • tenant (String)

    The tenant id

  • external_ids (Array<String>)

    The external ids of the workflow runs to get display names for

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

    the optional parameters

Returns:



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
174
175
176
177
178
179
180
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 121

def v1_workflow_run_display_names_list_with_http_info(tenant, external_ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_display_names_list ...'
  end
  # verify the required parameter 'tenant' is set
  if @api_client.config.client_side_validation && tenant.nil?
    fail ArgumentError, "Missing the required parameter 'tenant' when calling WorkflowRunsApi.v1_workflow_run_display_names_list"
  end
  if @api_client.config.client_side_validation && tenant.to_s.length > 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_display_names_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && tenant.to_s.length < 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_display_names_list, the character length must be greater than or equal to 36.'
  end

  # verify the required parameter 'external_ids' is set
  if @api_client.config.client_side_validation && external_ids.nil?
    fail ArgumentError, "Missing the required parameter 'external_ids' when calling WorkflowRunsApi.v1_workflow_run_display_names_list"
  end
  # resource path
  local_var_path = '/api/v1/stable/tenants/{tenant}/workflow-runs/display-names'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'external_ids'] = @api_client.build_collection_param(external_ids, :multi)

  # 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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_external_ids_list(tenant, since, opts = {}) ⇒ Array<String>

List workflow run external ids Lists external ids for workflow runs matching filters

Parameters:

  • tenant (String)

    The tenant id

  • since (Time)

    The earliest date to filter by

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

    the optional parameters

Options Hash (opts):

  • :statuses (Array<V1TaskStatus>)

    A list of statuses to filter by

  • :_until (Time)

    The latest date to filter by

  • :additional_metadata (Array<String>)

    Additional metadata k-v pairs to filter by

  • :workflow_ids (Array<String>)

    The workflow ids to find runs for

Returns:

  • (Array<String>)


192
193
194
195
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 192

def v1_workflow_run_external_ids_list(tenant, since, opts = {})
  data, _status_code, _headers = v1_workflow_run_external_ids_list_with_http_info(tenant, since, opts)
  data
end

#v1_workflow_run_external_ids_list_with_http_info(tenant, since, opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

List workflow run external ids Lists external ids for workflow runs matching filters

Parameters:

  • tenant (String)

    The tenant id

  • since (Time)

    The earliest date to filter by

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

    the optional parameters

Options Hash (opts):

  • :statuses (Array<V1TaskStatus>)

    A list of statuses to filter by

  • :_until (Time)

    The latest date to filter by

  • :additional_metadata (Array<String>)

    Additional metadata k-v pairs to filter by

  • :workflow_ids (Array<String>)

    The workflow ids to find runs for

Returns:

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

    Array<String> data, response status code and response headers



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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 207

def v1_workflow_run_external_ids_list_with_http_info(tenant, since, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_external_ids_list ...'
  end
  # verify the required parameter 'tenant' is set
  if @api_client.config.client_side_validation && tenant.nil?
    fail ArgumentError, "Missing the required parameter 'tenant' when calling WorkflowRunsApi.v1_workflow_run_external_ids_list"
  end
  if @api_client.config.client_side_validation && tenant.to_s.length > 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_external_ids_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && tenant.to_s.length < 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_external_ids_list, the character length must be greater than or equal to 36.'
  end

  # verify the required parameter 'since' is set
  if @api_client.config.client_side_validation && since.nil?
    fail ArgumentError, "Missing the required parameter 'since' when calling WorkflowRunsApi.v1_workflow_run_external_ids_list"
  end
  # resource path
  local_var_path = '/api/v1/stable/tenants/{tenant}/workflow-runs/external-ids'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'since'] = since
  query_params[:'statuses'] = @api_client.build_collection_param(opts[:'statuses'], :multi) if !opts[:'statuses'].nil?
  query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
  query_params[:'additional_metadata'] = @api_client.build_collection_param(opts[:'additional_metadata'], :multi) if !opts[:'additional_metadata'].nil?
  query_params[:'workflow_ids'] = @api_client.build_collection_param(opts[:'workflow_ids'], :multi) if !opts[:'workflow_ids'].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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_get(v1_workflow_run, opts = {}) ⇒ V1WorkflowRunDetails

List tasks Get a workflow run and its metadata to display on the "detail" page

Parameters:

  • v1_workflow_run (String)

    The workflow run id to get

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

    the optional parameters

Returns:



277
278
279
280
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 277

def v1_workflow_run_get(v1_workflow_run, opts = {})
  data, _status_code, _headers = v1_workflow_run_get_with_http_info(v1_workflow_run, opts)
  data
end

#v1_workflow_run_get_status(v1_workflow_run, opts = {}) ⇒ V1TaskStatus

Get workflow run status Get the status of a workflow run.

Parameters:

  • v1_workflow_run (String)

    The workflow run id to get the status for

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

    the optional parameters

Returns:



348
349
350
351
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 348

def v1_workflow_run_get_status(v1_workflow_run, opts = {})
  data, _status_code, _headers = v1_workflow_run_get_status_with_http_info(v1_workflow_run, opts)
  data
end

#v1_workflow_run_get_status_with_http_info(v1_workflow_run, opts = {}) ⇒ Array<(V1TaskStatus, Integer, Hash)>

Get workflow run status Get the status of a workflow run.

Parameters:

  • v1_workflow_run (String)

    The workflow run id to get the status for

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

    the optional parameters

Returns:

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

    V1TaskStatus data, response status code and response headers



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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 358

def v1_workflow_run_get_status_with_http_info(v1_workflow_run, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_get_status ...'
  end
  # verify the required parameter 'v1_workflow_run' is set
  if @api_client.config.client_side_validation && v1_workflow_run.nil?
    fail ArgumentError, "Missing the required parameter 'v1_workflow_run' when calling WorkflowRunsApi.v1_workflow_run_get_status"
  end
  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length > 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_get_status, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length < 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_get_status, the character length must be greater than or equal to 36.'
  end

  # resource path
  local_var_path = '/api/v1/stable/workflow-runs/{v1-workflow-run}/status'.sub('{' + 'v1-workflow-run' + '}', CGI.escape(v1_workflow_run.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_get_timings(v1_workflow_run, opts = {}) ⇒ V1TaskTimingList

List timings for a workflow run Get the timings for a workflow run

Parameters:

  • v1_workflow_run (String)

    The workflow run id to get

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

    the optional parameters

Options Hash (opts):

  • :depth (Integer)

    The depth to retrieve children

Returns:



420
421
422
423
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 420

def v1_workflow_run_get_timings(v1_workflow_run, opts = {})
  data, _status_code, _headers = v1_workflow_run_get_timings_with_http_info(v1_workflow_run, opts)
  data
end

#v1_workflow_run_get_timings_with_http_info(v1_workflow_run, opts = {}) ⇒ Array<(V1TaskTimingList, Integer, Hash)>

List timings for a workflow run Get the timings for a workflow run

Parameters:

  • v1_workflow_run (String)

    The workflow run id to get

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

    the optional parameters

Options Hash (opts):

  • :depth (Integer)

    The depth to retrieve children

Returns:

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

    V1TaskTimingList data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 431

def v1_workflow_run_get_timings_with_http_info(v1_workflow_run, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_get_timings ...'
  end
  # verify the required parameter 'v1_workflow_run' is set
  if @api_client.config.client_side_validation && v1_workflow_run.nil?
    fail ArgumentError, "Missing the required parameter 'v1_workflow_run' when calling WorkflowRunsApi.v1_workflow_run_get_timings"
  end
  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length > 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_get_timings, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length < 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_get_timings, the character length must be greater than or equal to 36.'
  end

  # resource path
  local_var_path = '/api/v1/stable/workflow-runs/{v1-workflow-run}/task-timings'.sub('{' + 'v1-workflow-run' + '}', CGI.escape(v1_workflow_run.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_get_with_http_info(v1_workflow_run, opts = {}) ⇒ Array<(V1WorkflowRunDetails, Integer, Hash)>

List tasks Get a workflow run and its metadata to display on the &quot;detail&quot; page

Parameters:

  • v1_workflow_run (String)

    The workflow run id to get

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

    the optional parameters

Returns:

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

    V1WorkflowRunDetails data, response status code and response headers



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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 287

def v1_workflow_run_get_with_http_info(v1_workflow_run, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_get ...'
  end
  # verify the required parameter 'v1_workflow_run' is set
  if @api_client.config.client_side_validation && v1_workflow_run.nil?
    fail ArgumentError, "Missing the required parameter 'v1_workflow_run' when calling WorkflowRunsApi.v1_workflow_run_get"
  end
  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length > 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_get, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length < 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_get, the character length must be greater than or equal to 36.'
  end

  # resource path
  local_var_path = '/api/v1/stable/workflow-runs/{v1-workflow-run}'.sub('{' + 'v1-workflow-run' + '}', CGI.escape(v1_workflow_run.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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_list(tenant, since, only_tasks, opts = {}) ⇒ V1TaskSummaryList

List workflow runs Lists workflow runs for a tenant.

Parameters:

  • tenant (String)

    The tenant id

  • since (Time)

    The earliest date to filter by

  • only_tasks (Boolean)

    Whether to include DAGs or only to include tasks

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The number to skip

  • :limit (Integer)

    The number to limit by

  • :statuses (Array<V1TaskStatus>)

    A list of statuses to filter by

  • :_until (Time)

    The latest date to filter by

  • :additional_metadata (Array<String>)

    Additional metadata k-v pairs to filter by

  • :workflow_ids (Array<String>)

    The workflow ids to find runs for

  • :worker_id (String)

    The worker id to filter by

  • :parent_task_external_id (String)

    The parent task external id to filter by

  • :triggering_event_external_id (String)

    The external id of the event that triggered the workflow run

  • :include_payloads (Boolean)

    A flag for whether or not to include the input and output payloads in the response. Defaults to &#x60;true&#x60; if unset.

Returns:



505
506
507
508
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 505

def v1_workflow_run_list(tenant, since, only_tasks, opts = {})
  data, _status_code, _headers = v1_workflow_run_list_with_http_info(tenant, since, only_tasks, opts)
  data
end

#v1_workflow_run_list_with_http_info(tenant, since, only_tasks, opts = {}) ⇒ Array<(V1TaskSummaryList, Integer, Hash)>

List workflow runs Lists workflow runs for a tenant.

Parameters:

  • tenant (String)

    The tenant id

  • since (Time)

    The earliest date to filter by

  • only_tasks (Boolean)

    Whether to include DAGs or only to include tasks

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The number to skip

  • :limit (Integer)

    The number to limit by

  • :statuses (Array<V1TaskStatus>)

    A list of statuses to filter by

  • :_until (Time)

    The latest date to filter by

  • :additional_metadata (Array<String>)

    Additional metadata k-v pairs to filter by

  • :workflow_ids (Array<String>)

    The workflow ids to find runs for

  • :worker_id (String)

    The worker id to filter by

  • :parent_task_external_id (String)

    The parent task external id to filter by

  • :triggering_event_external_id (String)

    The external id of the event that triggered the workflow run

  • :include_payloads (Boolean)

    A flag for whether or not to include the input and output payloads in the response. Defaults to &#x60;true&#x60; if unset.

Returns:

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

    V1TaskSummaryList data, response status code and response headers



527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
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
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 527

def v1_workflow_run_list_with_http_info(tenant, since, only_tasks, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_list ...'
  end
  # verify the required parameter 'tenant' is set
  if @api_client.config.client_side_validation && tenant.nil?
    fail ArgumentError, "Missing the required parameter 'tenant' when calling WorkflowRunsApi.v1_workflow_run_list"
  end
  if @api_client.config.client_side_validation && tenant.to_s.length > 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && tenant.to_s.length < 36
    fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be greater than or equal to 36.'
  end

  # verify the required parameter 'since' is set
  if @api_client.config.client_side_validation && since.nil?
    fail ArgumentError, "Missing the required parameter 'since' when calling WorkflowRunsApi.v1_workflow_run_list"
  end
  # verify the required parameter 'only_tasks' is set
  if @api_client.config.client_side_validation && only_tasks.nil?
    fail ArgumentError, "Missing the required parameter 'only_tasks' when calling WorkflowRunsApi.v1_workflow_run_list"
  end
  if @api_client.config.client_side_validation && !opts[:'worker_id'].nil? && opts[:'worker_id'].to_s.length > 36
    fail ArgumentError, 'invalid value for "opts[:"worker_id"]" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && !opts[:'worker_id'].nil? && opts[:'worker_id'].to_s.length < 36
    fail ArgumentError, 'invalid value for "opts[:"worker_id"]" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be greater than or equal to 36.'
  end

  if @api_client.config.client_side_validation && !opts[:'parent_task_external_id'].nil? && opts[:'parent_task_external_id'].to_s.length > 36
    fail ArgumentError, 'invalid value for "opts[:"parent_task_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && !opts[:'parent_task_external_id'].nil? && opts[:'parent_task_external_id'].to_s.length < 36
    fail ArgumentError, 'invalid value for "opts[:"parent_task_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be greater than or equal to 36.'
  end

  if @api_client.config.client_side_validation && !opts[:'triggering_event_external_id'].nil? && opts[:'triggering_event_external_id'].to_s.length > 36
    fail ArgumentError, 'invalid value for "opts[:"triggering_event_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && !opts[:'triggering_event_external_id'].nil? && opts[:'triggering_event_external_id'].to_s.length < 36
    fail ArgumentError, 'invalid value for "opts[:"triggering_event_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_list, the character length must be greater than or equal to 36.'
  end

  # resource path
  local_var_path = '/api/v1/stable/tenants/{tenant}/workflow-runs'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'since'] = since
  query_params[:'only_tasks'] = only_tasks
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'statuses'] = @api_client.build_collection_param(opts[:'statuses'], :multi) if !opts[:'statuses'].nil?
  query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
  query_params[:'additional_metadata'] = @api_client.build_collection_param(opts[:'additional_metadata'], :multi) if !opts[:'additional_metadata'].nil?
  query_params[:'workflow_ids'] = @api_client.build_collection_param(opts[:'workflow_ids'], :multi) if !opts[:'workflow_ids'].nil?
  query_params[:'worker_id'] = opts[:'worker_id'] if !opts[:'worker_id'].nil?
  query_params[:'parent_task_external_id'] = opts[:'parent_task_external_id'] if !opts[:'parent_task_external_id'].nil?
  query_params[:'triggering_event_external_id'] = opts[:'triggering_event_external_id'] if !opts[:'triggering_event_external_id'].nil?
  query_params[:'include_payloads'] = opts[:'include_payloads'] if !opts[:'include_payloads'].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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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

#v1_workflow_run_task_events_list(v1_workflow_run, opts = {}) ⇒ V1TaskEventList

List tasks List all tasks for a workflow run

Parameters:

  • v1_workflow_run (String)

    The workflow run id to find runs for

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The number to skip

  • :limit (Integer)

    The number to limit by

Returns:



634
635
636
637
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 634

def v1_workflow_run_task_events_list(v1_workflow_run, opts = {})
  data, _status_code, _headers = v1_workflow_run_task_events_list_with_http_info(v1_workflow_run, opts)
  data
end

#v1_workflow_run_task_events_list_with_http_info(v1_workflow_run, opts = {}) ⇒ Array<(V1TaskEventList, Integer, Hash)>

List tasks List all tasks for a workflow run

Parameters:

  • v1_workflow_run (String)

    The workflow run id to find runs for

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The number to skip

  • :limit (Integer)

    The number to limit by

Returns:

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

    V1TaskEventList data, response status code and response headers



646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb', line 646

def v1_workflow_run_task_events_list_with_http_info(v1_workflow_run, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_task_events_list ...'
  end
  # verify the required parameter 'v1_workflow_run' is set
  if @api_client.config.client_side_validation && v1_workflow_run.nil?
    fail ArgumentError, "Missing the required parameter 'v1_workflow_run' when calling WorkflowRunsApi.v1_workflow_run_task_events_list"
  end
  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length > 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_task_events_list, the character length must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && v1_workflow_run.to_s.length < 36
    fail ArgumentError, 'invalid value for "v1_workflow_run" when calling WorkflowRunsApi.v1_workflow_run_task_events_list, the character length must be greater than or equal to 36.'
  end

  # resource path
  local_var_path = '/api/v1/stable/workflow-runs/{v1-workflow-run}/task-events'.sub('{' + 'v1-workflow-run' + '}', CGI.escape(v1_workflow_run.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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']

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']

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