morpheus-cli 3.6.8 → 3.6.9
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/lib/morpheus/api/account_groups_interface.rb +2 -2
- data/lib/morpheus/api/accounts_interface.rb +4 -7
- data/lib/morpheus/api/api_client.rb +207 -70
- data/lib/morpheus/api/app_templates_interface.rb +7 -28
- data/lib/morpheus/api/apps_interface.rb +14 -21
- data/lib/morpheus/api/archive_buckets_interface.rb +2 -2
- data/lib/morpheus/api/archive_files_interface.rb +6 -6
- data/lib/morpheus/api/auth_interface.rb +14 -1
- data/lib/morpheus/api/blueprints_interface.rb +9 -16
- data/lib/morpheus/api/cloud_datastores_interface.rb +1 -1
- data/lib/morpheus/api/cloud_policies_interface.rb +1 -1
- data/lib/morpheus/api/clouds_interface.rb +18 -21
- data/lib/morpheus/api/cypher_interface.rb +19 -28
- data/lib/morpheus/api/file_copy_request_interface.rb +1 -1
- data/lib/morpheus/api/group_policies_interface.rb +1 -1
- data/lib/morpheus/api/groups_interface.rb +4 -4
- data/lib/morpheus/api/image_builder_boot_scripts_interface.rb +1 -1
- data/lib/morpheus/api/image_builder_image_builds_interface.rb +2 -2
- data/lib/morpheus/api/image_builder_preseed_scripts_interface.rb +1 -1
- data/lib/morpheus/api/instances_interface.rb +17 -23
- data/lib/morpheus/api/logs_interface.rb +7 -10
- data/lib/morpheus/api/network_domains_interface.rb +1 -1
- data/lib/morpheus/api/network_groups_interface.rb +1 -1
- data/lib/morpheus/api/network_pool_servers_interface.rb +1 -1
- data/lib/morpheus/api/network_pools_interface.rb +1 -1
- data/lib/morpheus/api/network_proxies_interface.rb +1 -1
- data/lib/morpheus/api/network_services_interface.rb +1 -1
- data/lib/morpheus/api/networks_interface.rb +1 -1
- data/lib/morpheus/api/old_cypher_interface.rb +55 -0
- data/lib/morpheus/api/packages_interface.rb +1 -1
- data/lib/morpheus/api/policies_interface.rb +1 -1
- data/lib/morpheus/api/setup_interface.rb +1 -1
- data/lib/morpheus/api/storage_providers_interface.rb +1 -1
- data/lib/morpheus/api/whoami_interface.rb +1 -1
- data/lib/morpheus/benchmarking.rb +277 -0
- data/lib/morpheus/cli.rb +6 -22
- data/lib/morpheus/cli/access_token_command.rb +172 -0
- data/lib/morpheus/cli/accounts.rb +5 -0
- data/lib/morpheus/cli/apps.rb +93 -37
- data/lib/morpheus/cli/archives_command.rb +0 -2
- data/lib/morpheus/cli/auth_command.rb +112 -0
- data/lib/morpheus/cli/blueprints_command.rb +50 -13
- data/lib/morpheus/cli/change_password_command.rb +148 -0
- data/lib/morpheus/cli/cli_command.rb +173 -49
- data/lib/morpheus/cli/clouds.rb +15 -5
- data/lib/morpheus/cli/command_error.rb +7 -1
- data/lib/morpheus/cli/{alias_command.rb → commands/standard/alias_command.rb} +79 -51
- data/lib/morpheus/cli/commands/standard/benchmark_command.rb +399 -0
- data/lib/morpheus/cli/commands/standard/coloring_command.rb +60 -0
- data/lib/morpheus/cli/{curl_command.rb → commands/standard/curl_command.rb} +0 -7
- data/lib/morpheus/cli/commands/standard/debug_command.rb +61 -0
- data/lib/morpheus/cli/{echo_command.rb → commands/standard/echo_command.rb} +1 -1
- data/lib/morpheus/cli/{edit_profile_command.rb → commands/standard/edit_profile_command.rb} +0 -0
- data/lib/morpheus/cli/{edit_rc_command.rb → commands/standard/edit_rc_command.rb} +0 -0
- data/lib/morpheus/cli/commands/standard/get_prompt_command.rb +39 -0
- data/lib/morpheus/cli/commands/standard/history_command.rb +76 -0
- data/lib/morpheus/cli/{log_level_command.rb → commands/standard/log_level_command.rb} +1 -1
- data/lib/morpheus/cli/{man_command.rb → commands/standard/man_command.rb} +2 -2
- data/lib/morpheus/cli/commands/standard/rm_command.rb +14 -0
- data/lib/morpheus/cli/commands/standard/set_prompt_command.rb +54 -0
- data/lib/morpheus/cli/{sleep_command.rb → commands/standard/sleep_command.rb} +0 -0
- data/lib/morpheus/cli/{source_command.rb → commands/standard/source_command.rb} +0 -0
- data/lib/morpheus/cli/{ssl_verification_command.rb → commands/standard/ssl_verification_command.rb} +1 -1
- data/lib/morpheus/cli/commands/standard/tee_command.rb +14 -0
- data/lib/morpheus/cli/{version_command.rb → commands/standard/version_command.rb} +0 -0
- data/lib/morpheus/cli/credentials.rb +276 -87
- data/lib/morpheus/cli/cypher_command.rb +333 -214
- data/lib/morpheus/cli/error_handler.rb +12 -2
- data/lib/morpheus/cli/groups.rb +44 -20
- data/lib/morpheus/cli/hosts.rb +39 -16
- data/lib/morpheus/cli/instances.rb +114 -62
- data/lib/morpheus/cli/login.rb +74 -21
- data/lib/morpheus/cli/logout.rb +3 -4
- data/lib/morpheus/cli/mixins/accounts_helper.rb +50 -18
- data/lib/morpheus/cli/mixins/print_helper.rb +207 -42
- data/lib/morpheus/cli/old_cypher_command.rb +414 -0
- data/lib/morpheus/cli/option_parser.rb +6 -1
- data/lib/morpheus/cli/processes_command.rb +3 -0
- data/lib/morpheus/cli/remote.rb +11 -17
- data/lib/morpheus/cli/roles.rb +17 -17
- data/lib/morpheus/cli/security_groups.rb +47 -17
- data/lib/morpheus/cli/shell.rb +139 -79
- data/lib/morpheus/cli/tenants_command.rb +353 -0
- data/lib/morpheus/cli/users.rb +26 -18
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/whoami.rb +14 -10
- data/lib/morpheus/formatters.rb +4 -4
- data/lib/morpheus/logging.rb +16 -8
- data/lib/morpheus/terminal.rb +63 -34
- metadata +28 -15
- data/lib/morpheus/cli/coloring_command.rb +0 -45
- data/lib/morpheus/cli/set_prompt_command.rb +0 -51
data/lib/morpheus/cli/version.rb
CHANGED
data/lib/morpheus/cli/whoami.rb
CHANGED
|
@@ -38,6 +38,7 @@ class Morpheus::Cli::Whoami
|
|
|
38
38
|
|
|
39
39
|
def show(args)
|
|
40
40
|
options = {}
|
|
41
|
+
params = {}
|
|
41
42
|
username_only = false
|
|
42
43
|
access_token_only = false
|
|
43
44
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
|
@@ -81,10 +82,14 @@ class Morpheus::Cli::Whoami
|
|
|
81
82
|
return 1
|
|
82
83
|
end
|
|
83
84
|
|
|
85
|
+
if options[:dry_run]
|
|
86
|
+
print_dry_run @api_client.whoami.dry.get(params, options)
|
|
87
|
+
return 0
|
|
88
|
+
end
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if !
|
|
90
|
+
wallet = Morpheus::Cli::Credentials.new(@appliance_name, @appliance_url).load_saved_credentials()
|
|
91
|
+
token = wallet ? wallet['access_token'] : nil
|
|
92
|
+
if !token
|
|
88
93
|
if options[:quiet]
|
|
89
94
|
return 1
|
|
90
95
|
elsif access_token_only
|
|
@@ -97,7 +102,6 @@ class Morpheus::Cli::Whoami
|
|
|
97
102
|
end
|
|
98
103
|
end
|
|
99
104
|
|
|
100
|
-
|
|
101
105
|
json_response = load_whoami()
|
|
102
106
|
|
|
103
107
|
user = @current_user # from load_whoami() meh
|
|
@@ -146,7 +150,7 @@ class Morpheus::Cli::Whoami
|
|
|
146
150
|
exit 1
|
|
147
151
|
end
|
|
148
152
|
|
|
149
|
-
print_h1 "Current User"
|
|
153
|
+
print_h1 "Current User", options
|
|
150
154
|
print cyan
|
|
151
155
|
print_description_list({
|
|
152
156
|
"ID" => 'id',
|
|
@@ -163,7 +167,7 @@ class Morpheus::Cli::Whoami
|
|
|
163
167
|
|
|
164
168
|
if options[:include_feature_access]
|
|
165
169
|
if @user_permissions
|
|
166
|
-
print_h2 "Feature Permissions"
|
|
170
|
+
print_h2 "Feature Permissions", options
|
|
167
171
|
print cyan
|
|
168
172
|
rows = @user_permissions.collect do |code, access|
|
|
169
173
|
{code: code, access: get_access_string(access) }
|
|
@@ -174,7 +178,7 @@ class Morpheus::Cli::Whoami
|
|
|
174
178
|
end
|
|
175
179
|
end
|
|
176
180
|
|
|
177
|
-
print_h1 "Remote Appliance"
|
|
181
|
+
print_h1 "Remote Appliance", options
|
|
178
182
|
print cyan
|
|
179
183
|
appliance_data = {
|
|
180
184
|
'name' => @appliance_name,
|
|
@@ -189,16 +193,18 @@ class Morpheus::Cli::Whoami
|
|
|
189
193
|
|
|
190
194
|
if active_group
|
|
191
195
|
print cyan
|
|
192
|
-
# print_h1 "Active Group"
|
|
196
|
+
# print_h1 "Active Group", options
|
|
193
197
|
# print cyan
|
|
194
198
|
# print_description_list({
|
|
195
199
|
# "ID" => 'id',
|
|
196
200
|
# "Name" => 'name'
|
|
197
201
|
# }, active_group)
|
|
198
202
|
print cyan, "\n# => Currently using group #{active_group['name']}\n", reset
|
|
203
|
+
print reset,"\n"
|
|
199
204
|
else
|
|
200
205
|
print "\n", reset
|
|
201
206
|
print "No active group. See `groups use`\n",reset
|
|
207
|
+
print reset,"\n"
|
|
202
208
|
end
|
|
203
209
|
|
|
204
210
|
# save pertinent session info to the appliance
|
|
@@ -214,8 +220,6 @@ class Morpheus::Cli::Whoami
|
|
|
214
220
|
rescue => err
|
|
215
221
|
puts "failed to save remote appliance info"
|
|
216
222
|
end
|
|
217
|
-
|
|
218
|
-
print reset,"\n"
|
|
219
223
|
end
|
|
220
224
|
return 0
|
|
221
225
|
rescue RestClient::Exception => e
|
data/lib/morpheus/formatters.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'time'
|
|
2
2
|
require 'filesize'
|
|
3
3
|
|
|
4
|
-
DEFAULT_TIME_FORMAT = "%x %I:%M %p
|
|
4
|
+
DEFAULT_TIME_FORMAT = "%x %I:%M %p"
|
|
5
5
|
|
|
6
6
|
# returns an instance of Time
|
|
7
7
|
def parse_time(dt, format=nil)
|
|
@@ -115,11 +115,11 @@ def format_human_duration(seconds)
|
|
|
115
115
|
#seconds = seconds.round
|
|
116
116
|
days, hours, minutes = (seconds / (60*60*24)).floor, (seconds / (60*60)).floor, (seconds / (60)).floor
|
|
117
117
|
if days > 365
|
|
118
|
-
out << "#{days.floor} days
|
|
118
|
+
out << "#{days.floor} days"
|
|
119
119
|
elsif days > 61
|
|
120
|
-
out << "#{days.floor} days
|
|
120
|
+
out << "#{days.floor} days"
|
|
121
121
|
elsif days > 31
|
|
122
|
-
out << "#{days.floor} days
|
|
122
|
+
out << "#{days.floor} days"
|
|
123
123
|
elsif days > 0
|
|
124
124
|
if days.floor == 1
|
|
125
125
|
out << "1 day"
|
data/lib/morpheus/logging.rb
CHANGED
|
@@ -76,6 +76,21 @@ module Morpheus::Logging
|
|
|
76
76
|
self.debug?
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
+
# mask well known secrets and password patterns
|
|
80
|
+
def self.scrub_message(msg)
|
|
81
|
+
if msg.is_a?(String)
|
|
82
|
+
msg = msg.clone
|
|
83
|
+
msg.gsub!(/Authorization\"\s?\=\>\s?\"Bearer [^"]+/, 'Authorization"=>"Bearer ************')
|
|
84
|
+
msg.gsub!(/Authorization\:\s?Bearer [^"'']+/, 'Authorization: Bearer ************')
|
|
85
|
+
msg.gsub!(/password\"\s?\=\>\s?\"[^"]+/, 'password"=>"************')
|
|
86
|
+
msg.gsub!(/password\=\"[^"]+/, 'password="************')
|
|
87
|
+
msg.gsub!(/password\=[^"'&\Z]+/, 'password=************') # buggy, wont work with ampersand or quotes in passwords! heh
|
|
88
|
+
msg.gsub!(/passwordConfirmation\=[^" ]+/, 'passwordConfirmation="************')
|
|
89
|
+
msg.gsub!(/passwordConfirmation\=[^" ]+/, 'passwordConfirmation=************')
|
|
90
|
+
end
|
|
91
|
+
msg
|
|
92
|
+
end
|
|
93
|
+
|
|
79
94
|
# An IO class for printing debugging info
|
|
80
95
|
# This is used as a proxy for ::RestClient.log printing right now.
|
|
81
96
|
class DarkPrinter
|
|
@@ -110,15 +125,8 @@ module Morpheus::Logging
|
|
|
110
125
|
@is_dark = is_dark
|
|
111
126
|
end
|
|
112
127
|
|
|
113
|
-
# mask well known secrets
|
|
114
128
|
def scrub_message(msg)
|
|
115
|
-
|
|
116
|
-
msg.gsub!(/Authorization\"\s?\=\>\s?\"Bearer [^"]+/, 'Authorization"=>"Bearer ************')
|
|
117
|
-
msg.gsub!(/Authorization\:\s?Bearer [^"]+/, 'Authorization"=>"Bearer ************')
|
|
118
|
-
msg.gsub!(/password\"\s?\=\>\s?\"[^"]+/, 'password"=>"************')
|
|
119
|
-
msg.gsub!(/password\=\"[^"]+/, 'password="************')
|
|
120
|
-
end
|
|
121
|
-
msg
|
|
129
|
+
Morpheus::Logging.scrub_message(msg)
|
|
122
130
|
end
|
|
123
131
|
|
|
124
132
|
def print_with_color(&block)
|
data/lib/morpheus/terminal.rb
CHANGED
|
@@ -7,6 +7,7 @@ require 'morpheus/cli/cli_registry'
|
|
|
7
7
|
require 'morpheus/cli/dot_file'
|
|
8
8
|
require 'morpheus/cli/error_handler'
|
|
9
9
|
require 'morpheus/logging'
|
|
10
|
+
require 'morpheus/benchmarking'
|
|
10
11
|
require 'morpheus/cli'
|
|
11
12
|
|
|
12
13
|
module Morpheus
|
|
@@ -30,7 +31,7 @@ module Morpheus
|
|
|
30
31
|
# puts File.read("/tmp/host23.json")
|
|
31
32
|
#
|
|
32
33
|
class Terminal
|
|
33
|
-
|
|
34
|
+
include Morpheus::Benchmarking::HasBenchmarking
|
|
34
35
|
# todo: this can be combined with Cli::Shell
|
|
35
36
|
|
|
36
37
|
class Blackhole # < IO
|
|
@@ -76,6 +77,10 @@ module Morpheus
|
|
|
76
77
|
#export MORPHEUS_PS1='\[\e[1;32m\]\u@\h:\w${text}$\[\e[m\] '
|
|
77
78
|
end
|
|
78
79
|
|
|
80
|
+
# def self.benchmarking=(v)
|
|
81
|
+
# @benchmarking = !!v
|
|
82
|
+
# end
|
|
83
|
+
|
|
79
84
|
# the global Morpheus::Terminal instance
|
|
80
85
|
# This should go away, but it needed for now...
|
|
81
86
|
def self.instance
|
|
@@ -90,6 +95,7 @@ module Morpheus
|
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
attr_accessor :prompt #, :angry_prompt
|
|
98
|
+
attr_accessor :benchmarking
|
|
93
99
|
attr_reader :stdin, :stdout, :stderr, :home_directory
|
|
94
100
|
|
|
95
101
|
|
|
@@ -221,12 +227,16 @@ module Morpheus
|
|
|
221
227
|
@coloring = false
|
|
222
228
|
Term::ANSIColor::coloring = false
|
|
223
229
|
end
|
|
230
|
+
opts.on('-B','--benchmark', "Print benchmark time after the command is finished.") do
|
|
231
|
+
@benchmarking = true
|
|
232
|
+
#Morpheus::Benchmarking.enabled = true
|
|
233
|
+
end
|
|
224
234
|
opts.on('-V','--debug', "Print extra output for debugging.") do |json|
|
|
225
235
|
@terminal_log_level = Morpheus::Logging::Logger::DEBUG
|
|
226
236
|
Morpheus::Logging.set_log_level(Morpheus::Logging::Logger::DEBUG)
|
|
227
237
|
::RestClient.log = Morpheus::Logging.debug? ? Morpheus::Logging::DarkPrinter.instance : nil
|
|
228
238
|
end
|
|
229
|
-
opts.on( '-h', '--help', "
|
|
239
|
+
opts.on( '-h', '--help', "Print this help" ) do
|
|
230
240
|
@stdout.puts opts
|
|
231
241
|
# exit
|
|
232
242
|
end
|
|
@@ -317,42 +327,55 @@ module Morpheus
|
|
|
317
327
|
::RestClient.log = Morpheus::Logging.debug? ? Morpheus::Logging::DarkPrinter.instance : nil
|
|
318
328
|
end
|
|
319
329
|
|
|
320
|
-
#
|
|
321
|
-
#
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
args.delete_if {|it| it == '--noprofile' }
|
|
326
|
-
end
|
|
327
|
-
|
|
328
|
-
if @profile_dot_file && !@profile_dot_file_has_run
|
|
329
|
-
if !noprofile && File.exists?(@profile_dot_file.filename)
|
|
330
|
-
execute_profile_script()
|
|
331
|
-
end
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
# not enough arguments?
|
|
335
|
-
if args.count == 0
|
|
336
|
-
@stderr.puts "#{@angry_prompt}[command] argument is required."
|
|
337
|
-
#@stderr.puts "No command given, here's some help:"
|
|
338
|
-
@stderr.print usage
|
|
339
|
-
return 2, nil # CommandError.new("morpheus requires a command")
|
|
340
|
-
end
|
|
341
|
-
|
|
342
|
-
cmd_name = args[0]
|
|
343
|
-
cmd_args = args[1..-1]
|
|
344
|
-
|
|
345
|
-
# unknown command?
|
|
346
|
-
# all commands should be registered commands or aliases
|
|
347
|
-
if !(Morpheus::Cli::CliRegistry.has_command?(cmd_name) || Morpheus::Cli::CliRegistry.has_alias?(cmd_name))
|
|
348
|
-
@stderr.puts "#{@angry_prompt}'#{cmd_name}' is not a morpheus command. See 'morpheus --help'."
|
|
349
|
-
#@stderr.puts usage
|
|
350
|
-
return 127, nil
|
|
351
|
-
end
|
|
330
|
+
# start benchmark right away?
|
|
331
|
+
# if args.find {|it| it == '-B' || it == '--benchmark'}
|
|
332
|
+
# #start_benchmark(args.join(' '))
|
|
333
|
+
# @benchmarking = true
|
|
334
|
+
# end
|
|
352
335
|
|
|
353
336
|
# ok, execute the command (or alias)
|
|
354
337
|
result = nil
|
|
355
338
|
begin
|
|
339
|
+
|
|
340
|
+
# execute startup script .morpheus_profile unless --noprofile is passed
|
|
341
|
+
# todo: this should happen in initialize..
|
|
342
|
+
noprofile = false
|
|
343
|
+
if args.find {|it| it == '--noprofile' }
|
|
344
|
+
noprofile = true
|
|
345
|
+
args.delete_if {|it| it == '--noprofile' }
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
if @profile_dot_file && !@profile_dot_file_has_run
|
|
349
|
+
if !noprofile && File.exists?(@profile_dot_file.filename)
|
|
350
|
+
execute_profile_script()
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# not enough arguments?
|
|
355
|
+
if args.count == 0
|
|
356
|
+
@stderr.puts "#{@angry_prompt}[command] argument is required."
|
|
357
|
+
#@stderr.puts "No command given, here's some help:"
|
|
358
|
+
@stderr.print usage
|
|
359
|
+
return 2, nil # CommandError.new("morpheus requires a command")
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
cmd_name = args[0]
|
|
363
|
+
cmd_args = args[1..-1]
|
|
364
|
+
|
|
365
|
+
# unknown command?
|
|
366
|
+
# all commands should be registered commands or aliases
|
|
367
|
+
if !(Morpheus::Cli::CliRegistry.has_command?(cmd_name) || Morpheus::Cli::CliRegistry.has_alias?(cmd_name))
|
|
368
|
+
@stderr.puts "#{@angry_prompt}'#{cmd_name}' is not recognized. See 'morpheus --help'."
|
|
369
|
+
#@stderr.puts usage
|
|
370
|
+
return 127, nil
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
if @benchmarking || args.include?('-B') || args.include?('--benchmark')
|
|
374
|
+
benchmark_name = "morpheus " + args.reject {|it| it == '-B' || it == '--benchmark' }.join(' ')
|
|
375
|
+
#benchmark_name = args.reject {|it| it == '-B' || it == '--benchmark' }.join(' ')
|
|
376
|
+
start_benchmark(benchmark_name)
|
|
377
|
+
end
|
|
378
|
+
|
|
356
379
|
# shell is a Singleton command class
|
|
357
380
|
if args[0] == "shell"
|
|
358
381
|
result = Morpheus::Cli::Shell.instance.handle(args[1..-1])
|
|
@@ -373,6 +396,12 @@ module Morpheus
|
|
|
373
396
|
rescue => e
|
|
374
397
|
exit_code = Morpheus::Cli::ErrorHandler.new(@stderr).handle_error(e)
|
|
375
398
|
err = e
|
|
399
|
+
ensure
|
|
400
|
+
# should always try to stop it
|
|
401
|
+
# if @benchmarking
|
|
402
|
+
benchmark_record = stop_benchmark(exit_code, err)
|
|
403
|
+
Morpheus::Logging::DarkPrinter.puts(Term::ANSIColor.cyan + Term::ANSIColor.dark + benchmark_record.msg) if benchmark_record
|
|
404
|
+
# end
|
|
376
405
|
end
|
|
377
406
|
|
|
378
407
|
return exit_code, err
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: morpheus-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.6.
|
|
4
|
+
version: 3.6.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Estes
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2019-02-
|
|
14
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -222,6 +222,7 @@ files:
|
|
|
222
222
|
- lib/morpheus/api/network_proxies_interface.rb
|
|
223
223
|
- lib/morpheus/api/network_services_interface.rb
|
|
224
224
|
- lib/morpheus/api/networks_interface.rb
|
|
225
|
+
- lib/morpheus/api/old_cypher_interface.rb
|
|
225
226
|
- lib/morpheus/api/option_type_lists_interface.rb
|
|
226
227
|
- lib/morpheus/api/option_types_interface.rb
|
|
227
228
|
- lib/morpheus/api/options_interface.rb
|
|
@@ -244,34 +245,51 @@ files:
|
|
|
244
245
|
- lib/morpheus/api/users_interface.rb
|
|
245
246
|
- lib/morpheus/api/virtual_images_interface.rb
|
|
246
247
|
- lib/morpheus/api/whoami_interface.rb
|
|
248
|
+
- lib/morpheus/benchmarking.rb
|
|
247
249
|
- lib/morpheus/cli.rb
|
|
250
|
+
- lib/morpheus/cli/access_token_command.rb
|
|
248
251
|
- lib/morpheus/cli/account_groups_command.rb
|
|
249
252
|
- lib/morpheus/cli/accounts.rb
|
|
250
|
-
- lib/morpheus/cli/alias_command.rb
|
|
251
253
|
- lib/morpheus/cli/app_templates.rb
|
|
252
254
|
- lib/morpheus/cli/apps.rb
|
|
253
255
|
- lib/morpheus/cli/archives_command.rb
|
|
256
|
+
- lib/morpheus/cli/auth_command.rb
|
|
254
257
|
- lib/morpheus/cli/blueprints_command.rb
|
|
255
258
|
- lib/morpheus/cli/boot_scripts_command.rb
|
|
259
|
+
- lib/morpheus/cli/change_password_command.rb
|
|
256
260
|
- lib/morpheus/cli/cli_command.rb
|
|
257
261
|
- lib/morpheus/cli/cli_registry.rb
|
|
258
262
|
- lib/morpheus/cli/cloud_datastores_command.rb
|
|
259
263
|
- lib/morpheus/cli/clouds.rb
|
|
260
|
-
- lib/morpheus/cli/coloring_command.rb
|
|
261
264
|
- lib/morpheus/cli/command_error.rb
|
|
265
|
+
- lib/morpheus/cli/commands/standard/alias_command.rb
|
|
266
|
+
- lib/morpheus/cli/commands/standard/benchmark_command.rb
|
|
262
267
|
- lib/morpheus/cli/commands/standard/cat_command.rb
|
|
268
|
+
- lib/morpheus/cli/commands/standard/coloring_command.rb
|
|
269
|
+
- lib/morpheus/cli/commands/standard/curl_command.rb
|
|
270
|
+
- lib/morpheus/cli/commands/standard/debug_command.rb
|
|
271
|
+
- lib/morpheus/cli/commands/standard/echo_command.rb
|
|
272
|
+
- lib/morpheus/cli/commands/standard/edit_profile_command.rb
|
|
273
|
+
- lib/morpheus/cli/commands/standard/edit_rc_command.rb
|
|
263
274
|
- lib/morpheus/cli/commands/standard/exit_command.rb
|
|
275
|
+
- lib/morpheus/cli/commands/standard/get_prompt_command.rb
|
|
276
|
+
- lib/morpheus/cli/commands/standard/history_command.rb
|
|
277
|
+
- lib/morpheus/cli/commands/standard/log_level_command.rb
|
|
278
|
+
- lib/morpheus/cli/commands/standard/man_command.rb
|
|
279
|
+
- lib/morpheus/cli/commands/standard/rm_command.rb
|
|
280
|
+
- lib/morpheus/cli/commands/standard/set_prompt_command.rb
|
|
281
|
+
- lib/morpheus/cli/commands/standard/sleep_command.rb
|
|
282
|
+
- lib/morpheus/cli/commands/standard/source_command.rb
|
|
283
|
+
- lib/morpheus/cli/commands/standard/ssl_verification_command.rb
|
|
284
|
+
- lib/morpheus/cli/commands/standard/tee_command.rb
|
|
285
|
+
- lib/morpheus/cli/commands/standard/version_command.rb
|
|
264
286
|
- lib/morpheus/cli/containers_command.rb
|
|
265
287
|
- lib/morpheus/cli/credentials.rb
|
|
266
|
-
- lib/morpheus/cli/curl_command.rb
|
|
267
288
|
- lib/morpheus/cli/cypher_command.rb
|
|
268
289
|
- lib/morpheus/cli/dashboard_command.rb
|
|
269
290
|
- lib/morpheus/cli/deployments.rb
|
|
270
291
|
- lib/morpheus/cli/deploys.rb
|
|
271
292
|
- lib/morpheus/cli/dot_file.rb
|
|
272
|
-
- lib/morpheus/cli/echo_command.rb
|
|
273
|
-
- lib/morpheus/cli/edit_profile_command.rb
|
|
274
|
-
- lib/morpheus/cli/edit_rc_command.rb
|
|
275
293
|
- lib/morpheus/cli/error_handler.rb
|
|
276
294
|
- lib/morpheus/cli/execute_schedules_command.rb
|
|
277
295
|
- lib/morpheus/cli/execution_request_command.rb
|
|
@@ -294,10 +312,8 @@ files:
|
|
|
294
312
|
- lib/morpheus/cli/library_upgrades_command.rb
|
|
295
313
|
- lib/morpheus/cli/license.rb
|
|
296
314
|
- lib/morpheus/cli/load_balancers.rb
|
|
297
|
-
- lib/morpheus/cli/log_level_command.rb
|
|
298
315
|
- lib/morpheus/cli/login.rb
|
|
299
316
|
- lib/morpheus/cli/logout.rb
|
|
300
|
-
- lib/morpheus/cli/man_command.rb
|
|
301
317
|
- lib/morpheus/cli/mixins/accounts_helper.rb
|
|
302
318
|
- lib/morpheus/cli/mixins/infrastructure_helper.rb
|
|
303
319
|
- lib/morpheus/cli/mixins/library_helper.rb
|
|
@@ -318,6 +334,7 @@ files:
|
|
|
318
334
|
- lib/morpheus/cli/network_proxies_command.rb
|
|
319
335
|
- lib/morpheus/cli/network_services_command.rb
|
|
320
336
|
- lib/morpheus/cli/networks_command.rb
|
|
337
|
+
- lib/morpheus/cli/old_cypher_command.rb
|
|
321
338
|
- lib/morpheus/cli/option_parser.rb
|
|
322
339
|
- lib/morpheus/cli/option_types.rb
|
|
323
340
|
- lib/morpheus/cli/packages_command.rb
|
|
@@ -330,19 +347,15 @@ files:
|
|
|
330
347
|
- lib/morpheus/cli/roles.rb
|
|
331
348
|
- lib/morpheus/cli/security_group_rules.rb
|
|
332
349
|
- lib/morpheus/cli/security_groups.rb
|
|
333
|
-
- lib/morpheus/cli/set_prompt_command.rb
|
|
334
350
|
- lib/morpheus/cli/shell.rb
|
|
335
|
-
- lib/morpheus/cli/sleep_command.rb
|
|
336
|
-
- lib/morpheus/cli/source_command.rb
|
|
337
|
-
- lib/morpheus/cli/ssl_verification_command.rb
|
|
338
351
|
- lib/morpheus/cli/storage_providers_command.rb
|
|
339
352
|
- lib/morpheus/cli/tasks.rb
|
|
353
|
+
- lib/morpheus/cli/tenants_command.rb
|
|
340
354
|
- lib/morpheus/cli/user_groups_command.rb
|
|
341
355
|
- lib/morpheus/cli/user_settings_command.rb
|
|
342
356
|
- lib/morpheus/cli/user_sources_command.rb
|
|
343
357
|
- lib/morpheus/cli/users.rb
|
|
344
358
|
- lib/morpheus/cli/version.rb
|
|
345
|
-
- lib/morpheus/cli/version_command.rb
|
|
346
359
|
- lib/morpheus/cli/virtual_images.rb
|
|
347
360
|
- lib/morpheus/cli/whoami.rb
|
|
348
361
|
- lib/morpheus/cli/workflows.rb
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
require 'optparse'
|
|
2
|
-
require 'morpheus/cli/cli_command'
|
|
3
|
-
require 'json'
|
|
4
|
-
|
|
5
|
-
# This is for use in dotfile scripts
|
|
6
|
-
# It allows you to turn colors on or off globally
|
|
7
|
-
class Morpheus::Cli::ColoringCommand
|
|
8
|
-
include Morpheus::Cli::CliCommand
|
|
9
|
-
set_command_name :coloring
|
|
10
|
-
set_command_hidden
|
|
11
|
-
|
|
12
|
-
def handle(args)
|
|
13
|
-
append_newline = true
|
|
14
|
-
options = {}
|
|
15
|
-
optparse = Morpheus::Cli::OptionParser.new do|opts|
|
|
16
|
-
opts.banner = "Usage: morpheus #{command_name} [on|off]"
|
|
17
|
-
#build_common_options(opts, options, [])
|
|
18
|
-
opts.on('-h', '--help', "Prints this help" ) do
|
|
19
|
-
puts opts
|
|
20
|
-
exit
|
|
21
|
-
end
|
|
22
|
-
opts.footer = "Enable [on] or Disable [off] ANSI Colors for all output."
|
|
23
|
-
end
|
|
24
|
-
optparse.parse!(args)
|
|
25
|
-
if args.count > 1
|
|
26
|
-
puts optparse
|
|
27
|
-
exit 1
|
|
28
|
-
end
|
|
29
|
-
if args.count == 1
|
|
30
|
-
is_on = ["on","true", "1"].include?(args[0].to_s.strip.downcase)
|
|
31
|
-
is_off = ["off","false", "0"].include?(args[0].to_s.strip.downcase)
|
|
32
|
-
if !is_on && !is_off
|
|
33
|
-
puts optparse
|
|
34
|
-
exit 1
|
|
35
|
-
end
|
|
36
|
-
Term::ANSIColor::coloring = is_on
|
|
37
|
-
end
|
|
38
|
-
if Term::ANSIColor::coloring?
|
|
39
|
-
puts "#{cyan}coloring is #{bold}#{green}on#{reset}"
|
|
40
|
-
else
|
|
41
|
-
puts "coloring is off"
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
end
|