Class: Crystil::API::Workflows

Inherits:
Base
  • Object
show all
Defined in:
lib/crystil/api/workflows.rb,
sig/crystil/api/workflows.rbs

Overview

API client for managing workflows

Instance Method Summary collapse

Methods inherited from Base

#build_request, #delete, #get, #handle_response, #initialize, #parse_json_response, #post, #put, #request

Constructor Details

This class inherits a constructor from Crystil::API::Base

Instance Method Details

#create(name:, description: nil) ⇒ Object

Create a new workflow

Parameters:

  • name: (String)
  • description: (String, nil) (defaults to: nil)

Returns:

  • (Object)


13
14
15
# File 'lib/crystil/api/workflows.rb', line 13

def create(name:, description: nil)
  post("/workflows", { name: name, description: description }.compact)
end

#destroy(uuid) ⇒ Object

Delete workflow

Parameters:

  • uuid (String)

Returns:

  • (Object)


29
30
31
# File 'lib/crystil/api/workflows.rb', line 29

def destroy(uuid)
  delete("/workflow/#{uuid}")
end

#details(uuid) ⇒ Object

Get workflow details

Parameters:

  • uuid (String)

Returns:

  • (Object)


18
19
20
# File 'lib/crystil/api/workflows.rb', line 18

def details(uuid)
  get("/workflow/#{uuid}")
end

#invocationCrystil::API::Invocation

Get invocation manager for workflow operations



34
35
36
# File 'lib/crystil/api/workflows.rb', line 34

def invocation
  @invocation ||= Invocation.new(@original_api_url, @api_key, @timeout)
end

#listObject

List all workflows

Returns:

  • (Object)


8
9
10
# File 'lib/crystil/api/workflows.rb', line 8

def list
  get("/workflows")
end

#update(uuid, label:) ⇒ Object

Update workflow label

Parameters:

  • uuid (String)
  • label: (String)

Returns:

  • (Object)


23
24
25
26
# File 'lib/crystil/api/workflows.rb', line 23

def update(uuid, label:)
  body = { label: label }
  put("/workflow/#{uuid}", body)
end