morpheus-cli 8.0.6 → 8.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bd49f7ba0c5284049c949b7eb9abab30586335cf7994071467ac2e40e5052f8
4
- data.tar.gz: 8042138fa3aa60542f6a042a035172f15aac37483fd3fea25fd11ed550e1ba29
3
+ metadata.gz: 28b8927c521af95d6c463be3cf8de08ad7f84017e18ab89a8143759d6e11e722
4
+ data.tar.gz: 0a1c6677040bcb8e50a5bde9603b5cda373d8ee16c41cf3a74ed96f1ff23a1be
5
5
  SHA512:
6
- metadata.gz: 24dd7b12d6f4a3884844af6ad53736cfecf3c28102aae2f2b8a710bac97433955aae2d7771f367ae8241f721a701c5a8d375a95fe065af5162280ebbe737d342
7
- data.tar.gz: 1dca804ca56f509dcf13d9a35312de4429b0163e74f4140952fa06d15b8928f8ebe3132537b77ae1939307a2fcb69aa9d9ea52e2293753a042fdf5a6cf8da2f2
6
+ metadata.gz: 0dca9e1aedcf8daedd76aba8e43b93d56733c05d247aa8fc31b0324d2b22c122e6164519e870a590ff703ad5413b8b96cf822dd537533acd2f2dce53a6fc6697
7
+ data.tar.gz: a8cdd96b0895216198267f1b639b97654fa0e0c2c38db49f55eb6776153305d59148febbca8bac8fe81bf193d3b465a90fbcd38bf8b52d508e01bdc3dfc44670
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  FROM ruby:2.7.5
2
2
 
3
- RUN gem install morpheus-cli -v 8.0.6
3
+ RUN gem install morpheus-cli -v 8.0.7
4
4
 
5
5
  ENTRYPOINT ["morpheus"]
@@ -1477,33 +1477,56 @@ class Morpheus::Cli::Hosts
1477
1477
  def upgrade_agent(args)
1478
1478
  options = {}
1479
1479
  optparse = Morpheus::Cli::OptionParser.new do |opts|
1480
- opts.banner = subcommand_usage("[name]")
1481
- build_common_options(opts, options, [:json, :dry_run, :quiet, :remote])
1480
+ opts.banner = subcommand_usage("[host]")
1481
+ opts.on('--refresh [SECONDS]', String, "Refresh until execution is complete. Default interval is #{default_refresh_interval} seconds.") do |val|
1482
+ options[:refresh_interval] = val.to_s.empty? ? default_refresh_interval : val.to_f
1483
+ end
1484
+ opts.on(nil, '--no-refresh', "Do not refresh" ) do
1485
+ options[:no_refresh] = true
1486
+ end
1487
+ build_standard_update_options(opts, options, [:auto_confirm])
1488
+ opts.footer = <<-EOT
1489
+ Upgrade agent for a host.
1490
+ [host] is required. This is the name or id of a host.
1491
+ EOT
1482
1492
  end
1483
1493
  optparse.parse!(args)
1484
- if args.count < 1
1485
- puts optparse
1486
- exit 1
1487
- end
1494
+ verify_args!(args:args, optparse:optparse, count:1)
1488
1495
  connect(options)
1489
- begin
1490
- host = find_host_by_name_or_id(args[0])
1491
- @servers_interface.setopts(options)
1492
- if options[:dry_run]
1493
- print_dry_run @servers_interface.dry.upgrade(host['id'])
1494
- return
1495
- end
1496
- json_response = @servers_interface.upgrade(host['id'])
1497
- if options[:json]
1498
- print JSON.pretty_generate(json_response)
1499
- print "\n"
1496
+
1497
+ host = find_host_by_name_or_id(args[0])
1498
+ return 1 if host.nil?
1499
+
1500
+ payload = {}
1501
+ if options[:payload]
1502
+ payload = options[:payload]
1503
+ payload.deep_merge!({'server' => parse_passed_options(options)})
1504
+ else
1505
+ payload.deep_merge!({'server' => parse_passed_options(options)})
1506
+ end
1507
+
1508
+ @servers_interface.setopts(options)
1509
+ if options[:dry_run]
1510
+ print_dry_run @servers_interface.dry.upgrade(host['id'], payload)
1511
+ return
1512
+ end
1513
+ json_response = @servers_interface.upgrade(host['id'], payload)
1514
+ render_response(json_response, options) do
1515
+ #get([host['id']])
1516
+ if json_response['success']
1517
+ if json_response['msg'] == nil
1518
+ print_green_success "Upgrading agent on host #{host['name']}..."
1519
+ else
1520
+ print_green_success json_response['msg']
1521
+ end
1522
+ execution_id = json_response['executionId']
1523
+ if !options[:no_refresh] && execution_id
1524
+ wait_for_execution_request(json_response['executionId'], options.merge({waiting_status:['new', 'pending', 'executing']}))
1525
+ end
1500
1526
  else
1501
- puts "Host #{host['name']} upgrading..." unless options[:quiet]
1527
+ # never reached because unsuccessful requests raise an exception
1528
+ print_red_alert "API Request failed: #{json_response['msg']}"
1502
1529
  end
1503
- return
1504
- rescue RestClient::Exception => e
1505
- print_rest_exception(e, options)
1506
- exit 1
1507
1530
  end
1508
1531
  end
1509
1532
 
@@ -326,6 +326,7 @@ class Morpheus::Cli::License
326
326
  'Never'
327
327
  end
328
328
  },
329
+ "Version" => lambda {|it| it["licenseVersion"] },
329
330
  "Multi-Tenant" => lambda {|it| format_boolean it["multiTenant"] },
330
331
  "White Label" => lambda {|it| format_boolean it["whitelabel"] },
331
332
  "Stats Reporting" => lambda {|it| format_boolean it["reportStatus"] },
@@ -361,6 +362,7 @@ class Morpheus::Cli::License
361
362
  used_hosts = current_usage['hosts']
362
363
  used_mvm = current_usage['mvm']
363
364
  used_mvm_sockets = current_usage['mvmSockets']
365
+ used_sockets = current_usage['sockets'].to_f.round(1)
364
366
  used_iac = current_usage['iac']
365
367
  used_xaas = current_usage['xaas']
366
368
  used_executions = current_usage['executions']
@@ -373,6 +375,7 @@ class Morpheus::Cli::License
373
375
  max_hosts = license['maxHosts']
374
376
  max_mvm = license['maxMvm']
375
377
  max_mvm_sockets = license['maxMvmSockets']
378
+ max_sockets = license['maxSockets']
376
379
  max_iac = license['maxIac']
377
380
  max_xaas = license['maxXaas']
378
381
  max_executions = license['maxExecutions']
@@ -381,6 +384,7 @@ class Morpheus::Cli::License
381
384
  label_width = 20
382
385
  chart_opts = {max_bars: 20, unlimited_label: '0%', percent_sigdig: 0}
383
386
  out = ""
387
+ out << cyan + "Sockets".rjust(label_width, ' ') + ": " + generate_usage_bar(used_sockets, max_sockets, chart_opts) + cyan + used_sockets.to_s.rjust(8, ' ') + " / " + (max_sockets ? max_sockets.to_s : unlimited_label).to_s.ljust(15, ' ') + "\n"
384
388
  out << cyan + "Managed Servers".rjust(label_width, ' ') + ": " + generate_usage_bar(used_managed_servers, max_managed_servers, chart_opts) + cyan + used_managed_servers.to_s.rjust(8, ' ') + " / " + (max_managed_servers ? max_managed_servers.to_s : unlimited_label).to_s.ljust(15, ' ') + "\n"
385
389
  out << cyan + "Discovered Servers".rjust(label_width, ' ') + ": " + generate_usage_bar(used_discovered_servers, max_discovered_servers, chart_opts) + cyan + used_discovered_servers.to_s.rjust(8, ' ') + " / " + (max_discovered_servers ? max_discovered_servers.to_s : unlimited_label).to_s.ljust(15, ' ') + "\n"
386
390
  out << cyan + "Hosts".rjust(label_width, ' ') + ": " + generate_usage_bar(used_hosts, max_hosts, chart_opts) + cyan + used_hosts.to_s.rjust(8, ' ') + " / " + (max_hosts ? max_hosts.to_s : unlimited_label).to_s.ljust(15, ' ') + "\n"
@@ -439,6 +443,7 @@ class Morpheus::Cli::License
439
443
  'Never'
440
444
  end
441
445
  },
446
+ "Version" => lambda {|it| it["licenseVersion"] },
442
447
  "Multi-Tenant" => lambda {|it| format_boolean it["multiTenant"] },
443
448
  "White Label" => lambda {|it| format_boolean it["whitelabel"] },
444
449
  "Stats Reporting" => lambda {|it| format_boolean it["reportStatus"] },
@@ -451,11 +456,12 @@ class Morpheus::Cli::License
451
456
  })
452
457
  else
453
458
  license_columns.merge!({
459
+ "Sockets" => 'maxSockets',
460
+ "HPE VM Sockets" => 'maxMvmSockets',
454
461
  "Managed Servers" => 'maxManagedServers',
455
462
  "Discovered Servers" => 'maxDiscoveredServers',
456
463
  "Hosts" => 'maxHosts',
457
464
  "HPE VM Hosts" => 'maxMvm',
458
- "HPE VM Sockets" => 'maxMvmSockets',
459
465
  "Iac Deployments" => 'maxIac',
460
466
  "Xaas Instances" => 'maxXaas',
461
467
  "Executions" => 'maxExecutions',
@@ -153,6 +153,7 @@ class Morpheus::Cli::ServicePlanCommand
153
153
  "Code" => lambda {|it| it['code']},
154
154
  "Display Order" => lambda {|it| it['sortOrder']},
155
155
  "Provision Type" => lambda {|it| it['provisionType'] ? it['provisionType']['name'] : ''},
156
+ "Server Type" => lambda {|it| it['serverType']},
156
157
  "Storage" => lambda {|it| printable_byte_size(it, it['maxStorage'], 'storageSizeType', 'GB')}
157
158
  }
158
159
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "8.0.6"
4
+ VERSION = "8.0.7"
5
5
  end
6
6
  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: 8.0.6
4
+ version: 8.0.7
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: 2025-05-22 00:00:00.000000000 Z
14
+ date: 2025-06-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: public_suffix