ec2cli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/ec2cli CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
3
3
 
4
- Version = '0.1.0'
4
+ Version = '0.1.1'
5
5
 
6
6
  HISTORY_FILE = File.join((ENV['HOME'] || ENV['USERPROFILE'] || '.'), '.ec2cli_history')
7
7
  HISTSIZE = 500
@@ -39,7 +39,7 @@ module EC2
39
39
  when :DESCRIBE_IMAGES
40
40
  describe_images(parsed.filter, :all => parsed.all)
41
41
  when :RUN_INSTANCES
42
- run_instainces(parsed.image_id)
42
+ run_instainces(parsed.image_id, parsed.options)
43
43
  when :START_INSTANCES
44
44
  start_instainces(parsed.instances)
45
45
  when :STOP_INSTANCES
@@ -157,7 +157,7 @@ module EC2
157
157
  if owner
158
158
  filter.delete_if {|k, v| k == owner[0] }
159
159
  params['Owner.1'] = owner[1].first
160
- elsif not opts[:qll]
160
+ elsif not opts[:all]
161
161
  params['Owner.1'] = 'self'
162
162
  end
163
163
 
@@ -13,7 +13,7 @@ module EC2
13
13
 
14
14
  class Parser < Racc::Parser
15
15
 
16
- module_eval(<<'...end ec2-parser.y/module_eval...', 'ec2-parser.y', 143)
16
+ module_eval(<<'...end ec2-parser.y/module_eval...', 'ec2-parser.y', 155)
17
17
 
18
18
  KEYWORDS = %w(
19
19
  ALL
@@ -106,103 +106,111 @@ end
106
106
  ##### State transition tables begin ###
107
107
 
108
108
  racc_action_table = [
109
- 10, 11, 30, 43, 60, 32, 12, 13, 14, 15,
110
- 58, 53, 59, 16, 30, 17, 63, 28, 57, 27,
111
- 34, 35, 34, 35, 38, 19, 20, 21, 34, 35,
112
- 38, 34, 35, 38, 51, 50, 34, 35, 30, 46,
113
- 30, 26, 25, 54, 55, 56, 24, 23, 43, 22,
114
- 46, 18, 67, 68 ]
109
+ 10, 11, 30, 64, 46, 62, 12, 32, 56, 13,
110
+ 14, 15, 54, 53, 16, 63, 17, 61, 67, 34,
111
+ 35, 38, 34, 35, 19, 20, 21, 34, 35, 38,
112
+ 34, 35, 38, 34, 35, 30, 28, 27, 43, 30,
113
+ 30, 50, 26, 25, 57, 58, 59, 60, 24, 23,
114
+ 43, 22, 46, 18, 71, 72, 73 ]
115
115
 
116
116
  racc_action_check = [
117
- 0, 0, 41, 25, 49, 21, 0, 0, 0, 0,
118
- 48, 41, 49, 0, 19, 0, 54, 18, 48, 17,
119
- 54, 54, 56, 56, 56, 9, 9, 9, 23, 23,
120
- 23, 24, 24, 24, 38, 38, 22, 22, 20, 30,
121
- 32, 16, 15, 43, 44, 46, 14, 13, 53, 12,
122
- 55, 1, 58, 60 ]
117
+ 0, 0, 41, 52, 30, 51, 0, 21, 41, 0,
118
+ 0, 0, 38, 38, 0, 52, 0, 51, 57, 59,
119
+ 59, 59, 57, 57, 9, 9, 9, 23, 23, 23,
120
+ 24, 24, 24, 22, 22, 19, 18, 17, 25, 20,
121
+ 32, 33, 16, 15, 43, 44, 46, 49, 14, 13,
122
+ 56, 12, 58, 1, 60, 62, 64 ]
123
123
 
124
124
  racc_action_pointer = [
125
- -5, 51, nil, nil, nil, nil, nil, nil, nil, 23,
126
- nil, nil, 47, 45, 44, 27, 22, 10, 17, 7,
127
- 31, 2, 15, 7, 10, -6, nil, nil, nil, nil,
128
- 30, nil, 33, nil, nil, nil, nil, nil, 13, nil,
129
- nil, -5, nil, 33, 36, nil, 35, nil, -6, -12,
130
- nil, nil, nil, 39, -1, 41, 1, nil, 30, nil,
131
- 32, nil, nil, nil, nil, nil, nil, nil, nil ]
125
+ -5, 53, nil, nil, nil, nil, nil, nil, nil, 22,
126
+ nil, nil, 49, 47, 46, 26, 22, 28, 36, 28,
127
+ 32, 4, 11, 5, 8, 29, nil, nil, nil, nil,
128
+ -5, nil, 33, 29, nil, nil, nil, nil, -10, nil,
129
+ nil, -5, nil, 34, 37, nil, 36, nil, nil, 34,
130
+ nil, -8, -10, nil, nil, nil, 41, 0, 43, -3,
131
+ 42, nil, 32, nil, 34, nil, nil, nil, nil, nil,
132
+ nil, nil, nil, nil ]
132
133
 
