Class: Crowbar::Client::App::Proposal

Inherits:
Base
  • Object
show all
Defined in:
lib/crowbar/client/app/proposal.rb

Overview

A Thor based CLI wrapper for proposal commands

Instance Method Summary collapse

Methods inherited from Base

banner, handle_argument_error, #initialize

Constructor Details

This class inherits a constructor from Crowbar::Client::App::Base

Instance Method Details

#commit(barclamp, proposal) ⇒ Object



321
322
323
324
325
326
327
328
329
330
# File 'lib/crowbar/client/app/proposal.rb', line 321

def commit(barclamp, proposal)
  Command::Proposal::Commit.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end

#create(barclamp, proposal = "default") ⇒ Object



204
205
206
207
208
209
210
211
212
213
# File 'lib/crowbar/client/app/proposal.rb', line 204

def create(barclamp, proposal = "default")
  Command::Proposal::Create.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end

#delete(barclamp, proposal) ⇒ Object



283
284
285
286
287
288
289
290
291
292
# File 'lib/crowbar/client/app/proposal.rb', line 283

def delete(barclamp, proposal)
  Command::Proposal::Delete.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end

#dequeue(barclamp, proposal) ⇒ Object



302
303
304
305
306
307
308
309
310
311
# File 'lib/crowbar/client/app/proposal.rb', line 302

def dequeue(barclamp, proposal)
  Command::Proposal::Dequeue.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end

#edit(barclamp, proposal) ⇒ Object



264
265
266
267
268
269
270
271
272
273
# File 'lib/crowbar/client/app/proposal.rb', line 264

def edit(barclamp, proposal)
  Command::Proposal::Edit.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end

#list(barclamp) ⇒ Object



72
73
74
75
76
77
78
79
80
# File 'lib/crowbar/client/app/proposal.rb', line 72

def list(barclamp)
  Command::Proposal::List.new(
    *command_params(
      barclamp: barclamp
    )
  ).execute
rescue => e
  catch_errors(e)
end

#reset(barclamp, proposal = "default") ⇒ Object



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/crowbar/client/app/proposal.rb', line 352

def reset(barclamp, proposal = "default")
  unless accepts_reset?
    say "Canceled reset"
    return
  end

  Command::Proposal::Reset.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end

#show(barclamp, proposal) ⇒ Object



143
144
145
146
147
148
149
150
151
152
# File 'lib/crowbar/client/app/proposal.rb', line 143

def show(barclamp, proposal)
  Command::Proposal::Show.new(
    *command_params(
      barclamp: barclamp,
      proposal: proposal
    )
  ).execute
rescue => e
  catch_errors(e)
end