morpheus-cli 4.2.8 → 4.2.10
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/Dockerfile +1 -1
- data/lib/morpheus/api.rb +1 -1
- data/lib/morpheus/api/activity_interface.rb +9 -0
- data/lib/morpheus/api/api_client.rb +83 -27
- data/lib/morpheus/api/apps_interface.rb +21 -0
- data/lib/morpheus/api/dashboard_interface.rb +5 -21
- data/lib/morpheus/api/instances_interface.rb +3 -10
- data/lib/morpheus/api/invoice_line_items_interface.rb +14 -0
- data/lib/morpheus/api/invoices_interface.rb +7 -12
- data/lib/morpheus/api/library_layouts_interface.rb +8 -0
- data/lib/morpheus/api/ping_interface.rb +20 -0
- data/lib/morpheus/api/projects_interface.rb +33 -0
- data/lib/morpheus/api/setup_interface.rb +19 -36
- data/lib/morpheus/api/user_settings_interface.rb +0 -6
- data/lib/morpheus/api/whoami_interface.rb +4 -8
- data/lib/morpheus/benchmarking.rb +16 -26
- data/lib/morpheus/cli.rb +10 -5
- data/lib/morpheus/cli/access_token_command.rb +5 -8
- data/lib/morpheus/cli/activity_command.rb +146 -0
- data/lib/morpheus/cli/apps.rb +312 -121
- data/lib/morpheus/cli/archives_command.rb +1 -1
- data/lib/morpheus/cli/auth_command.rb +4 -11
- data/lib/morpheus/cli/blueprints_command.rb +196 -137
- data/lib/morpheus/cli/change_password_command.rb +1 -1
- data/lib/morpheus/cli/cli_command.rb +225 -72
- data/lib/morpheus/cli/cli_registry.rb +2 -2
- data/lib/morpheus/cli/cloud_datastores_command.rb +1 -1
- data/lib/morpheus/cli/clouds.rb +5 -20
- data/lib/morpheus/cli/clusters.rb +4 -28
- data/lib/morpheus/cli/commands/standard/alias_command.rb +2 -9
- data/lib/morpheus/cli/commands/standard/benchmark_command.rb +2 -0
- data/lib/morpheus/cli/commands/standard/curl_command.rb +2 -3
- data/lib/morpheus/cli/commands/standard/history_command.rb +3 -6
- data/lib/morpheus/cli/commands/standard/man_command.rb +10 -7
- data/lib/morpheus/cli/commands/standard/ssl_verification_command.rb +10 -9
- data/lib/morpheus/cli/containers_command.rb +3 -3
- data/lib/morpheus/cli/credentials.rb +13 -16
- data/lib/morpheus/cli/error_handler.rb +18 -12
- data/lib/morpheus/cli/errors.rb +45 -0
- data/lib/morpheus/cli/execute_schedules_command.rb +1 -1
- data/lib/morpheus/cli/execution_request_command.rb +4 -4
- data/lib/morpheus/cli/groups.rb +84 -132
- data/lib/morpheus/cli/hosts.rb +6 -16
- data/lib/morpheus/cli/instances.rb +100 -183
- data/lib/morpheus/cli/invoices_command.rb +505 -71
- data/lib/morpheus/cli/library_layouts_command.rb +254 -166
- data/lib/morpheus/cli/library_option_lists_command.rb +0 -87
- data/lib/morpheus/cli/library_option_types_command.rb +0 -96
- data/lib/morpheus/cli/license.rb +3 -0
- data/lib/morpheus/cli/login.rb +17 -37
- data/lib/morpheus/cli/logout.rb +9 -5
- data/lib/morpheus/cli/mixins/accounts_helper.rb +83 -7
- data/lib/morpheus/cli/mixins/operations_helper.rb +41 -0
- data/lib/morpheus/cli/mixins/option_source_helper.rb +255 -0
- data/lib/morpheus/cli/mixins/print_helper.rb +18 -4
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +222 -13
- data/lib/morpheus/cli/mixins/remote_helper.rb +139 -0
- data/lib/morpheus/cli/monitoring_checks_command.rb +11 -3
- data/lib/morpheus/cli/network_groups_command.rb +8 -2
- data/lib/morpheus/cli/option_types.rb +1 -1
- data/lib/morpheus/cli/ping.rb +252 -0
- data/lib/morpheus/cli/price_sets_command.rb +16 -27
- data/lib/morpheus/cli/prices_command.rb +34 -27
- data/lib/morpheus/cli/processes_command.rb +81 -7
- data/lib/morpheus/cli/projects_command.rb +607 -0
- data/lib/morpheus/cli/recent_activity_command.rb +87 -65
- data/lib/morpheus/cli/remote.rb +965 -974
- data/lib/morpheus/cli/reports_command.rb +3 -15
- data/lib/morpheus/cli/roles.rb +8 -31
- data/lib/morpheus/cli/service_plans_command.rb +25 -31
- data/lib/morpheus/cli/setup.rb +392 -0
- data/lib/morpheus/cli/shell.rb +144 -56
- data/lib/morpheus/cli/subnets_command.rb +71 -11
- data/lib/morpheus/cli/tasks.rb +3 -3
- data/lib/morpheus/cli/user_sources_command.rb +4 -4
- data/lib/morpheus/cli/users.rb +135 -109
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/whitelabel_settings_command.rb +7 -7
- data/lib/morpheus/cli/whoami.rb +90 -129
- data/lib/morpheus/cli/wiki_command.rb +2 -14
- data/lib/morpheus/ext/rest_client.rb +36 -0
- data/lib/morpheus/formatters.rb +42 -5
- data/lib/morpheus/rest_client.rb +0 -10
- data/lib/morpheus/terminal.rb +41 -1
- data/lib/morpheus/util.rb +24 -0
- metadata +16 -3
- data/lib/morpheus/cli/command_error.rb +0 -22
data/lib/morpheus/rest_client.rb
CHANGED
|
@@ -69,16 +69,6 @@ module Morpheus
|
|
|
69
69
|
@@ssl_verification_enabled = verify
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
private
|
|
73
|
-
|
|
74
|
-
# unused eh?
|
|
75
|
-
def build_request_args(url, method, payload)
|
|
76
|
-
args = {url: url, method: method, payload: payload}
|
|
77
|
-
unless ssl_verification_enabled?
|
|
78
|
-
args[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE
|
|
79
|
-
end
|
|
80
|
-
args
|
|
81
|
-
end
|
|
82
72
|
end
|
|
83
73
|
end
|
|
84
74
|
end
|
data/lib/morpheus/terminal.rb
CHANGED
|
@@ -238,6 +238,21 @@ module Morpheus
|
|
|
238
238
|
opts.on('--noprofile','--noprofile', "Do not read and execute the personal initialization script .morpheus_profile") do
|
|
239
239
|
@noprofile = true
|
|
240
240
|
end
|
|
241
|
+
# todo: make these work
|
|
242
|
+
# opts.on('--home','--home', "Morpheus client home directory, where configuration files are located. The default is MORPHEUS_CLI_HOME or HOME/.morpheus") do |val|
|
|
243
|
+
# @use_home_directory = val
|
|
244
|
+
# set_home_directory(@use_home_directory)
|
|
245
|
+
# # that it? all done...
|
|
246
|
+
# end
|
|
247
|
+
# opts.on('-Z','--temporary', "Temporary shell. Use a temporary shell with the current remote configuration, credentials and commands loaded. Configuration changes and command history will not be saved.") do
|
|
248
|
+
# @noprofile = true
|
|
249
|
+
# @temporary_shell_mode = true
|
|
250
|
+
# end
|
|
251
|
+
# opts.on('-z','--clean', "Clean shell. Use a temporary shell without any remote configuration, credentials or command history loaded.") do
|
|
252
|
+
# @noprofile = true
|
|
253
|
+
# @temporary_shell_mode = true
|
|
254
|
+
# @clean_shell_mode = true
|
|
255
|
+
# end
|
|
241
256
|
opts.on('-C','--nocolor', "Disable ANSI coloring") do
|
|
242
257
|
@coloring = false
|
|
243
258
|
Term::ANSIColor::coloring = false
|
|
@@ -355,6 +370,29 @@ module Morpheus
|
|
|
355
370
|
result = nil
|
|
356
371
|
begin
|
|
357
372
|
|
|
373
|
+
# todo: no, this needs to be supported as --home for every darn command..
|
|
374
|
+
# add it to CliCommand build_common_options()
|
|
375
|
+
# use custom home directory from --home
|
|
376
|
+
# todo: this should happen in initialize..
|
|
377
|
+
# @use_home_directory
|
|
378
|
+
# need to get index, and delete both the switch and the arg after it
|
|
379
|
+
homedir = false
|
|
380
|
+
home_switch_index = args.index {|it| it == '--home' }
|
|
381
|
+
if args.find {|it| it == '--home' }
|
|
382
|
+
deleted_option = args.delete_at(home_switch_index)
|
|
383
|
+
home_dir = args.delete_at(home_switch_index)
|
|
384
|
+
@use_home_directory = home_dir
|
|
385
|
+
#puts "Setting home directory to #{@use_home_directory}"
|
|
386
|
+
set_home_directory(@use_home_directory)
|
|
387
|
+
# re-initialize some variables
|
|
388
|
+
# startup script
|
|
389
|
+
if File.exists? Morpheus::Cli::DotFile.morpheus_profile_filename
|
|
390
|
+
@profile_dot_file = Morpheus::Cli::DotFile.new(Morpheus::Cli::DotFile.morpheus_profile_filename)
|
|
391
|
+
else
|
|
392
|
+
@profile_dot_file = nil
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
|
|
358
396
|
# execute startup script .morpheus_profile unless --noprofile is passed
|
|
359
397
|
# todo: this should happen in initialize..
|
|
360
398
|
noprofile = false
|
|
@@ -363,6 +401,7 @@ module Morpheus
|
|
|
363
401
|
args.delete_if {|it| it == '--noprofile' }
|
|
364
402
|
end
|
|
365
403
|
|
|
404
|
+
|
|
366
405
|
if @profile_dot_file && !@profile_dot_file_has_run
|
|
367
406
|
if !noprofile && File.exists?(@profile_dot_file.filename)
|
|
368
407
|
execute_profile_script()
|
|
@@ -411,7 +450,7 @@ module Morpheus
|
|
|
411
450
|
# all commands should be registered commands or aliases
|
|
412
451
|
# ahh, but it could support expressions (), use -e for that ..
|
|
413
452
|
# if !(Morpheus::Cli::CliRegistry.has_command?(cmd_name) || Morpheus::Cli::CliRegistry.has_alias?(cmd_name))
|
|
414
|
-
# @stderr.puts "#{@angry_prompt}'#{cmd_name}' is not recognized
|
|
453
|
+
# @stderr.puts "#{@angry_prompt}'#{cmd_name}' is not recognized"
|
|
415
454
|
# #@stderr.puts usage
|
|
416
455
|
# return 127, nil
|
|
417
456
|
# end
|
|
@@ -420,6 +459,7 @@ module Morpheus
|
|
|
420
459
|
benchmark_name = "morpheus #{formatted_cmd}"
|
|
421
460
|
benchmark_name.sub!(' -B', '')
|
|
422
461
|
benchmark_name.sub!(' --benchmark', '')
|
|
462
|
+
#benchmark_name << " -B"
|
|
423
463
|
start_benchmark(benchmark_name)
|
|
424
464
|
end
|
|
425
465
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Provides global utility methods
|
|
2
|
+
# Such as opening a web browser to a url
|
|
3
|
+
#
|
|
4
|
+
module Morpheus::Util
|
|
5
|
+
|
|
6
|
+
def self.open_url_command(url)
|
|
7
|
+
cmd = nil
|
|
8
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
|
|
9
|
+
cmd = "start #{url}"
|
|
10
|
+
elsif RbConfig::CONFIG['host_os'] =~ /darwin/
|
|
11
|
+
cmd = "open #{url}"
|
|
12
|
+
elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/
|
|
13
|
+
cmd = "xdg-open #{url}"
|
|
14
|
+
else
|
|
15
|
+
raise "open_url_command cannot determine host OS"
|
|
16
|
+
end
|
|
17
|
+
return cmd
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.open_url(url)
|
|
21
|
+
cmd = open_url_command(url)
|
|
22
|
+
return system(cmd)
|
|
23
|
+
end
|
|
24
|
+
end
|
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: 4.2.
|
|
4
|
+
version: 4.2.10
|
|
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: 2020-
|
|
14
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -174,6 +174,7 @@ files:
|
|
|
174
174
|
- lib/morpheus/api.rb
|
|
175
175
|
- lib/morpheus/api/account_groups_interface.rb
|
|
176
176
|
- lib/morpheus/api/accounts_interface.rb
|
|
177
|
+
- lib/morpheus/api/activity_interface.rb
|
|
177
178
|
- lib/morpheus/api/api_client.rb
|
|
178
179
|
- lib/morpheus/api/appliance_settings_interface.rb
|
|
179
180
|
- lib/morpheus/api/approvals_interface.rb
|
|
@@ -212,6 +213,7 @@ files:
|
|
|
212
213
|
- lib/morpheus/api/instance_types_interface.rb
|
|
213
214
|
- lib/morpheus/api/instances_interface.rb
|
|
214
215
|
- lib/morpheus/api/integrations_interface.rb
|
|
216
|
+
- lib/morpheus/api/invoice_line_items_interface.rb
|
|
215
217
|
- lib/morpheus/api/invoices_interface.rb
|
|
216
218
|
- lib/morpheus/api/jobs_interface.rb
|
|
217
219
|
- lib/morpheus/api/key_pairs_interface.rb
|
|
@@ -252,11 +254,13 @@ files:
|
|
|
252
254
|
- lib/morpheus/api/option_types_interface.rb
|
|
253
255
|
- lib/morpheus/api/options_interface.rb
|
|
254
256
|
- lib/morpheus/api/packages_interface.rb
|
|
257
|
+
- lib/morpheus/api/ping_interface.rb
|
|
255
258
|
- lib/morpheus/api/policies_interface.rb
|
|
256
259
|
- lib/morpheus/api/power_schedules_interface.rb
|
|
257
260
|
- lib/morpheus/api/price_sets_interface.rb
|
|
258
261
|
- lib/morpheus/api/prices_interface.rb
|
|
259
262
|
- lib/morpheus/api/processes_interface.rb
|
|
263
|
+
- lib/morpheus/api/projects_interface.rb
|
|
260
264
|
- lib/morpheus/api/provision_types_interface.rb
|
|
261
265
|
- lib/morpheus/api/provisioning_license_types_interface.rb
|
|
262
266
|
- lib/morpheus/api/provisioning_licenses_interface.rb
|
|
@@ -286,6 +290,7 @@ files:
|
|
|
286
290
|
- lib/morpheus/cli.rb
|
|
287
291
|
- lib/morpheus/cli/access_token_command.rb
|
|
288
292
|
- lib/morpheus/cli/account_groups_command.rb
|
|
293
|
+
- lib/morpheus/cli/activity_command.rb
|
|
289
294
|
- lib/morpheus/cli/appliance_settings_command.rb
|
|
290
295
|
- lib/morpheus/cli/approvals_command.rb
|
|
291
296
|
- lib/morpheus/cli/apps.rb
|
|
@@ -303,7 +308,6 @@ files:
|
|
|
303
308
|
- lib/morpheus/cli/cloud_resource_pools_command.rb
|
|
304
309
|
- lib/morpheus/cli/clouds.rb
|
|
305
310
|
- lib/morpheus/cli/clusters.rb
|
|
306
|
-
- lib/morpheus/cli/command_error.rb
|
|
307
311
|
- lib/morpheus/cli/commands/standard/alias_command.rb
|
|
308
312
|
- lib/morpheus/cli/commands/standard/benchmark_command.rb
|
|
309
313
|
- lib/morpheus/cli/commands/standard/cat_command.rb
|
|
@@ -334,6 +338,7 @@ files:
|
|
|
334
338
|
- lib/morpheus/cli/dot_file.rb
|
|
335
339
|
- lib/morpheus/cli/environments_command.rb
|
|
336
340
|
- lib/morpheus/cli/error_handler.rb
|
|
341
|
+
- lib/morpheus/cli/errors.rb
|
|
337
342
|
- lib/morpheus/cli/execute_schedules_command.rb
|
|
338
343
|
- lib/morpheus/cli/execution_request_command.rb
|
|
339
344
|
- lib/morpheus/cli/expression_parser.rb
|
|
@@ -371,9 +376,12 @@ files:
|
|
|
371
376
|
- lib/morpheus/cli/mixins/library_helper.rb
|
|
372
377
|
- lib/morpheus/cli/mixins/logs_helper.rb
|
|
373
378
|
- lib/morpheus/cli/mixins/monitoring_helper.rb
|
|
379
|
+
- lib/morpheus/cli/mixins/operations_helper.rb
|
|
380
|
+
- lib/morpheus/cli/mixins/option_source_helper.rb
|
|
374
381
|
- lib/morpheus/cli/mixins/print_helper.rb
|
|
375
382
|
- lib/morpheus/cli/mixins/processes_helper.rb
|
|
376
383
|
- lib/morpheus/cli/mixins/provisioning_helper.rb
|
|
384
|
+
- lib/morpheus/cli/mixins/remote_helper.rb
|
|
377
385
|
- lib/morpheus/cli/mixins/whoami_helper.rb
|
|
378
386
|
- lib/morpheus/cli/monitoring_alerts_command.rb
|
|
379
387
|
- lib/morpheus/cli/monitoring_apps_command.rb
|
|
@@ -392,12 +400,14 @@ files:
|
|
|
392
400
|
- lib/morpheus/cli/option_parser.rb
|
|
393
401
|
- lib/morpheus/cli/option_types.rb
|
|
394
402
|
- lib/morpheus/cli/packages_command.rb
|
|
403
|
+
- lib/morpheus/cli/ping.rb
|
|
395
404
|
- lib/morpheus/cli/policies_command.rb
|
|
396
405
|
- lib/morpheus/cli/power_schedules_command.rb
|
|
397
406
|
- lib/morpheus/cli/preseed_scripts_command.rb
|
|
398
407
|
- lib/morpheus/cli/price_sets_command.rb
|
|
399
408
|
- lib/morpheus/cli/prices_command.rb
|
|
400
409
|
- lib/morpheus/cli/processes_command.rb
|
|
410
|
+
- lib/morpheus/cli/projects_command.rb
|
|
401
411
|
- lib/morpheus/cli/provisioning_licenses_command.rb
|
|
402
412
|
- lib/morpheus/cli/provisioning_settings_command.rb
|
|
403
413
|
- lib/morpheus/cli/recent_activity_command.rb
|
|
@@ -407,6 +417,7 @@ files:
|
|
|
407
417
|
- lib/morpheus/cli/security_group_rules.rb
|
|
408
418
|
- lib/morpheus/cli/security_groups.rb
|
|
409
419
|
- lib/morpheus/cli/service_plans_command.rb
|
|
420
|
+
- lib/morpheus/cli/setup.rb
|
|
410
421
|
- lib/morpheus/cli/shell.rb
|
|
411
422
|
- lib/morpheus/cli/storage_providers_command.rb
|
|
412
423
|
- lib/morpheus/cli/subnets_command.rb
|
|
@@ -424,11 +435,13 @@ files:
|
|
|
424
435
|
- lib/morpheus/cli/workflows.rb
|
|
425
436
|
- lib/morpheus/ext/hash.rb
|
|
426
437
|
- lib/morpheus/ext/nil_class.rb
|
|
438
|
+
- lib/morpheus/ext/rest_client.rb
|
|
427
439
|
- lib/morpheus/formatters.rb
|
|
428
440
|
- lib/morpheus/logging.rb
|
|
429
441
|
- lib/morpheus/morpkg.rb
|
|
430
442
|
- lib/morpheus/rest_client.rb
|
|
431
443
|
- lib/morpheus/terminal.rb
|
|
444
|
+
- lib/morpheus/util.rb
|
|
432
445
|
- morpheus-cli.gemspec
|
|
433
446
|
homepage:
|
|
434
447
|
licenses:
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# A standard error to raise in your CliCommand classes.
|
|
2
|
-
class Morpheus::Cli::CommandError < StandardError
|
|
3
|
-
|
|
4
|
-
attr_reader :args, :exit_code
|
|
5
|
-
|
|
6
|
-
# def initialize(msg, args=[], options={})
|
|
7
|
-
# @args = args
|
|
8
|
-
# @options = options
|
|
9
|
-
# super(msg)
|
|
10
|
-
# end
|
|
11
|
-
|
|
12
|
-
def initialize(msg, args=[], exit_code=nil)
|
|
13
|
-
@args = args
|
|
14
|
-
@exit_code = exit_code
|
|
15
|
-
super(msg)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# def inspect
|
|
19
|
-
# to_s
|
|
20
|
-
# end
|
|
21
|
-
|
|
22
|
-
end
|