133
134
  racc_action_default = [
134
- -39, -39, -1, -2, -3, -4, -5, -6, -7, -39,
135
- -11, -12, -39, -39, -39, -39, -39, -39, -39, -13,
136
- -13, -39, -39, -39, -39, -39, -29, -30, 69, -8,
137
- -39, -9, -13, -19, -31, -32, -20, -21, -39, -22,
138
- -23, -13, -25, -39, -14, -15, -39, -10, -39, -39,
139
- -35, -37, -24, -39, -39, -39, -39, -33, -39, -34,
140
- -39, -26, -27, -28, -16, -17, -18, -36, -38 ]
135
+ -43, -43, -1, -2, -3, -4, -5, -6, -7, -43,
136
+ -11, -12, -43, -43, -43, -43, -43, -43, -43, -13,
137
+ -13, -43, -43, -43, -43, -43, -33, -34, 74, -8,
138
+ -43, -9, -13, -20, -35, -36, -24, -25, -43, -26,
139
+ -27, -13, -29, -43, -14, -15, -43, -10, -19, -21,
140
+ -22, -43, -43, -39, -41, -28, -43, -43, -43, -43,
141
+ -43, -37, -43, -38, -43, -30, -31, -32, -16, -17,
142
+ -18, -23, -40, -42 ]
141
143
 
142
144
  racc_goto_table = [
143
- 33, 36, 39, 37, 40, 42, 45, 29, 31, 1,
144
- 7, 8, 9, 6, 44, 5, 4, 3, 41, 2,
145
- 47, 48, 49, nil, nil, nil, nil, nil, nil, 52,
146
- nil, 64, 62, 61, 65, nil, 66 ]
145
+ 33, 36, 39, 37, 40, 42, 45, 29, 31, 44,
146
+ 7, 8, 9, 1, 6, 5, 4, 3, 48, 49,
147
+ 47, 41, 2, 51, 52, nil, nil, nil, nil, 55,
148
+ nil, nil, nil, nil, 68, 66, 65, 69, nil, 70 ]
147
149
 
148
150
  racc_goto_check = [
149
- 13, 13, 13, 14, 14, 16, 12, 10, 10, 1,
150
- 7, 8, 9, 6, 11, 5, 4, 3, 15, 2,
151
- 10, 17, 18, nil, nil, nil, nil, nil, nil, 10,
152
- nil, 12, 13, 16, 13, nil, 14 ]
151
+ 13, 13, 13, 14, 14, 18, 12, 10, 10, 11,
152
+ 7, 8, 9, 1, 6, 5, 4, 3, 15, 16,
153
+ 10, 17, 2, 19, 20, nil, nil, nil, nil, 10,
154
+ nil, nil, nil, nil, 12, 13, 18, 13, nil, 14 ]
153
155
 
154
156
  racc_goto_pointer = [
155
- nil, 9, 19, 17, 16, 15, 13, 10, 11, 12,
156
- -12, -16, -24, -22, -20, -7, -20, -17, -16 ]
157
+ nil, 13, 22, 17, 16, 15, 14, 10, 11, 12,
158
+ -12, -21, -24, -22, -20, -15, -14, -4, -20, -15,
159
+ -14 ]
157
160
 
158
161
  racc_goto_default = [
159
162
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
160
- nil, nil, nil, nil, nil, nil, nil, nil, nil ]
163
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
164
+ nil ]
161
165
 
