morpheus-cli 6.2.1 → 6.2.2

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: 3ede124df9259964d52e159be3a4097dd21987e35a20423ef81c63efb65be54d
4
- data.tar.gz: 270fb5f083ecb5b7643aef13bb2b37e5e3ee02fd706ded8c394635376bbda14b
3
+ metadata.gz: 5a11e083645c99cce105a6ee0a38ba60904debd213c3223f07e84a335a755b6a
4
+ data.tar.gz: 318bbfa3ecfa0b2533e29de1a8b773389cac8c7e36c4b75b71316bc1b860aef8
5
5
  SHA512:
6
- metadata.gz: 86475908b6b602bcb9185e1e4a3c554f7fdb581e010e6e7e49e075124eb24d087bde16d90cb07b8dd8cb944da9d1f7de34f9d3d4252c9859811c4e9acd51eb7c
7
- data.tar.gz: e1c6ed1cb7a06ec481687e516582131348a3f4292c618ebbe1a81c3b422e17d49f8ca85e65283d027e1516dd28c2ac35820691b90435a3933474c0ac44308c74
6
+ metadata.gz: 79c6bd2a41bbd7c5fc79dfecd769db385626eea40bcf1ca19d6d4021f0cc57404c8eab74bfc831013f55b0668a1cbce86b909d11b71723a9bfc1587b29beb6c4
7
+ data.tar.gz: 21973cfd06571448876862f243895dc2334f19f5c20355cff9224d4d1c319911776a7d60c93196b1d79e5e16c65b66b1179476b89816931b181bad7e98bbd3dc
data/Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
1
  FROM ruby:2.7.5
2
2
 
3
- RUN gem install morpheus-cli -v 6.2.1
3
+ RUN gem install morpheus-cli -v 6.2.2
4
4
 
5
5
  ENTRYPOINT ["morpheus"]
@@ -46,22 +46,22 @@ class Morpheus::ServiceCatalogInterface < Morpheus::APIClient
46
46
  end
47
47
 
48
48
  # update cart (set cart name)
49
- def update_cart(payload, params={})
49
+ def update_cart(params, payload)
50
50
  execute(method: :put, url: "#{base_path}/cart", params: params, payload: payload.to_json)
51
51
  end
52
52
 
53
53
  # validate a new item, can be used before before adding it
54
- def validate_cart_item(payload, params={})
54
+ def validate_cart_item(params, payload)
55
55
  execute(method: :post, url: "#{base_path}/cart/items/validate", params: params, payload: payload.to_json)
56
56
  end
57
57
 
58
58
  # add item to cart
59
- def create_cart_item(payload, params={})
59
+ def create_cart_item(params, payload)
60
60
  execute(method: :post, url: "#{base_path}/cart/items", params: params, payload: payload.to_json)
61
61
  end
62
62
 
63
63
  # update item in the cart
64
- def update_cart_item(id, payload, params={})
64
+ def update_cart_item(id, params, payload)
65
65
  validate_id!(id)
66
66
  execute(method: :put, url: "#{base_path}/cart/items/#{id}", params: params, payload: payload.to_json)
67
67
  end
@@ -73,7 +73,7 @@ class Morpheus::ServiceCatalogInterface < Morpheus::APIClient
73
73
  end
74
74
 
75
75
  # place order with cart
76
- def checkout(payload, params={})
76
+ def checkout(params, payload)
77
77
  execute(method: :post, url: "#{base_path}/checkout", params: params, payload: payload.to_json)
78
78
  end
79
79
 
@@ -83,7 +83,7 @@ class Morpheus::ServiceCatalogInterface < Morpheus::APIClient
83
83
  end
84
84
 
85
85
  # create an order from scratch, without using a cart
86
- def create_order(payload, params={})
86
+ def create_order(params, payload)
87
87
  execute(method: :post, url: "#{base_path}/orders", params: params, payload: payload.to_json)
88
88
  end
89
89
  end
@@ -93,7 +93,7 @@ class Morpheus::Cli::CatalogItemTypesCommand
93
93
  options = {}
94
94
  optparse = Morpheus::Cli::OptionParser.new do |opts|
95
95
  opts.banner = subcommand_usage("[type]")
96
- opts.on( '-c', '--config', "Display raw config only. Default is YAML. Combine with -j for JSON instead." ) do
96
+ opts.on( '-c', '--config', "Display raw config only." ) do
97
97
  options[:show_config] = true
98
98
  end
99
99
  # opts.on('--no-config', "Do not display Config YAML." ) do
@@ -136,13 +136,17 @@ EOT
136
136
  json_response = @catalog_item_types_interface.get(id, params)
