morpheus-cli 4.1.9 → 4.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morpheus/api/api_client.rb +5 -2
- data/lib/morpheus/api/apps_interface.rb +7 -0
- data/lib/morpheus/api/instances_interface.rb +7 -0
- data/lib/morpheus/api/library_cluster_layouts_interface.rb +53 -0
- data/lib/morpheus/api/library_resource_specs_interface.rb +49 -0
- data/lib/morpheus/cli.rb +2 -0
- data/lib/morpheus/cli/apps.rb +42 -1
- data/lib/morpheus/cli/cli_command.rb +18 -0
- data/lib/morpheus/cli/clusters.rb +4 -4
- data/lib/morpheus/cli/instances.rb +41 -2
- data/lib/morpheus/cli/library_cluster_layouts_command.rb +863 -0
- data/lib/morpheus/cli/library_resource_specs_command.rb +418 -0
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +29 -6
- data/lib/morpheus/cli/service_plans_command.rb +1 -19
- data/lib/morpheus/cli/version.rb +1 -1
- metadata +7 -5
- data/lib/morpheus/api/library_compute_type_layouts_interface.rb +0 -26
@@ -634,7 +634,7 @@ class Morpheus::Cli::ServicePlanCommand
|
|
634
634
|
params = {}
|
635
635
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
636
636
|
opts.banner = subcommand_usage( "[plan]")
|
637
|
-
build_common_options(opts, options, [:json, :dry_run, :remote])
|
637
|
+
build_common_options(opts, options, [:json, :dry_run, :remote, :auto_confirm])
|
638
638
|
opts.footer = "Deactivate service plan.\n" +
|
639
639
|
"[plan] is required. Service plan ID, name or code"
|
640
640
|
end
|
@@ -711,24 +711,6 @@ class Morpheus::Cli::ServicePlanCommand
|
|
711
711
|
end
|
712
712
|
end
|
713
713
|
|
714
|
-
def parse_bytes_param(bytes_param, option, assumed_unit = nil)
|
715
|
-
if bytes_param && bytes_param.to_f > 0
|
716
|
-
bytes_param.upcase!
|
717
|
-
multiplier = 1
|
718
|
-
unit = nil
|
719
|
-
number = (bytes_param.to_f == bytes_param.to_i ? bytes_param.to_i : bytes_param.to_f)
|
720
|
-
if (bytes_param.end_with? 'GB') || ((!bytes_param.end_with? 'MB') && assumed_unit == 'GB')
|
721
|
-
unit = 'GB'
|
722
|
-
multiplier = 1024 * 1024 * 1024
|
723
|
-
elsif (bytes_param.end_with? 'MB') || assumed_unit == 'MB'
|
724
|
-
unit = 'MB'
|
725
|
-
multiplier = 1024 * 1024
|
726
|
-
end
|
727
|
-
return {:bytes_param => bytes_param, :bytes => number * multiplier, :number => number, :multiplier => multiplier, :unit => unit}
|
728
|
-
end
|
729
|
-
raise_command_error "Invalid value for #{option} option"
|
730
|
-
end
|
731
|
-
|
732
714
|
def prompt_price_unit(options)
|
733
715
|
price_units = ['Minute', 'Hour', 'Day', 'Month', 'Year', '2 Year', '3 Year', '4 Year', '5 Year'].collect {|it| {'name' => it, 'value' => it.downcase.delete(' ')}}
|
734
716
|
Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'priceUnit', 'type' => 'select', 'fieldLabel' => 'Price Unit', 'selectOptions' => price_units, 'required' => true, 'defaultValue' => 'hour', 'description' => 'Select Price Unit.'}],options[:options],@api_client,{})['priceUnit']
|
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.1.
|
4
|
+
version: 4.1.10
|
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: 2020-01-
|
14
|
+
date: 2020-01-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -212,13 +212,14 @@ files:
|
|
212
212
|
- lib/morpheus/api/integrations_interface.rb
|
213
213
|
- lib/morpheus/api/jobs_interface.rb
|
214
214
|
- lib/morpheus/api/key_pairs_interface.rb
|
215
|
-
- lib/morpheus/api/
|
215
|
+
- lib/morpheus/api/library_cluster_layouts_interface.rb
|
216
216
|
- lib/morpheus/api/library_container_scripts_interface.rb
|
217
217
|
- lib/morpheus/api/library_container_templates_interface.rb
|
218
218
|
- lib/morpheus/api/library_container_types_interface.rb
|
219
219
|
- lib/morpheus/api/library_container_upgrades_interface.rb
|
220
220
|
- lib/morpheus/api/library_instance_types_interface.rb
|
221
221
|
- lib/morpheus/api/library_layouts_interface.rb
|
222
|
+
- lib/morpheus/api/library_resource_specs_interface.rb
|
222
223
|
- lib/morpheus/api/license_interface.rb
|
223
224
|
- lib/morpheus/api/load_balancers_interface.rb
|
224
225
|
- lib/morpheus/api/log_settings_interface.rb
|
@@ -340,6 +341,7 @@ files:
|
|
340
341
|
- lib/morpheus/cli/jobs_command.rb
|
341
342
|
- lib/morpheus/cli/key_pairs.rb
|
342
343
|
- lib/morpheus/cli/library.rb
|
344
|
+
- lib/morpheus/cli/library_cluster_layouts_command.rb
|
343
345
|
- lib/morpheus/cli/library_container_scripts_command.rb
|
344
346
|
- lib/morpheus/cli/library_container_templates_command.rb
|
345
347
|
- lib/morpheus/cli/library_container_types_command.rb
|
@@ -347,6 +349,7 @@ files:
|
|
347
349
|
- lib/morpheus/cli/library_layouts_command.rb
|
348
350
|
- lib/morpheus/cli/library_option_lists_command.rb
|
349
351
|
- lib/morpheus/cli/library_option_types_command.rb
|
352
|
+
- lib/morpheus/cli/library_resource_specs_command.rb
|
350
353
|
- lib/morpheus/cli/library_upgrades_command.rb
|
351
354
|
- lib/morpheus/cli/license.rb
|
352
355
|
- lib/morpheus/cli/load_balancers.rb
|
@@ -435,8 +438,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
435
438
|
- !ruby/object:Gem::Version
|
436
439
|
version: '0'
|
437
440
|
requirements: []
|
438
|
-
|
439
|
-
rubygems_version: 2.7.6
|
441
|
+
rubygems_version: 3.0.6
|
440
442
|
signing_key:
|
441
443
|
specification_version: 4
|
442
444
|
summary: Provides CLI Interface to the Morpheus Public/Private Cloud Appliance
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'morpheus/api/api_client'
|
2
|
-
|
3
|
-
class Morpheus::LibraryComputeTypeLayoutsInterface < Morpheus::APIClient
|
4
|
-
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
5
|
-
@access_token = access_token
|
6
|
-
@refresh_token = refresh_token
|
7
|
-
@base_url = base_url
|
8
|
-
@expires_at = expires_at
|
9
|
-
end
|
10
|
-
|
11
|
-
def list(params={})
|
12
|
-
url = "#{@base_url}/api/library/compute-type-layouts"
|
13
|
-
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
14
|
-
opts = {method: :get, url: url, headers: headers}
|
15
|
-
execute(opts)
|
16
|
-
end
|
17
|
-
|
18
|
-
def get(id, params={})
|
19
|
-
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
20
|
-
url = "#{@base_url}/api/library/compute-type-layouts/#{id}"
|
21
|
-
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
22
|
-
opts = {method: :get, url: url, headers: headers}
|
23
|
-
execute(opts)
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|