162
166
  racc_reduce_table = [
163
167
  0, 0, :racc_error,
164
- 1, 26, :_reduce_none,
165
- 1, 26, :_reduce_none,
166
- 1, 26, :_reduce_none,
167
- 1, 26, :_reduce_none,
168
- 1, 26, :_reduce_none,
169
- 1, 26, :_reduce_none,
170
- 1, 26, :_reduce_none,
171
- 3, 27, :_reduce_8,
172
- 3, 27, :_reduce_9,
173
- 4, 27, :_reduce_10,
174
- 1, 34, :_reduce_none,
175
- 1, 34, :_reduce_none,
176
- 0, 35, :_reduce_none,
177
- 2, 35, :_reduce_14,
178
- 1, 36, :_reduce_15,
179
- 3, 36, :_reduce_16,
180
- 3, 37, :_reduce_17,
181
- 3, 37, :_reduce_18,
182
- 3, 28, :_reduce_19,
183
- 3, 29, :_reduce_20,
184
- 3, 29, :_reduce_21,
185
- 3, 30, :_reduce_22,
186
- 3, 30, :_reduce_23,
187
- 4, 31, :_reduce_24,
188
- 1, 40, :_reduce_25,
189
- 3, 40, :_reduce_26,
190
- 3, 41, :_reduce_27,
191
- 3, 41, :_reduce_28,
192
- 2, 32, :_reduce_29,
193
- 2, 33, :_reduce_30,
194
- 1, 38, :_reduce_none,
195
- 1, 38, :_reduce_none,
196
- 3, 39, :_reduce_33,
197
- 3, 39, :_reduce_34,
198
- 1, 42, :_reduce_35,
199
- 3, 42, :_reduce_36,
200
- 1, 43, :_reduce_37,
201
- 3, 43, :_reduce_38 ]
202
-
203
- racc_reduce_n = 39
204
-
205
- racc_shift_n = 69
168
+ 1, 27, :_reduce_none,
169
+ 1, 27, :_reduce_none,
170
+ 1, 27, :_reduce_none,
171
+ 1, 27, :_reduce_none,
172
+ 1, 27, :_reduce_none,
173
+ 1, 27, :_reduce_none,
174
+ 1, 27, :_reduce_none,
175
+ 3, 28, :_reduce_8,
176
+ 3, 28, :_reduce_9,
177
+ 4, 28, :_reduce_10,
178
+ 1, 35, :_reduce_none,
179
+ 1, 35, :_reduce_none,
180
+ 0, 36, :_reduce_none,
181
+ 2, 36, :_reduce_14,
182
+ 1, 37, :_reduce_15,
183
+ 3, 37, :_reduce_16,
184
+ 3, 38, :_reduce_17,
185
+ 3, 38, :_reduce_18,
186
+ 4, 29, :_reduce_19,
187
+ 0, 41, :_reduce_none,
188
+ 1, 41, :_reduce_none,
189
+ 1, 42, :_reduce_22,
190
+ 3, 42, :_reduce_23,
191
+ 3, 30, :_reduce_24,
192
+ 3, 30, :_reduce_25,
193
+ 3, 31, :_reduce_26,
194
+ 3, 31, :_reduce_27,
195
+ 4, 32, :_reduce_28,
196
+ 1, 43, :_reduce_29,
197
+ 3, 43, :_reduce_30,
198
+ 3, 44, :_reduce_31,
199
+ 3, 44, :_reduce_32,
200
+ 2, 33, :_reduce_33,
201
+ 2, 34, :_reduce_34,
202
+ 1, 39, :_reduce_none,
203
+ 1, 39, :_reduce_none,
204
+ 3, 40, :_reduce_37,
205
+ 3, 40, :_reduce_38,
206
+ 1, 45, :_reduce_39,
207
+ 3, 45, :_reduce_40,
208
+ 1, 46, :_reduce_41,
209
+ 3, 46, :_reduce_42 ]
210
+
211
+ racc_reduce_n = 43
212
+
213
+ racc_shift_n = 74
206
214
 
207
215
  racc_token_table = {
208
216
  false => 0,
@@ -217,21 +225,22 @@ racc_token_table = {
217
225
  :IDENTIFIER => 9,
218
226
  :EQ => 10,
219
227
  :RUN => 11,
220
- :START => 12,
221
- :STOP => 13,
222
- :SET => 14,
223
- :TAGS => 15,
224
- "," => 16,
225
- :NULL => 17,
226
- :SHOW => 18,
227
- :REGIONS => 19,
228
- :USE => 20,
229
- :STRING => 21,
230
- :NUMBER => 22,
231
- "(" => 23,
232
- ")" => 24 }
233
-
234
- racc_nt_base = 25
228
+ :run_option => 12,
229
+ "," => 13,
230
+ :START => 14,
231
+ :STOP => 15,
232
+ :SET => 16,
233
+ :TAGS => 17,
234
+ :NULL => 18,
235
+ :SHOW => 19,
236
+ :REGIONS => 20,
237
+ :USE => 21,
238
+ :STRING => 22,
239
+ :NUMBER => 23,
240
+ "(" => 24,
241
+ ")" => 25 }
242
+
243
+ racc_nt_base = 26
235
244
 
