zillabyte-cli 0.1.22 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa7c1271f40be305d46a9c440926de250e2bcbb5
4
- data.tar.gz: a840c1321b322b4824d11fb03c46112cadfab23f
3
+ metadata.gz: 92e75d91289dcf56900c9e9d145910a44cd7d8f5
4
+ data.tar.gz: f055414a6fac2898da96d332667e921106ff88eb
5
5
  SHA512:
6
- metadata.gz: 382f3fc91b512bec0f75d621f1c9d21a1a0528a955c70e9289fe0d27b149a22b6f6fcecdf1137afada30e963e19915a73a3214908c881e4441ce3cc4d6dab200
7
- data.tar.gz: cf13694d82ae79a5770a59d0e63c50f589f7e12981e58c4446828a6f6a12572bb076b47f1b36fcffb3ff0ccb66a506362f7e3720fcb7b6ba2833eaa85102d61e
6
+ metadata.gz: 5d64345b60eee16d53efa88cc61090ba97cc39a31be2c1ccc0cd3f539d442f254fd434a4a45a78aa36c4d8b195c7c837a212f9032fbab42c4412836c10cd3d98
7
+ data.tar.gz: 80011b41c32f75922d7932eb7092f034e92d0a121ee3a6cd1495ec9bf323df69fa13e44f2da3a6061b7d7acb2ee81be8f640e361e7f63e6956dba78dd52f6b29
data/bin/zb CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
3
 
3
4
  require("zillabyte-cli")
4
5
  Zillabyte::CLI.start(*ARGV)
data/bin/zillabyte CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
3
 
3
4
  require("zillabyte-cli")
4
5
  Zillabyte::CLI.start(*ARGV)
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.1.22"
3
+ VERSION = "0.1.23"
4
4
  end
5
5
  end
@@ -202,36 +202,36 @@ class Zillabyte::Auth
202
202
  write_credentials(email, auth_token)
203
203
 
204
204
  # Maybe add ssh keys while we're at it...
205
- possible_keys = [
206
- "~/.ssh/id_rsa.pub",
207
- "~/.ssh/id_dsa.pub"
208
- ]
205
+ # possible_keys = [
206
+ # "~/.ssh/id_rsa.pub",
207
+ # "~/.ssh/id_dsa.pub"
208
+ # ]
209
209
 
210
- key_added = false
211
- possible_keys.each do |keypath|
212
- if File.exists?(File.expand_path(keypath))
210
+ # key_added = false
211
+ # possible_keys.each do |keypath|
212
+ # if File.exists?(File.expand_path(keypath))
213
213
 
214
- display "Register SSH key #{keypath}? (y/N)", false
215
- break if (ask() || "").strip.downcase[0] != "y"
214
+ # display "Register SSH key #{keypath}? (y/N)", false
215
+ # break if (ask() || "").strip.downcase[0] != "y"
216
216
 
217
- api = Zillabyte::API.new(:api_key => auth_token, :session => self)
218
- begin
219
- key = File.binread(File.expand_path(keypath))
220
- rescue => e
221
- error(e.message, type)
222
- break
223
- end
224
- message = api.keys.add("default", key)
225
- display("SSH keys added. Use 'zillabyte keys' to manage.")
226
- key_added = true
227
- break
217
+ # api = Zillabyte::API.new(:api_key => auth_token, :session => self)
218
+ # begin
219
+ # key = File.binread(File.expand_path(keypath))
220
+ # rescue => e
221
+ # error(e.message, type)
222
+ # break
223
+ # end
224
+ # message = api.keys.add("default", key)
225
+ # display("SSH keys added. Use 'zillabyte keys' to manage.")
226
+ # key_added = true
227
+ # break
228
228
 
229
- end
230
- end
229
+ # end
230
+ # end
231
231
 
232
- unless key_added
233
- display "Please run zillabyte keys:add to add your ssh keys."
234
- end
232
+ # unless key_added
233
+ # display "Please run zillabyte keys:add to add your ssh keys."
234
+ # end
235
235
 
236
236
  display "Authentication complete."
237
237
 
@@ -65,7 +65,9 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
65
65
  :path => "/apps/#{app_id}/details",
