zillabyte-cli 0.1.7 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjFiZWM2YzdkZGQwZTI0OWQzOWVlMjViNTM5YmY0NmVlMDM4MjFjMg==
4
+ ZDQ2N2E3MWI0OWM1MWYxNDkyNTZkMWIxNGVjZTkxZDIxOWYwNTBhMg==
5
5
  data.tar.gz: !binary |-
6
- OGQ1NjRiYTQ2M2E0MWMyMzFhOTU3Yzg0MTMxZjJhODdiN2YyNzJkNA==
6
+ N2U0ZDZjYmVlYWU5Mzg3MGI2NWYxYmU4MDhiMGJkY2MyZGQwMzQ0OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWRlMDM0NDc2NDhjODc2MDhiMDllZGQwOTc0YmE5YWRiYjYxMzg3YzZiNmEz
10
- ZjMyYWFmNTM0NTE4NmU4ZmM2ODIwMWNlMWYyNjQ4YWE0OTkxMzMxYTczZTMw
11
- MzJkMzE3MDc5MDAzMjc4YTU5MDcyYmJkNjY4NzExNjQ0NjIzOGY=
9
+ ZGU4ZmI4MDljNmJmZjNjZDhjOTE4ZWI1ZTI5YzA1MzQxYTg1MjYzYjc0ZTUw
10
+ YWJiNjE5NTY3NjMxYjQ2ZWZlNTQ1Mzk4OGVjZmEyZDM5NzJjZDIzOTAwM2U0
11
+ MTg3MTJiYmQyNTY3NWZmOWViNGVjMzM4Njk1ZTU1MTAzNGE2ODE=
12
12
  data.tar.gz: !binary |-
13
- OTY1NjVlYzYxZTQxMmY1MjQ5MjQxNTcyM2ZlNmI3MDFiYTM2YWNmYTA2NjYy
14
- ZmYxYTNmOWYwMDZlNTgwMjI1NzBiM2FhNWVlNzk5ZmEyYTk4NTNiZTFjN2Vj
15
- N2Q2ZjhlNjUyYzkxNmUxMDQ0ZjNkYWQzNTVhOGY4NTEwODA3Nzk=
13
+ MTA1OTE2ZWM2ODNlZTY0NTQyNjNiYmM2ZDkzMzdlZGYyZWIzYTBkZGQyZGZh
14
+ ZGQ1MjM3MGUyMDFmNTVjNDYxMjkyNmY1YmNlZjBhZDQwNDU3ODQ3NWM1NzY3
15
+ MGZmMTc4OTgyOTY5NzBiMTkwYWRlMGI0YjZlYzMzYjU3NDQ5YzE=
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.18"
4
4
  end
5
5
  end
@@ -158,7 +158,7 @@ class Zillabyte::API::Flows < Zillabyte::API::Base
158
158
 
159
159
  require("securerandom")
160
160
  info_file = "#{dir}/#{SecureRandom.uuid}"
161
- arg = "--info --file #{info_file}"
161
+ arg = "--info --file \"#{info_file}\""
162
162
 
163
163
 
164
164
  case hash["language"]
@@ -57,9 +57,6 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
57
57
 
58
58
  if app_id.nil?
59
59
  app_id = read_name_from_conf(options)
60
- options[:is_name] = true
61
- elsif !(app_id =~ /^\d*$/)
62
- options[:is_name] = true
63
60
  end
64
61
 