236
245
  racc_use_result_var = false
237
246
 
@@ -264,11 +273,12 @@ Racc_token_to_s_table = [
264
273
  "IDENTIFIER",
265
274
  "EQ",
266
275
  "RUN",
276
+ "run_option",
277
+ "\",\"",
267
278
  "START",
268
279
  "STOP",
269
280
  "SET",
270
281
  "TAGS",
271
- "\",\"",
272
282
  "NULL",
273
283
  "SHOW",
274
284
  "REGIONS",
@@ -292,6 +302,8 @@ Racc_token_to_s_table = [
292
302
  "expr",
293
303
  "value",
294
304
  "value_list",
305
+ "run_option_clause",
306
+ "run_option_list",
295
307
  "attr_list",
296
308
  "attr",
297
309
  "number_list",
@@ -381,129 +393,147 @@ module_eval(<<'.,.,', 'ec2-parser.y', 47)
381
393
 
382
394
  module_eval(<<'.,.,', 'ec2-parser.y', 52)
383
395
  def _reduce_19(val, _values)
384
- struct(:RUN_INSTANCES, :image_id => val[2])
396
+ struct(:RUN_INSTANCES, :image_id => val[2], :options => val[3])
385
397
 
386
398
  end
387
399
  .,.,
388
400
 
389
- module_eval(<<'.,.,', 'ec2-parser.y', 57)
390
- def _reduce_20(val, _values)
401
+ # reduce 20 omitted
402
+
403
+ # reduce 21 omitted
404
+
405
+ module_eval(<<'.,.,', 'ec2-parser.y', 60)
406
+ def _reduce_22(val, _values)
407
+ [val[0]]
408
+
409
+ end
410
+ .,.,
411
+
412
+ module_eval(<<'.,.,', 'ec2-parser.y', 64)
413
+ def _reduce_23(val, _values)
414
+ val[0] + [val[2]]
415
+
416
+ end
417
+ .,.,
418
+
419
+ module_eval(<<'.,.,', 'ec2-parser.y', 69)
420
+ def _reduce_24(val, _values)
391
421
  struct(:START_INSTANCES, :instances => [val[2]])
392
422
 
393
423
  end
394
424
  .,.,
395
425
 
396
- module_eval(<<'.,.,', 'ec2-parser.y', 61)
397
- def _reduce_21(val, _values)
426
+ module_eval(<<'.,.,', 'ec2-parser.y', 73)
427
+ def _reduce_25(val, _values)
398
428
  struct(:START_INSTANCES, :instances => val[2])
399
429
 
400
430
  end
401
431
  .,.,
402
432
 
403
- module_eval(<<'.,.,', 'ec2-parser.y', 66)
404
- def _reduce_22(val, _values)
433
+ module_eval(<<'.,.,', 'ec2-parser.y', 78)
434
+ def _reduce_26(val, _values)
405
435
  struct(:STOP_INSTANCES, :instances => [val[2]])
406
436
 
407
437
  end
408
438
  .,.,
409
439
 
410
- module_eval(<<'.,.,', 'ec2-parser.y', 70)
411
- def _reduce_23(val, _values)
440
+ module_eval(<<'.,.,', 'ec2-parser.y', 82)
441
+ def _reduce_27(val, _values)
412
442
  struct(:STOP_INSTANCES, :instances => val[2])
413
443
 
414
444
  end
415
445
  .,.,
416
446
 
417
- module_eval(<<'.,.,', 'ec2-parser.y', 75)
418
- def _reduce_24(val, _values)
447
+ module_eval(<<'.,.,', 'ec2-parser.y', 87)
448
+ def _reduce_28(val, _values)
419
449
  struct(:CREATE_TAGS, :tags => val[2], :filter => val[3])
420
450
 
421
451
  end
422
452
  .,.,
423
453
 
424
- module_eval(<<'.,.,', 'ec2-parser.y', 80)
425
- def _reduce_25(val, _values)
454
+ module_eval(<<'.,.,', 'ec2-parser.y', 92)
455
+ def _reduce_29(val, _values)
426
456
  [val[0]]
427
457
 
428
458
  end
429
459
  .,.,
430
460
 
431
- module_eval(<<'.,.,', 'ec2-parser.y', 84)
432
- def _reduce_26(val, _values)
461
+ module_eval(<<'.,.,', 'ec2-parser.y', 96)
462
+ def _reduce_30(val, _values)
433
463
  val[0] + [val[2]]
434
464
 
435
465
  end
436
466
  .,.,
437
467
 
438
- module_eval(<<'.,.,', 'ec2-parser.y', 89)
439
- def _reduce_27(val, _values)
468
+ module_eval(<<'.,.,', 'ec2-parser.y', 101)
469
+ def _reduce_31(val, _values)
440
470
  [val[0], val[2]]
441
471
 
442
472
  end
443
473
  .,.,
444
474
 
445
- module_eval(<<'.,.,', 'ec2-parser.y', 93)
446
- def _reduce_28(val, _values)
475
+ module_eval(<<'.,.,', 'ec2-parser.y', 105)
476
+ def _reduce_32(val, _values)
447
477
  [val[0], nil]
448
478
 
449
479
  end
450
480
  .,.,
451
481
 
452
- module_eval(<<'.,.,', 'ec2-parser.y', 98)
453
- def _reduce_29(val, _values)
482
+ module_eval(<<'.,.,', 'ec2-parser.y', 110)
483
+ def _reduce_33(val, _values)
454
484
  struct(:SHOW_REGIONS)
455
485
 
456
486
  end
457
487
  .,.,
458
488
 
459
- module_eval(<<'.,.,', 'ec2-parser.y', 103)
460
- def _reduce_30(val, _values)
489
+ module_eval(<<'.,.,', 'ec2-parser.y', 115)
490
+ def _reduce_34(val, _values)
461
491
  struct(:USE, :endpoint_or_region => val[1])
462
492
 
463
493
  end
464
494
  .,.,
465
495
 
466
- # reduce 31 omitted
496
+ # reduce 35 omitted
467
497
 
468
- # reduce 32 omitted
498
+ # reduce 36 omitted
469
499
 
470
- module_eval(<<'.,.,', 'ec2-parser.y', 110)
471
- def _reduce_33(val, _values)
500
+ module_eval(<<'.,.,', 'ec2-parser.y', 122)
501
+ def _reduce_37(val, _values)
472
502
  val[1]
473
503
 
474
504
  end
475
505
  .,.,
476
506
 
477
- module_eval(<<'.,.,', 'ec2-parser.y', 114)
478
- def _reduce_34(val, _values)
507
+ module_eval(<<'.,.,', 'ec2-parser.y', 126)
508
+ def _reduce_38(val, _values)
479
509
  val[1]
480
510
 
481
511
  end
482
512
  .,.,
483
513
 
484
- module_eval(<<'.,.,', 'ec2-parser.y', 119)
485
- def _reduce_35(val, _values)
514
+ module_eval(<<'.,.,', 'ec2-parser.y', 131)
515
+ def _reduce_39(val, _values)
486
516
  [val[0]]
487
517
 
488
518
  end
489
519
  .,.,
490
520
 
491
- module_eval(<<'.,.,', 'ec2-parser.y', 123)
492
- def _reduce_36(val, _values)
521
+ module_eval(<<'.,.,', 'ec2-parser.y', 135)
522
+ def _reduce_40(val, _values)
493
523
  val[0] + [val[2]]
494
524
 
495
525
  end
496
526
  .,.,
497
527
 
498
- module_eval(<<'.,.,', 'ec2-parser.y', 128)
499
- def _reduce_37(val, _values)
528
+ module_eval(<<'.,.,', 'ec2-parser.y', 140)
529
+ def _reduce_41(val, _values)
500
530
  [val[0]]
501
531
 
502
532
  end
503
533
  .,.,
504
534
 
505
- module_eval(<<'.,.,', 'ec2-parser.y', 132)
506
- def _reduce_38(val, _values)
535
+ module_eval(<<'.,.,', 'ec2-parser.y', 144)
536
+ def _reduce_42(val, _values)
507
537
  val[0] + [val[2]]
508
538
 
509
539
  end
@@ -48,11 +48,23 @@ rule
48
48
  [val[0], val[2]]
49
49
  }
50
50
 
51
- run_stmt : RUN INSTANCES value
51
+ run_stmt : RUN INSTANCES value run_option_clause
52
52
  {
53
- struct(:RUN_INSTANCES, :image_id => val[2])
53
+ struct(:RUN_INSTANCES, :image_id => val[2], :options => val[3])
54
54
  }
55
55
 
56
+ run_option_clause :
57
+ | run_option_list
58
+
59
+ run_option_list : run_option
60
+ {
61
+ [val[0]]
62
+ }
63
+ | run_option_list ',' run_option
64
+ {
65
+ val[0] + [val[2]]
66
+ }
67
+
56
68
  start_stmt : START INSTANCES value
57
69
  {
58
70
  struct(:START_INSTANCES, :instances => [val[2]])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: