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

#change_to_datetime, #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)


664
665
666
# File 'lib/emasser/get.rb', line 664

def self.exit_on_failure?
  true
end

Instance Method Details

#allObject



676
677
678
679
680
681
682
683
684
685
# File 'lib/emasser/get.rb', line 676

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

  result = EmassClient::WorkflowInstancesApi.new.get_system_workflow_instances(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

#byInstanceIdObject



694
695
696
697
698
699
700
701
702
703
# File 'lib/emasser/get.rb', line 694

def byInstanceId
  # opts = Emasser::GET_WORKFLOWINSTANCES_RETURN_TYPE

  result = EmassClient::WorkflowInstancesApi
           .new.get_system_workflow_instances_by_workflow_instance_id(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