66
66
  :body => options.to_json
67
67
  )
68
- res.body
68
+ res = res.body.select do |instance|
69
+ !instance.nil?
70
+ end
69
71
 
70
72
  # a nested hash so can't map directly
71
73
  # instead i'll map separately and then merge the arrays
@@ -78,8 +80,8 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
78
80
  headings = heading1 + heading2
79
81
 
80
82
  # get the values for the headings
81
- type_name = res.body.map do |instance|
82
-
83
+ type_name = res.map do |instance|
84
+
83
85
  heading1.map do |heading|
84
86
  instance[heading]
85
87
  end
@@ -87,8 +89,8 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
87
89
  end
88
90
 
89
91
  # get the values for the headings
90
- stats = res.body.map do |instance|
91
-
92
+ stats = res.map do |instance|
93
+
92
94
  heading2.map do |heading|
93
95
  instance["stats"][heading]
94
96
  end
@@ -354,6 +356,7 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
354
356
  elsif trigger_forever
355
357
  response = api.apps.run_forever(app_id, options)
356
358
  else
359
+ require 'date'
357
360
  # List the apps
358
361
  response = api.apps.list_cycles(app_id, options)
359
362
  # TODO List the sequence number for this app.
@@ -220,8 +220,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
220
220
  a[0] <=> b[0]
221
221
  end
222
222
  color_map = {}
223
- require("zillabyte/cli/log_formatter")
224
- colors = LogFormatter::COLORS.clone
223
+ colors = [:green, :yellow, :magenta, :cyan, :light_black, :light_green, :light_yellow, :light_blue, :light_magenta, :light_cyan]
225
224
  rows.each do |row|
226
225
  name = row[0]
227
226
  time = row[1]
@@ -612,7 +611,7 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
612
611
  @color_map = {}
613
612
  @all_colors = [:green, :yellow, :magenta, :cyan, :light_black, :light_green, :light_yellow, :light_blue, :light_magenta, :light_cyan]
614
613
  if(hash["server"] == "localhost")
615
- cmd = "tail -n 500 -f /tmp/flows/f#{hash["flow"]}/flow_logs/flow_#{hash["flow"]}.log"
614
+ cmd = "tail -n 500 -F /tmp/flows/f#{hash["flow"]}/flow_logs/flow_#{hash["flow"]}.log"
616
615
  else
617
616
  cmd = "curl -G http://#{hash["flow"]}:#{hash["token"]}@#{ip}:#{hash["port"]}/getLogs?flow=#{hash["flow"]}"
618
617
  end
@@ -7,13 +7,6 @@ require "zillabyte/common"
7
7
  #
8
8
  class Zillabyte::Command::RPC < Zillabyte::Command::Flows
9
9
 
10
- # rpc
11
- #
12
- # --output_type OUTPUT_TYPE # Specify an output type i.e. json #HIDDEN
13
- #
14
- def index
15
- self.rpc
16
- end
17
10
 
18
11
  # rpc:start ID [INPUT_1] [INPUT_2] ...
19
12
  #
@@ -98,6 +91,9 @@ class Zillabyte::Command::RPC < Zillabyte::Command::Flows
98
91
  end
99
92
  end
100
93
  end
94
+ alias_command "rpc", "rpc:start"
95
+ alias_command "execute", "rpc:start"
96
+ alias_command "executes", "rpc:start"
101
97
 
102
98
 
103
99
  # rpc:results ID RUN_ID
@@ -125,6 +121,8 @@ class Zillabyte::Command::RPC < Zillabyte::Command::Flows
125
121
  wait_for_results(component_id, run_ids, type)
126
122
  end
127
123
 
124
+
125
+
128
126
  # rpc:status ID RUN_ID
129
127
  #
130
128
  # Returns the current status of the RPC query corresponding to
@@ -158,6 +156,8 @@ class Zillabyte::Command::RPC < Zillabyte::Command::Flows
158
156
  end
159
157
  end
160
158
  end
159
+
160
+
161
161
 
162
162
  # rpc:kill ID
163
163
  #
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.22
4
+ version: 0.1.23
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-29 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake