morpheus-cli 6.1.0 → 6.1.1

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.
@@ -297,7 +297,29 @@ EOT
297
297
  if access.count > 0
298
298
  access.each {|it| it['access'] = format_access_string(it['access'], available_access_levels)}
299
299
 
300
- if ['features', 'instance_types'].include?(field)
300
+ if ['features'].include?(field)
301
+ if access.find {|it| !it['subCategory'].to_s.empty? }
302
+ rows = access.collect do |it|
303
+ {
304
+ code: it['code'],
305
+ name: it['name'],
306
+ category: it['subCategory'].to_s.titleize,
307
+ access: format_access_string(it['access']),
308
+ }
309
+ end
310
+ if options[:sort]
311
+ rows.sort! {|a,b| a[options[:sort]] <=> b[options[:sort]] }
312
+ else
313
+ rows.sort! {|a,b| [a[:category],a[:name],a[:code]] <=> [b[:category],b[:name],b[:code]] }
314
+ end
315
+ if options[:direction] == 'desc'
316
+ rows.reverse!
317
+ end
318
+ print as_pretty_table(rows, [:category, :name, :code, :access], options)
319
+ else
320
+ print as_pretty_table(access, [:name, :code, :access], options)
321
+ end
322
+ elsif ['instance_types','report_types'].include?(field)
301
323
  print as_pretty_table(access, [:name, :code, :access], options)
302
324
  else
303
325
  print as_pretty_table(access, [:name, :access], options)
@@ -422,7 +444,29 @@ EOT
422
444
  if access.count > 0
423
445
  access.each {|it| it['access'] = format_access_string(it['access'], available_access_levels)}
424
446
 
425
- if ['features', 'instance_types', 'report_types'].include?(field)
447
+ if ['features'].include?(field)
448
+ if access.find {|it| !it['subCategory'].to_s.empty? }
449
+ rows = access.collect do |it|
450
+ {
451
+ code: it['code'],
452
+ name: it['name'],
453
+ category: it['subCategory'].to_s.titleize,
454
+ access: format_access_string(it['access']),
455
+ }
456
+ end
457
+ if options[:sort]
458
+ rows.sort! {|a,b| a[options[:sort]] <=> b[options[:sort]] }
459
+ else
460
+ rows.sort! {|a,b| [a[:category],a[:name],a[:code]] <=> [b[:category],b[:name],b[:code]] }
461
+ end
462
+ if options[:direction] == 'desc'
463
+ rows.reverse!
464
+ end
465
+ print as_pretty_table(rows, [:category, :name, :code, :access], options)
466
+ else
467
+ print as_pretty_table(access, [:name, :code, :access], options)
468
+ end
469
+ elsif ['instance_types','report_types'].include?(field)
426
470
  print as_pretty_table(access, [:name, :code, :access], options)
427
471
  else
428
472
  print as_pretty_table(access, [:name, :access], options)
@@ -719,7 +719,7 @@ module Morpheus::Cli::ProvisioningHelper
719
719
  service_plan = nil
720
720
 
