morpheus-cli 0.9.3 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc76035aa0ef2357f45015b8a206bc573ac04920
4
- data.tar.gz: 29937e60b69e809b83d4caa7f6011dff58b3d8a1
3
+ metadata.gz: 434f161f0f0e7b31eb27d2930d1944e3bf7df388
4
+ data.tar.gz: 1362db4a4894832d043898ced414b6e60c99a344
5
5
  SHA512:
6
- metadata.gz: f71800dfb8fcf0890fb498726547bb692f02ee08baeb3f808653a81c73b14899a3eca97c8dc4d4276bbeb36f95876984890029e43793a39f867e53afc68f97eb
7
- data.tar.gz: 1dc86e5c4dcf6ea494adb37d8e80b7dfafaa9c4b43f0d9bc0da22e6b5f525108b59940d88d25528aa5b8c2a879b66d439e355a93145b01fb8db5fcd6cdf5183d
6
+ metadata.gz: d701a012d0e66263f2d5b29c8426ecf24f627f9628cf167aecd54a30bc4ecfc6de1ee8249c012e21b93f439408d5dac4a23178d04627fd5a933cccbce7ad9ca2
7
+ data.tar.gz: 1415d32475a94b966ff1c1dd11d3cd79fd72d1fb37394d92dff020c85052a16b0073145058d3203817cb7ba8c1c18256b2b5a5b0e84c0fda2d99bca445e500a6
@@ -165,15 +165,16 @@ class Morpheus::Cli::Instances
165
165
  layout_id = layout_prompt['layout']
166
166
  plan_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'servicePlan', 'type' => 'select', 'fieldLabel' => 'Plan', 'optionSource' => 'instanceServicePlans', 'required' => true, 'description' => 'Choose the appropriately sized plan for this instance'}],options[:options],@api_client,{groupId: groupId, zoneId: cloud, instanceTypeId: instance_type['id'], layoutId: layout_id, version: version_prompt['version']})
167
167
  payload[:servicePlan] = plan_prompt['servicePlan']
168
+
168
169
  layout = instance_type['instanceTypeLayouts'].find{ |lt| lt['id'].to_i == layout_id.to_i}
169
170
  instance_type['instanceTypeLayouts'].sort! { |x,y| y['sortOrder'] <=> x['sortOrder'] }
170
171
 
171
172
  payload[:instance][:layout] = {id: layout['id']}
172
173
 
173
174
  type_payload = {}
174
- if !layout['optionTypes'].nil? && layout['optionTypes'].empty?
175
+ if !layout['optionTypes'].nil? && !layout['optionTypes'].empty?
175
176
  type_payload = Morpheus::Cli::OptionTypes.prompt(layout['optionTypes'],options[:options],@api_client,{groupId: groupId, cloudId: cloud, zoneId: cloud, instanceTypeId: instance_type['id'], version: version_prompt['version']})
176
- elsif !instance_type['optionTypes'].nil? && instance_type['optionTypes'].empty?
177
+ elsif !instance_type['optionTypes'].nil? && !instance_type['optionTypes'].empty?
177
178
  type_payload = Morpheus::Cli::OptionTypes.prompt(instance_type['optionTypes'],options[:options],@api_client,{groupId: groupId, cloudId: cloud, zoneId: cloud, instanceTypeId: instance_type['id'], version: version_prompt['version']})
178
179
  end
179
180
  if !type_payload['config'].nil?
@@ -339,11 +340,11 @@ class Morpheus::Cli::Instances
339
340
  print "\n" ,cyan, bold, "#{instance['name']} (#{instance['instanceType']['name']})\n","==================", "\n\n", reset, cyan
340
341
  envs = env_results['envs'] || {}
341
342
  if env_results['readOnlyEnvs']
342
- envs += env_results['readOnlyEnvs'].map { |k,v| {:name => k, :value => k.downcase.include?("password") ? "********" : v, :export => true}}
343
+ envs += env_results['readOnlyEnvs'].map { |k,v| {:name => k, :value => k.downcase.include?("password") || v['masked'] ? "********" : v['value'], :export => true}}
343
344
  end
344
345
  tp envs, :name, :value, :export
345
346
  print "\n" ,cyan, bold, "Imported Envs\n","==================", "\n\n", reset, cyan
346
- imported_envs = env_results['importedEnvs'].map { |k,v| {:name => k, :value => k.downcase.include?("password") ? "********" : v}}
347
+ imported_envs = env_results['importedEnvs'].map { |k,v| {:name => k, :value => k.downcase.include?("password") || v['masked'] ? "********" : v['value']}}
347
348
  tp imported_envs
348
349
  print reset, "\n"
349
350
 
@@ -359,8 +360,11 @@ class Morpheus::Cli::Instances
359
360
  optparse = OptionParser.new do|opts|
360
361
  opts.banner = "Usage: morpheus instances setenv INSTANCE NAME VALUE [-e]"
361
362
  opts.on( '-e', "Exportable" ) do |exportable|
362
- options[:export] = exportable
363
- end
363
+ options[:export] = exportable
364
+ end
365
+ opts.on( '-M', "Masked" ) do |masked|
366
+ options[:masked] = masked
367
+ end
364
368
  Morpheus::Cli::CliCommand.genericOptions(opts,options)
365
369
  end
366
370
  if args.count < 3
@@ -371,7 +375,7 @@ class Morpheus::Cli::Instances
371
375
  connect(options)
372
376
  begin
373
377
  instance = find_instance_by_name(args[0])
374
- evar = {name: args[1], value: args[2], export: options[:export]}
378
+ evar = {name: args[1], value: args[2], export: options[:export], masked: options[:masked]}
375
379
  params = {}
376
380
  @instances_interface.create_env(instance['id'], [evar])
377
381
  envs([args[0]])
@@ -133,7 +133,7 @@ module Morpheus
133
133
  if option_type['optionSource']
134
134
  source_options = load_source_options(option_type['optionSource'],api_client,api_params)
135
135
  end
136
- if !source_options['data'].nil? && !source_options['data'].count == 1 && option_type['skipSingleOption'] == true
136
+ if !source_options.nil? && !source_options.count == 1 && option_type['skipSingleOption'] == true
137
137
  value_found = true
138
138
  value = source_option['value']
139
139
  end
@@ -1,5 +1,5 @@
1
1
  module Morpheus
2
2
  module Cli
3
- VERSION = "0.9.3"
3
+ VERSION = "0.9.5"
4
4
  end
5
5
  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: 0.9.3
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Estes