137
137
  end
138
138
  catalog_item_type = json_response[catalog_item_type_object_key]
139
- config = catalog_item_type['config'] || {}
140
139
  # export just the config as json or yaml (default)
141
140
  if options[:show_config]
141
+ if catalog_item_type['instanceSpec']
142
+ puts catalog_item_type['instanceSpec']
143
+ # print reset
144
+ return 0, nil
145
+ end
142
146
  unless options[:json] || options[:yaml] || options[:csv]
143
- options[:yaml] = true
147
+ options[:json] = true
144
148
  end
145
- return render_with_format(config, options)
149
+ return render_with_format(catalog_item_type['config'] || {}, options)
146
150
  end
147
151
  render_response(json_response, options, catalog_item_type_object_key) do
148
152
  print_h1 "Catalog Item Type Details", [], options
@@ -172,11 +176,11 @@ EOT
172
176
  item_type_code = catalog_item_type['type'].to_s.downcase
173
177
  if options[:no_config] != true
174
178
  if item_type_code == 'instance'
175
- print_h2 "Config YAML"
176
- if config
179
+ print_h2 "Config JSON"
180
+
177
181
  #print reset,(JSON.pretty_generate(config) rescue config),"\n",reset
178
182
  #print reset,(as_yaml(config, options) rescue config),"\n",reset
179
- config_string = as_yaml(config, options) rescue config
183
+ config_string = catalog_item_type['instanceSpec'] || (as_json(catalog_item_type['config'], options) rescue "")
180
184
  config_lines = config_string.split("\n")
181
185
  config_line_count = config_lines.size
182
186
  max_lines = 10
@@ -191,9 +195,7 @@ EOT
191
195
  config_string = config_string[4..-1]
192
196
  end
193
197
  print reset,config_string.chomp("\n"),"\n",reset
194
- else
195
- print reset,"(blank)","\n",reset
196
- end
198
+
197
199
  elsif item_type_code == 'blueprint' || item_type_code == 'apptemplate' || item_type_code == 'app'
198
200
  print_h2 "App Spec"
199
201
  if catalog_item_type['appSpec']
@@ -6,7 +6,7 @@ class Morpheus::Cli::PluginsCommand
6
6
 
7
7
  set_command_name :plugins
8
8
  set_command_description "View and manage plugins."
9
- register_subcommands :list, :get, :upload, :update, :remove, :'check-updates'
9
+ register_subcommands :list, :get, :upload, :update, :remove #, :'check-updates'
10
10
 
11
11
  # RestCommand settings
12
12
  register_interfaces :plugins
@@ -759,7 +759,7 @@ EOT
759
759
  end
760
760
  build_common_options(opts, options, [:quiet])
761
761
  opts.footer = <<-EOT
762
- Clone remote appliance configuratio, including any existing credentials.
762
+ Clone remote appliance configuration, including any existing credentials.
763
763
  [remote] is required. This is the name of an existing remote.
764
764
  [name] is optional. This is the name of the new remote that will be created.
765
765
  EOT
@@ -871,7 +871,7 @@ EOT
871
871
 
872
872
  @service_catalog_interface.setopts(options)
873
873
  if options[:dry_run]
874
- print_dry_run @service_catalog_interface.dry.checkout(payload)
874
+ print_dry_run @service_catalog_interface.dry.checkout(params, payload)
875
875
  return
876
876
  end
877
877
 
@@ -889,7 +889,7 @@ EOT
889
889
  unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to checkout and place an order?")
890
890
  return 9, "aborted command"
891
891
  end
892
- json_response = @service_catalog_interface.checkout(payload, params)
892
+ json_response = @service_catalog_interface.checkout(params, payload)
893
893
  render_response(json_response, options) do
894
894
  print_green_success "Order placed"
895
895
  # ok so this is delayed because list does not return all statuses right now..
@@ -34,7 +34,7 @@ View the remote appliance in a web browser.
34
34
  [id] is optional. This is the resource name or id to be append to the path to load details of a specific object.
35
35
  The [path] is matched against the #{prog_name} UI site map to find the best matching route.
36
36
  Route matching is skipped if the path begins with a "/" or --absolute is used.
37
- By default no authentication is not done and the existing web browser session used.
37
+ By default no authentication is done and the existing web browser session used.
38
38
  The --login option will authenticate via the CLI access token and create a new browser session.
39
39
 
40
40
  Examples:
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Morpheus
3
3
  module Cli
4
- VERSION = "6.2.1"
4
+ VERSION = "6.2.2"
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.2.1
4
+ version: 6.2.2
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-08-08 00:00:00.000000000 Z
14
+ date: 2023-09-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler