Class: ScalrApiV2::Script
- Inherits:
-
Thor
- Object
- Thor
- ScalrApiV2::Script
- Defined in:
- lib/scalr_api_v2/cli.rb
Overview
define CLI class that extends Thor
Instance Method Summary collapse
- #create ⇒ Object
- #create_version ⇒ Object
- #execute ⇒ Object
- #list ⇒ Object
- #update ⇒ Object
- #versions ⇒ Object
Instance Method Details
#create ⇒ Object
21 22 23 |
# File 'lib/scalr_api_v2/cli.rb', line 21 def create puts JSON.generate(ScalrApiV2::Scripts.new.create([:script_object])) end |
#create_version ⇒ Object
28 29 30 |
# File 'lib/scalr_api_v2/cli.rb', line 28 def create_version puts JSON.generate(ScalrApiV2::Scripts.new.create_version([:script_id], [:script_object])) end |
#execute ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/scalr_api_v2/cli.rb', line 44 def execute if [script_version].nil? puts JSON.generate(ScalrApiV2::Scripts.new.execute([:script_id], [:script_execution_object])) else puts JSON.generate(ScalrApiV2::Scripts.new.execute_version([:script_id], [:script_version], [:script_execution_object])) end end |
#list ⇒ Object
9 10 11 |
# File 'lib/scalr_api_v2/cli.rb', line 9 def list puts JSON.generate(ScalrApiV2::Scripts.new.list) end |
#update ⇒ Object
36 37 38 |
# File 'lib/scalr_api_v2/cli.rb', line 36 def update puts JSON.generate(ScalrApiV2::Scripts.new.update_version([:script_id], [:script_version], [:script_object])) end |
#versions ⇒ Object
15 16 17 |
# File 'lib/scalr_api_v2/cli.rb', line 15 def versions puts JSON.generate(ScalrApiV2::Scripts.new.versions([:script_id])) end |