Class: Emasser::WorkflowInstances

Inherits:
SubCommandBase show all
Defined in:
lib/emasser/get.rb

Overview

The Workflow Instances endpoint provides the ability to view detailed information on all active and historical workflows for a system.

Endpoints:

/api/systems/{systemId}/workflow-instances                      - Get workflow instances in a system
/api/systems/{systemId}/workflow-instances/{workflowInstanceId} - Get workflow instance by ID in a system

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SubCommandBase

banner

Methods included from OutputConverters

#to_output_hash

Methods included from InputConverters

#to_input_hash

Methods included from OptionsParser

#optional_options, #required_options

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


583
584
585
# File 'lib/emasser/get.rb', line 583

def self.exit_on_failure?
  true
end

Instance Method Details

#byWorkflowInstanceIdObject



620
621
622
623
624
625
626
627
628
# File 'lib/emasser/get.rb', line 620

def byWorkflowInstanceId
  result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances_by_workflow_instance_id(
    options[:systemId], options[:workflowInstanceId]
  )
  puts to_output_hash(result).green
rescue EmassClient::ApiError => e
  puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances_by_workflow_instance_id'.red
  puts to_output_hash(e)
end

#forSystemObject



598
599
600
601
602
603
604
605
606
607
608
609
# File 'lib/emasser/get.rb', line 598

def forSystem
  optional_options_keys = optional_options(@_initializer).keys
  optional_options = to_input_hash(optional_options_keys, options)

  result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances(
    options[:systemId], optional_options
  )
  puts to_output_hash(result).green
rescue EmassClient::ApiError => e
  puts 'Exception when calling ApprovalChainApi->get_system_workflow_instances'.red
  puts to_output_hash(e)
end