zillabyte-cli 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/zb +1 -0
- data/bin/zillabyte +1 -0
- data/lib/zillabyte-cli/version.rb +1 -1
- data/lib/zillabyte/auth.rb +25 -25
- data/lib/zillabyte/cli/apps.rb +8 -5
- data/lib/zillabyte/cli/flows.rb +2 -3
- data/lib/zillabyte/cli/rpc.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e75d91289dcf56900c9e9d145910a44cd7d8f5
|
4
|
+
data.tar.gz: f055414a6fac2898da96d332667e921106ff88eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d64345b60eee16d53efa88cc61090ba97cc39a31be2c1ccc0cd3f539d442f254fd434a4a45a78aa36c4d8b195c7c837a212f9032fbab42c4412836c10cd3d98
|
7
|
+
data.tar.gz: 80011b41c32f75922d7932eb7092f034e92d0a121ee3a6cd1495ec9bf323df69fa13e44f2da3a6061b7d7acb2ee81be8f640e361e7f63e6956dba78dd52f6b29
|
data/bin/zb
CHANGED
data/bin/zillabyte
CHANGED
data/lib/zillabyte/auth.rb
CHANGED
@@ -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
|
-
|
207
|
-
|
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
|
-
|
210
|
+
# key_added = false
|
211
|
+
# possible_keys.each do |keypath|
|
212
|
+
# if File.exists?(File.expand_path(keypath))
|
213
213
|
|
214
|
-
|
215
|
-
|
214
|
+
# display "Register SSH key #{keypath}? (y/N)", false
|
215
|
+
# break if (ask() || "").strip.downcase[0] != "y"
|
216
216
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
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
|
-
|
230
|
-
end
|
229
|
+
# end
|
230
|
+
# end
|
231
231
|
|
232
|
-
unless key_added
|
233
|
-
|
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
|
|
data/lib/zillabyte/cli/apps.rb
CHANGED
@@ -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.
|
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.
|
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.
|
data/lib/zillabyte/cli/flows.rb
CHANGED
@@ -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
|
-
|
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 -
|
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
|
data/lib/zillabyte/cli/rpc.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|