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



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

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



194
195
196
197
198
199
200
201
202
203
# File 'lib/crowbar/client/app/proposal.rb', line 194

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



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

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



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

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



244
245
246
247
248
249
250
251
252
253
# File 'lib/crowbar/client/app/proposal.rb', line 244

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



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/crowbar/client/app/proposal.rb', line 332

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



133
134
135
136
137
138
139
140
141
142
# File 'lib/crowbar/client/app/proposal.rb', line 133

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