morpheus-cli 0.9.3 → 0.9.5
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/cli/instances.rb +11 -7
- data/lib/morpheus/cli/option_types.rb +1 -1
- data/lib/morpheus/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 434f161f0f0e7b31eb27d2930d1944e3bf7df388
|
4
|
+
data.tar.gz: 1362db4a4894832d043898ced414b6e60c99a344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
363
|
-
|
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
|
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
|
data/lib/morpheus/cli/version.rb
CHANGED