65
62
  res = api.request(
@@ -349,9 +346,6 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
349
346
 
350
347
  if app_id.nil?
351
348
  app_id = read_name_from_conf(options)
352
- options[:is_name] = true
353
- elsif !(app_id =~ /^\d*$/)
354
- options[:is_name] = true
355
349
  end
356
350
 
357
351
  if trigger_next
@@ -381,7 +375,6 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
381
375
  if response["job_id"]
382
376
  options[:job_id] = response["job_id"]
383
377
  app_id = response["app_id"]
384
- options.delete :is_name
385
378
 
386
379
  start = Time.now.utc
387
380
  display "Next cycle request sent. If your app was RETIRED this may take a few minutes. Please wait or check 'zillabyte logs' for progress." if type.nil?
@@ -325,9 +325,6 @@ class Zillabyte::Command::Components < Zillabyte::Command::Flows
325
325
 
326
326
  if component_id.nil?
327
327
  component_id = read_name_from_conf(options)
328
- options[:is_name] = true
329
- elsif !(component_id =~ /^\d*$/)
330
- options[:is_name] = true
331
328
  end
332
329
 
333
330
  type = options[:output_type]
@@ -422,9 +419,6 @@ class Zillabyte::Command::Components < Zillabyte::Command::Flows
422
419
 
423
420
  if component_id.nil?
424
421
  component_id = read_name_from_conf(options)
425
- options[:is_name] = true
426
- elsif !(component_id =~ /^\d*$/)
427
- options[:is_name] = true
428
422
  end
429
423
 
430
424
  type = options[:output_type]
@@ -274,6 +274,8 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
274
274
  error("no id given", type) if id.nil?
275
275
 
276
276
  s3_path = options[:s3_path] || shift_argument
277
+ error("no s3 path given", type) if s3_path.nil?
278
+
277
279
  matches = s3_path.match(/^s3:\/\/([A-Z0-9]{20}):([$-\/:-?{-~!"^_`\[\]\w]{40})@([\w\.]*)\/([-\w\/]*)$/)
278
280
  if !matches.nil?
279
281
  s3_access, s3_secret, s3_bucket, s3_key = matches.captures
@@ -21,9 +21,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
21
21
 
22
22
  if id.nil?
23
23
  id = read_name_from_conf(options)
24
- options[:is_name] = true
25
- elsif !(id =~ /^\d*$/)
26
- options[:is_name] = true
27
24
  end
28
25
 
29
26
  res = api.request(
@@ -59,10 +56,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
59
56
  flow_id = options[:id] || shift_argument
60
57
  type = options[:output_type]
61
58
 
62
- if !(flow_id =~ /^\d*$/)
63
- options[:is_name] = true
64
- end
65
-
66
59
  dir = options[:directory] || shift_argument
67
60
  error("no directory given", type) if dir.nil?
68
61
  dir = File.expand_path(dir)
@@ -165,9 +158,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
165
158
  flow_id = options[:id] || shift_argument
166
159
  if flow_id.nil?
167
160
  flow_id = read_name_from_conf(options)
168
- options[:is_name] = true
169
- elsif !(flow_id =~ /^\d*$/)
170
- options[:is_name] = true
171
161
  end
172
162
 
173
163
  operation_id = options[:operation] || shift_argument || '_ALL_'
@@ -202,9 +192,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
202
192
  # No name?
203
193
  if flow_id.nil?
204
194
  flow_id = read_name_from_conf(options)
205
- options[:is_name] = true
206
- elsif !(flow_id =~ /^\d*$/)
207
- options[:is_name] = true
208
195
  end
209
196
 
210
197
  type = options[:output_type]
@@ -230,7 +217,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
230
217
  [row['name'], d, row['message']]
231
218
  end
232
219
  rows.sort! do |a,b|
233
- a[1] <=> b[1]
220
+ a[0] <=> b[0]
234
221
  end
235
222
  color_map = {}
236
223
  require("zillabyte/cli/log_formatter")
@@ -341,9 +328,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
341
328
 
342
329
  if id.nil?
343
330
  id = read_name_from_conf(options)
344
- options[:is_name] = true
345
- elsif !(id =~ /^\d*$/)
346
- options[:is_name] = true
347
331
  end
348
332
  forced = options[:force]
349
333
  type = options[:output_type]
@@ -372,7 +356,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
372
356
  if response["job_id"]
373
357
  options[:job_id] = response["job_id"]
374
358
  flow_id = response["flow_id"]
375
- options.delete :is_name
376
359
 
377
360
  start = Time.now.utc
378
361
  display "Destroy request sent. Please wait..." if type.nil?
@@ -524,9 +507,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
524
507
 
525
508
  if id.nil?
526
509
  id = read_name_from_conf(options)
527
- options[:is_name] = true
528
- elsif !(id =~ /^\d*$/)
529
- options[:is_name] = true
530
510
  end
531
511
 
532
512
  display "Killing flow ##{id}...please wait..." if type.nil?
@@ -535,7 +515,6 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
535
515
  if response["job_id"]
536
516
  options[:job_id] = response["job_id"]
537
517
  flow_id = response["flow_id"]
538
- options.delete :is_name
539
518
 
540
519
  start = Time.now.utc
541
520
  display "Kill request sent. Please wait..." if type.nil?
@@ -627,13 +606,14 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
627
606
  @color_map[operation_name] ||= @all_colors[ @color_map.size % @all_colors.size ]
628
607
  @color_map[operation_name]
629
608
  end
609
+ ip = hash["server"] || ENV["ZILLABYTE_API_HOST"] #Quick fix for logs on zilla machines
630
610
 
631
611
  @color_map = {}
632
612
  @all_colors = [:green, :yellow, :magenta, :cyan, :light_black, :light_green, :light_yellow, :light_blue, :light_magenta, :light_cyan]
633
613
  if(hash["server"] == "localhost")
634
614
  cmd = "tail -n 500 -f /tmp/flows/f#{hash["flow"]}/flow_logs/flow_#{hash["flow"]}.log"
635
615
  else
636
- cmd = "curl -G http://#{hash["flow"]}:#{hash["token"]}@#{hash["server"]}:#{hash["port"]}/getLogs?flow=#{hash["flow"]}"
616
+ cmd = "curl -G http://#{hash["flow"]}:#{hash["token"]}@#{ip}:#{hash["port"]}/getLogs?flow=#{hash["flow"]}"
637
617
  end
638
618
 
639
619
  begin
@@ -1,4 +1,5 @@
1
1
  require "zillabyte/cli/base"
2
+ require("zillabyte/cli/helpers/table_output_builder")
2
3
 
3
4
  # executes queries
4
5
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillabyte-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - zillabyte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake