Class: Hatchet::Features::Workflows
- Inherits:
-
Object
- Object
- Hatchet::Features::Workflows
- Defined in:
- lib/hatchet/features/workflows.rb
Overview
Workflows client for managing workflow definitions within Hatchet
Note that workflows are the declaration, not the individual runs. If you’re looking for runs, use the Runs client instead.
Instance Method Summary collapse
-
#delete(workflow_id) ⇒ void
Permanently delete a workflow.
-
#get(workflow_id) ⇒ Object
Get a workflow by its ID.
-
#get_version(workflow_id, version: nil) ⇒ Object
Get a workflow version by the workflow ID and an optional version.
-
#initialize(rest_client, config) ⇒ void
constructor
Initializes a new Workflows client instance.
-
#list(workflow_name: nil, limit: nil, offset: nil) ⇒ Object
List all workflows in the tenant matching optional filters.
Constructor Details
#initialize(rest_client, config) ⇒ void
Initializes a new Workflows client instance
24 25 26 27 28 |
# File 'lib/hatchet/features/workflows.rb', line 24 def initialize(rest_client, config) @rest_client = rest_client @config = config @workflow_api = HatchetSdkRest::WorkflowApi.new(rest_client) end |
Instance Method Details
#delete(workflow_id) ⇒ void
This method returns an undefined value.
Permanently delete a workflow
**DANGEROUS: This will delete a workflow and all of its data**
82 83 84 |
# File 'lib/hatchet/features/workflows.rb', line 82 def delete(workflow_id) @workflow_api.workflow_delete(workflow_id) end |
#get(workflow_id) ⇒ Object
Get a workflow by its ID
37 38 39 |
# File 'lib/hatchet/features/workflows.rb', line 37 def get(workflow_id) @workflow_api.workflow_get(workflow_id) end |
#get_version(workflow_id, version: nil) ⇒ Object
Get a workflow version by the workflow ID and an optional version
69 70 71 |
# File 'lib/hatchet/features/workflows.rb', line 69 def get_version(workflow_id, version: nil) @workflow_api.workflow_version_get(workflow_id, { version: version }) end |
#list(workflow_name: nil, limit: nil, offset: nil) ⇒ Object
List all workflows in the tenant matching optional filters
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/hatchet/features/workflows.rb', line 50 def list(workflow_name: nil, limit: nil, offset: nil) @workflow_api.workflow_list( @config.tenant_id, { limit: limit, offset: offset, name: workflow_name ? @config.apply_namespace(workflow_name) : nil, }, ) end |