morpheus-cli 5.4.4.2 → 5.5.0
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/Dockerfile +1 -1
- data/lib/morpheus/api/apps_interface.rb +18 -4
- data/lib/morpheus/api/instances_interface.rb +16 -2
- data/lib/morpheus/api/prices_interface.rb +6 -0
- data/lib/morpheus/cli/cli_command.rb +16 -3
- data/lib/morpheus/cli/commands/apps.rb +366 -47
- data/lib/morpheus/cli/commands/clouds.rb +51 -27
- data/lib/morpheus/cli/commands/clusters.rb +70 -10
- data/lib/morpheus/cli/commands/cypher_command.rb +22 -23
- data/lib/morpheus/cli/commands/dashboard_command.rb +1 -1
- data/lib/morpheus/cli/commands/execution_request_command.rb +9 -4
- data/lib/morpheus/cli/commands/file_copy_request_command.rb +2 -1
- data/lib/morpheus/cli/commands/instances.rb +307 -24
- data/lib/morpheus/cli/commands/library_layouts_command.rb +15 -0
- data/lib/morpheus/cli/commands/library_option_lists_command.rb +18 -8
- data/lib/morpheus/cli/commands/prices_command.rb +25 -11
- data/lib/morpheus/cli/commands/provisioning_licenses_command.rb +1 -1
- data/lib/morpheus/cli/commands/tasks.rb +45 -10
- data/lib/morpheus/cli/mixins/execution_request_helper.rb +50 -0
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +5 -4
- data/lib/morpheus/cli/option_types.rb +32 -1
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/formatters.rb +12 -0
- data/lib/morpheus/routes.rb +3 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca02ec5cffb310afe4458568f745332e8f81f1d03a525ad1a9d9d1a3ecd08313
|
4
|
+
data.tar.gz: 323d4e3627c67fbd676bb34eb0b6f62b0eecff6180285af93599aba21f0a9781
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc72cdba318abc74aef8dec7ab8602ad7ec7196101950dfc0b29b8fe8c4298c2de5b41265a386457c38fa0ac9e46082cb86d04d7cfbc75652a1824d5a036cec1
|
7
|
+
data.tar.gz: f546fe9ed24fcc380d8aa1f2fc6d05a1cfb7186dcee48e66c340c51951b69e3b04408db5400ddcb23c9c596ccb14867571f1e21b6ceeb3e253c720d0525c21b0
|
data/Dockerfile
CHANGED
@@ -57,20 +57,34 @@ class Morpheus::AppsInterface < Morpheus::APIClient
|
|
57
57
|
execute(opts)
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
61
|
-
url = "#{@base_url}/api/apps/#{app_id}/apply"
|
60
|
+
def prepare_apply(app_id, params={})
|
61
|
+
url = "#{@base_url}/api/apps/#{app_id}/prepare-apply"
|
62
|
+
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
63
|
+
opts = {method: :get, url: url, headers: headers}
|
64
|
+
execute(opts)
|
65
|
+
end
|
66
|
+
|
67
|
+
def validate_apply(app_id, params, payload)
|
68
|
+
url = "#{@base_url}/api/apps/#{app_id}/validate-apply"
|
62
69
|
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
63
70
|
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
64
71
|
execute(opts)
|
65
72
|
end
|
66
73
|
|
67
|
-
def
|
68
|
-
url = "#{@base_url}/api/apps/#{app_id}/
|
74
|
+
def apply(app_id, params, payload)
|
75
|
+
url = "#{@base_url}/api/apps/#{app_id}/apply"
|
69
76
|
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
70
77
|
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
71
78
|
execute(opts)
|
72
79
|
end
|
73
80
|
|
81
|
+
def state(id, params={})
|
82
|
+
url = "#{@base_url}/api/apps/#{id}/state"
|
83
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
84
|
+
opts = {method: :get, url: url, headers: headers}
|
85
|
+
execute(opts)
|
86
|
+
end
|
87
|
+
|
74
88
|
def add_instance(app_id, payload)
|
75
89
|
url = "#{@base_url}/api/apps/#{app_id}/add-instance"
|
76
90
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -379,6 +379,20 @@ class Morpheus::InstancesInterface < Morpheus::APIClient
|
|
379
379
|
execute(opts)
|
380
380
|
end
|
381
381
|
|
382
|
+
def prepare_apply(id, params={})
|
383
|
+
url = "#{@base_url}/api/instances/#{id}/prepare-apply"
|
384
|
+
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
385
|
+
opts = {method: :get, url: url, headers: headers}
|
386
|
+
execute(opts)
|
387
|
+
end
|
388
|
+
|
389
|
+
def validate_apply(id, params, payload)
|
390
|
+
url = "#{@base_url}/api/instances/#{id}/validate-apply"
|
391
|
+
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
392
|
+
opts = {method: :post, url: url, headers: headers, payload: payload.to_json}
|
393
|
+
execute(opts)
|
394
|
+
end
|
395
|
+
|
382
396
|
def apply(id, params, payload)
|
383
397
|
url = "#{@base_url}/api/instances/#{id}/apply"
|
384
398
|
headers = {:params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -386,8 +400,8 @@ class Morpheus::InstancesInterface < Morpheus::APIClient
|
|
386
400
|
execute(opts)
|
387
401
|
end
|
388
402
|
|
389
|
-
def
|
390
|
-
url = "#{@base_url}/api/instances/#{id}/state
|
403
|
+
def state(id, params={})
|
404
|
+
url = "#{@base_url}/api/instances/#{id}/state"
|
391
405
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
392
406
|
opts = {method: :get, url: url, headers: headers}
|
393
407
|
execute(opts)
|
@@ -62,4 +62,10 @@ class Morpheus::PricesInterface < Morpheus::APIClient
|
|
62
62
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
63
63
|
execute(method: :get, url: url, headers: headers)
|
64
64
|
end
|
65
|
+
|
66
|
+
def list_currencies(params={})
|
67
|
+
url = "#{base_path}/currencies"
|
68
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
69
|
+
execute(method: :get, url: url, headers: headers)
|
70
|
+
end
|
65
71
|
end
|
@@ -253,7 +253,7 @@ module Morpheus
|
|
253
253
|
|
254
254
|
# list is GET that supports phrase,max,offset,sort,direction
|
255
255
|
def build_standard_list_options(opts, options, includes=[], excludes=[])
|
256
|
-
build_standard_get_options(opts, options, [:list] + includes, excludes
|
256
|
+
build_standard_get_options(opts, options, [:list] + includes, excludes)
|
257
257
|
end
|
258
258
|
|
259
259
|
def build_standard_add_options(opts, options, includes=[], excludes=[])
|
@@ -1569,7 +1569,7 @@ module Morpheus
|
|
1569
1569
|
#Morpheus::Logging::DarkPrinter.puts "find_all(#{args.join(', ')})" if Morpheus::Logging.debug?
|
1570
1570
|
type, *request_args = args
|
1571
1571
|
type = type.to_s.singularize.underscore
|
1572
|
-
list_key = respond_to?("#{type}_list_key", true) ? send("#{type}_list_key") : type
|
1572
|
+
list_key = respond_to?("#{type}_list_key", true) ? send("#{type}_list_key") : get_list_key(type)
|
1573
1573
|
json_response = find_all_json(*args)
|
1574
1574
|
if !json_response.key?(list_key)
|
1575
1575
|
# maybe just use the first key like this:
|
@@ -1600,7 +1600,7 @@ module Morpheus
|
|
1600
1600
|
#Morpheus::Logging::DarkPrinter.puts "find_record(#{args.join(', ')})" if Morpheus::Logging.debug?
|
1601
1601
|
type, *request_args = args
|
1602
1602
|
type = type.to_s.singularize.underscore
|
1603
|
-
object_key = respond_to?("#{type}_object_key", true) ? send("#{type}_object_key") : type
|
1603
|
+
object_key = respond_to?("#{type}_object_key", true) ? send("#{type}_object_key") : get_object_key(type)
|
1604
1604
|
json_response = find_record_json(*args)
|
1605
1605
|
if !json_response.key?(object_key)
|
1606
1606
|
# maybe just use the first key like this:
|
@@ -1645,6 +1645,19 @@ module Morpheus
|
|
1645
1645
|
return interface
|
1646
1646
|
end
|
1647
1647
|
|
1648
|
+
def get_list_key(type)
|
1649
|
+
return get_object_key(type).pluralize
|
1650
|
+
end
|
1651
|
+
|
1652
|
+
def get_object_key(type)
|
1653
|
+
key = type.camelcase.singularize
|
1654
|
+
# add aliases here as needed
|
1655
|
+
if key == "cloud"
|
1656
|
+
key = "zone"
|
1657
|
+
end
|
1658
|
+
return key
|
1659
|
+
end
|
1660
|
+
|
1648
1661
|
module ClassMethods
|
1649
1662
|
|
1650
1663
|
def prog_name
|