morpheus-cli 4.0.0 → 4.0.0.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c6b60209108abab70f0d88711bf7779b71d96e9b8bafed4fc151c2cca8ab309
|
4
|
+
data.tar.gz: 0be087086ccd2e2eeb28cec0541a15140b69ce232b830dd3c8c9a14a0a62dd48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a92a52eb2a891c390b411508bd5dccdbaa4001be1e91578fddb19979fd169e4fbb5a890e21115d459de90fe4c441ecf39d158f244005a80dbd778e458591a9b
|
7
|
+
data.tar.gz: 85e1ea8863afaa9341f1dc35877398724a6c3a08331bab816d18fab5e95ad943a978e9946ae31911e95e9e805b81a724c39ad04dad02404cb17d861d12adaef5
|
@@ -3457,7 +3457,7 @@ class Morpheus::Cli::Instances
|
|
3457
3457
|
subtitles = []
|
3458
3458
|
subtitles += parse_list_subtitles(options)
|
3459
3459
|
print_h1 title, subtitles, options
|
3460
|
-
print_process_event_details(process_event)
|
3460
|
+
print_process_event_details(process_event, options)
|
3461
3461
|
print reset, "\n"
|
3462
3462
|
return 0
|
3463
3463
|
end
|
@@ -3804,7 +3804,7 @@ private
|
|
3804
3804
|
end
|
3805
3805
|
end
|
3806
3806
|
|
3807
|
-
def print_process_event_details(process_event)
|
3807
|
+
def print_process_event_details(process_event, options={})
|
3808
3808
|
# process_event =~ process
|
3809
3809
|
description_cols = {
|
3810
3810
|
"Process ID" => lambda {|it| it['processId'] },
|
@@ -193,11 +193,7 @@ class Morpheus::Cli::LibraryOptionListsCommand
|
|
193
193
|
end
|
194
194
|
optparse.parse!(args)
|
195
195
|
|
196
|
-
|
197
|
-
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'type', 'fieldLabel' => 'Type', 'type' => 'select', 'selectOptions' => get_available_option_list_types, 'defaultValue' => 'rest', 'required' => true}], options[:options], @api_client, {})
|
198
|
-
list_type = v_prompt['type']
|
199
|
-
end
|
200
|
-
|
196
|
+
|
201
197
|
connect(options)
|
202
198
|
begin
|
203
199
|
payload = nil
|
@@ -209,6 +205,10 @@ class Morpheus::Cli::LibraryOptionListsCommand
|
|
209
205
|
payload['optionTypeList'].deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) })
|
210
206
|
end
|
211
207
|
else
|
208
|
+
if !list_type
|
209
|
+
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'type', 'fieldLabel' => 'Type', 'type' => 'select', 'selectOptions' => get_available_option_list_types, 'defaultValue' => 'rest', 'required' => true}], options[:options], @api_client, {})
|
210
|
+
list_type = v_prompt['type']
|
211
|
+
end
|
212
212
|
params = Morpheus::Cli::OptionTypes.prompt(new_option_type_list_option_types(list_type), options[:options], @api_client, options[:params])
|
213
213
|
params['type'] = list_type
|
214
214
|
if params['type'] == 'rest'
|
@@ -235,12 +235,10 @@ class Morpheus::Cli::LibraryOptionListsCommand
|
|
235
235
|
print JSON.pretty_generate(json_response), "\n"
|
236
236
|
return
|
237
237
|
end
|
238
|
-
print_green_success "Added Option List #{list_payload['name']}"
|
239
|
-
#list([])
|
240
238
|
option_type_list = json_response['optionTypeList']
|
241
|
-
|
242
|
-
|
243
|
-
|
239
|
+
print_green_success "Added Option List #{option_type_list['name']}"
|
240
|
+
get([option_type_list['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
241
|
+
return 0
|
244
242
|
rescue RestClient::Exception => e
|
245
243
|
print_rest_exception(e, options)
|
246
244
|
exit 1
|
@@ -306,8 +304,7 @@ class Morpheus::Cli::LibraryOptionListsCommand
|
|
306
304
|
return
|
307
305
|
end
|
308
306
|
print_green_success "Updated Option List #{list_payload['name']}"
|
309
|
-
|
310
|
-
get([option_type_list['id']])
|
307
|
+
get([option_type_list['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
311
308
|
rescue RestClient::Exception => e
|
312
309
|
print_rest_exception(e, options)
|
313
310
|
exit 1
|
@@ -162,17 +162,27 @@ class Morpheus::Cli::LibraryOptionTypesCommand
|
|
162
162
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
163
163
|
opts.banner = subcommand_usage("[options]")
|
164
164
|
build_option_type_options(opts, options, new_option_type_option_types)
|
165
|
-
build_common_options(opts, options, [:options, :json, :dry_run, :remote])
|
165
|
+
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :remote])
|
166
166
|
end
|
167
167
|
optparse.parse!(args)
|
168
168
|
connect(options)
|
169
169
|
begin
|
170
|
-
|
171
|
-
if
|
172
|
-
|
170
|
+
payload = nil
|
171
|
+
if options[:payload]
|
172
|
+
payload = options[:payload]
|
173
|
+
# support -O OPTION switch on top of --payload
|
174
|
+
if options[:options]
|
175
|
+
payload['optionType'] ||= {}
|
176
|
+
payload['optionType'].deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) })
|
177
|
+
end
|
178
|
+
else
|
179
|
+
params = Morpheus::Cli::OptionTypes.prompt(new_option_type_option_types, options[:options], @api_client, options[:params])
|
180
|
+
if params.key?('required')
|
181
|
+
params['required'] = ['on','true'].include?(params['required'].to_s)
|
182
|
+
end
|
183
|
+
option_type_payload = params
|
184
|
+
payload = {optionType: option_type_payload}
|
173
185
|
end
|
174
|
-
option_type_payload = params
|
175
|
-
payload = {optionType: option_type_payload}
|
176
186
|
@option_types_interface.setopts(options)
|
177
187
|
if options[:dry_run]
|
178
188
|
print_dry_run @option_types_interface.dry.create(payload)
|
@@ -186,7 +196,7 @@ class Morpheus::Cli::LibraryOptionTypesCommand
|
|
186
196
|
option_type = json_response['optionType']
|
187
197
|
print_green_success "Added Option Type #{option_type['name']}"
|
188
198
|
#list([])
|
189
|
-
get([option_type['id']])
|
199
|
+
get([option_type['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
190
200
|
rescue RestClient::Exception => e
|
191
201
|
print_rest_exception(e, options)
|
192
202
|
exit 1
|
@@ -200,7 +210,7 @@ class Morpheus::Cli::LibraryOptionTypesCommand
|
|
200
210
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
201
211
|
opts.banner = subcommand_usage("[name] [options]")
|
202
212
|
build_option_type_options(opts, options, update_option_type_option_types)
|
203
|
-
build_common_options(opts, options, [:options, :json, :dry_run, :remote])
|
213
|
+
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :remote])
|
204
214
|
end
|
205
215
|
optparse.parse!(args)
|
206
216
|
connect(options)
|
@@ -208,18 +218,27 @@ class Morpheus::Cli::LibraryOptionTypesCommand
|
|
208
218
|
option_type = find_option_type_by_name_or_id(args[0])
|
209
219
|
exit 1 if option_type.nil?
|
210
220
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
params
|
221
|
+
if options[:payload]
|
222
|
+
payload = options[:payload]
|
223
|
+
# support -O OPTION switch on top of --payload
|
224
|
+
if options[:options]
|
225
|
+
payload['optionType'] ||= {}
|
226
|
+
payload['optionType'].deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) })
|
227
|
+
end
|
228
|
+
else
|
229
|
+
#params = options[:options] || {}
|
230
|
+
params = Morpheus::Cli::OptionTypes.no_prompt(update_option_type_option_types, options[:options], @api_client, options[:params])
|
231
|
+
if params.empty?
|
232
|
+
print_red_alert "Specify at least one option to update"
|
233
|
+
puts optparse
|
234
|
+
exit 1
|
235
|
+
end
|
236
|
+
if params.key?('required')
|
237
|
+
params['required'] = ['on','true'].include?(params['required'].to_s)
|
238
|
+
end
|
239
|
+
option_type_payload = params
|
240
|
+
payload = {optionType: option_type_payload}
|
220
241
|
end
|
221
|
-
option_type_payload = params
|
222
|
-
payload = {optionType: option_type_payload}
|
223
242
|
@option_types_interface.setopts(options)
|
224
243
|
if options[:dry_run]
|
225
244
|
print_dry_run @option_types_interface.dry.update(option_type['id'], payload)
|
@@ -232,7 +251,7 @@ class Morpheus::Cli::LibraryOptionTypesCommand
|
|
232
251
|
end
|
233
252
|
print_green_success "Updated Option Type #{option_type_payload['name']}"
|
234
253
|
#list([])
|
235
|
-
get([option_type['id']])
|
254
|
+
get([option_type['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
236
255
|
rescue RestClient::Exception => e
|
237
256
|
print_rest_exception(e, options)
|
238
257
|
exit 1
|
data/lib/morpheus/cli/version.rb
CHANGED
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.0.0
|
4
|
+
version: 4.0.0.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: 2019-
|
14
|
+
date: 2019-09-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|