721
721
  prompt_service_plan = -> {
722
- service_plans_json = instances_interface.service_plans({zoneId: cloud_id, layoutId: layout['id'], siteId: group_id}.merge(resource_pool.nil? ? {} : {'resourcePoolId' => resource_pool['id']}))
722
+ service_plans_json = instances_interface.service_plans({zoneId: cloud_id, layoutId: layout['id'], siteId: group_id}.merge(resource_pool.nil? ? {} : {'poolId' => resource_pool['id'], 'resourcePoolId' => resource_pool['id']}))
723
723
  service_plans = service_plans_json["plans"]
724
724
  if locked_fields.include?('plan.id')
725
725
  plan_id = options[:options]['plan']['id'] rescue nil
@@ -773,8 +773,8 @@ module Morpheus::Cli::ProvisioningHelper
773
773
  has_zone_pools = provision_type && provision_type["id"] && provision_type["hasZonePools"]
774
774
  if has_zone_pools
775
775
  # pluck out the resourcePoolId option type to prompt for
776
- resource_pool_option_type = option_type_list.find {|opt| ['resourcePool','resourcePoolId','azureResourceGroupId'].include?(opt['fieldName']) }
777
- option_type_list = option_type_list.reject {|opt| ['resourcePool','resourcePoolId','azureResourceGroupId'].include?(opt['fieldName']) }
776
+ resource_pool_option_type = option_type_list.find {|opt| ['poolId','resourcePool','resourcePoolId','azureResourceGroupId'].include?(opt['fieldName']) }
777
+ option_type_list = option_type_list.reject {|opt| ['poolId','resourcePool','resourcePoolId','azureResourceGroupId'].include?(opt['fieldName']) }
778
778
 
779
779
  resource_pool_options = options_interface.options_for_source('zonePools', {groupId: group_id, siteId: group_id, zoneId: cloud_id, cloudId: cloud_id, instanceTypeId: instance_type['id'], layoutId: layout["id"]}.merge(service_plan.nil? ? {} : {planId: service_plan["id"]}))['data']
780
780
  if options[:resource_pool]
@@ -836,7 +836,7 @@ module Morpheus::Cli::ProvisioningHelper
836
836
  # add selectable datastores for resource pool
837
837
  if options[:select_datastore]
838
838
  begin
839
- selectable_datastores = datastores_interface.list({'zoneId' => cloud_id, 'siteId' => group_id, 'resourcePoolId' => resource_pool['id']})
839
+ selectable_datastores = datastores_interface.list({'zoneId' => cloud_id, 'siteId' => group_id, 'poolId' => resource_pool['id'], 'resourcePoolId' => resource_pool['id']})
840
840
  service_plan['datastores'] = {'clusters' => [], 'datastores' => []}
841
841
  ['clusters', 'datastores'].each do |type|
842
842
  service_plan['datastores'][type] ||= []
@@ -1538,7 +1538,7 @@ module Morpheus::Cli::ProvisioningHelper
1538
1538
 
1539
1539
  if datastore_options.empty? && storage_type['hasDatastore'] != false
1540
1540
  begin
1541
- datastore_res = datastores_interface.list({'resourcePoolId' => current_root_volume['resourcePoolId'], 'zoneId' => options['zoneId'], 'siteId' => options['siteId']})['datastores']
1541
+ datastore_res = datastores_interface.list({'poolId' => current_root_volume['resourcePoolId'], 'resourcePoolId' => current_root_volume['resourcePoolId'], 'zoneId' => options['zoneId'], 'siteId' => options['siteId']})['datastores']
1542
1542
  datastore_res.each do |opt|
1543
1543
  datastore_options << {'name' => opt['name'], 'value' => opt['id']}
1544
1544
  end
@@ -1578,7 +1578,7 @@ module Morpheus::Cli::ProvisioningHelper
1578
1578
  no_prompt = (options[:no_prompt] || (options[:options] && options[:options][:no_prompt]))
1579
1579
  network_interfaces = []
1580
1580
  api_params = {zoneId: zone_id, provisionTypeId: provision_type_id}.merge(options[:api_params] || {})
1581
- if pool_id.to_s =~ /\A\d{1,}\Z/
1581
+ if pool_id
1582
1582
  api_params[:poolId] = pool_id
1583
1583
  end
1584
1584
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "6.1.0"
4
+ VERSION = "6.1.1"
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: 6.1.0
4
+ version: 6.1.1
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: 2023-04-20 00:00:00.000000000 Z
14
+ date: 2023-05-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -260,7 +260,9 @@ files:
260
260
  - lib/morpheus/api/library_spec_templates_interface.rb
261
261
  - lib/morpheus/api/license_interface.rb
262
262
  - lib/morpheus/api/load_balancer_monitors_interface.rb
263
+ - lib/morpheus/api/load_balancer_pool_nodes_interface.rb
263
264
  - lib/morpheus/api/load_balancer_pools_interface.rb
265
+ - lib/morpheus/api/load_balancer_pools_secondary_interface.rb
264
266
  - lib/morpheus/api/load_balancer_profiles_interface.rb
265
267
  - lib/morpheus/api/load_balancer_types_interface.rb
266
268
  - lib/morpheus/api/load_balancer_virtual_servers_interface.rb
@@ -434,6 +436,7 @@ files:
434
436
  - lib/morpheus/cli/commands/library_upgrades_command.rb
435
437
  - lib/morpheus/cli/commands/license.rb
436
438
  - lib/morpheus/cli/commands/load_balancer_monitors.rb
439
+ - lib/morpheus/cli/commands/load_balancer_pool_nodes.rb
437
440
  - lib/morpheus/cli/commands/load_balancer_pools.rb
438
441
  - lib/morpheus/cli/commands/load_balancer_profiles.rb
439
442
  - lib/morpheus/cli/commands/load_balancer_types.rb