Class: Conductor::Http::Api::WorkflowBulkResourceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/http/api/workflow_bulk_resource_api.rb

Overview

WorkflowBulkResourceApi - Bulk operations on workflows

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ WorkflowBulkResourceApi

Returns a new instance of WorkflowBulkResourceApi.



12
13
14
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 12

def initialize(api_client = nil)
  @api_client = api_client || ApiClient.new
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



10
11
12
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 10

def api_client
  @api_client
end

Instance Method Details

#pause_workflow(workflow_ids) ⇒ BulkResponse

Pause workflows in bulk

Parameters:

  • workflow_ids (Array<String>)

    List of workflow IDs

Returns:

  • (BulkResponse)


19
20
21
22
23
24
25
26
27
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 19

def pause_workflow(workflow_ids)
  @api_client.call_api(
    '/workflow/bulk/pause',
    'PUT',
    body: workflow_ids,
    return_type: 'BulkResponse',
    return_http_data_only: true
  )
end

#restart(workflow_ids, use_latest_definitions: false) ⇒ BulkResponse

Restart workflows in bulk

Parameters:

  • workflow_ids (Array<String>)

    List of workflow IDs

  • use_latest_definitions (Boolean) (defaults to: false)

    Use latest definitions (default: false)

Returns:

  • (BulkResponse)


46
47
48
49
50
51
52
53
54
55
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 46

def restart(workflow_ids, use_latest_definitions: false)
  @api_client.call_api(
    '/workflow/bulk/restart',
    'POST',
    query_params: { useLatestDefinitions: use_latest_definitions },
    body: workflow_ids,
    return_type: 'BulkResponse',
    return_http_data_only: true
  )
end

#resume_workflow(workflow_ids) ⇒ BulkResponse

Resume workflows in bulk

Parameters:

  • workflow_ids (Array<String>)

    List of workflow IDs

Returns:

  • (BulkResponse)


32
33
34
35
36
37
38
39
40
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 32

def resume_workflow(workflow_ids)
  @api_client.call_api(
    '/workflow/bulk/resume',
    'PUT',
    body: workflow_ids,
    return_type: 'BulkResponse',
    return_http_data_only: true
  )
end

#retry(workflow_ids) ⇒ BulkResponse

Retry workflows in bulk

Parameters:

  • workflow_ids (Array<String>)

    List of workflow IDs

Returns:

  • (BulkResponse)


60
61
62
63
64
65
66
67
68
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 60

def retry(workflow_ids)
  @api_client.call_api(
    '/workflow/bulk/retry',
    'POST',
    body: workflow_ids,
    return_type: 'BulkResponse',
    return_http_data_only: true
  )
end

#terminate(workflow_ids, reason: nil, trigger_failure_workflow: false) ⇒ BulkResponse

Terminate workflows in bulk

Parameters:

  • workflow_ids (Array<String>)

    List of workflow IDs

  • reason (String) (defaults to: nil)

    Termination reason (optional)

  • trigger_failure_workflow (Boolean) (defaults to: false)

    Trigger failure workflow (default: false)

Returns:

  • (BulkResponse)


75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/conductor/http/api/workflow_bulk_resource_api.rb', line 75

def terminate(workflow_ids, reason: nil, trigger_failure_workflow: false)
  query_params = { triggerFailureWorkflow: trigger_failure_workflow }
  query_params[:reason] = reason if reason

  @api_client.call_api(
    '/workflow/bulk/terminate',
    'POST',
    query_params: query_params,
    body: workflow_ids,
    return_type: 'BulkResponse',
    return_http_data_only: true
  )
end