morpheus-cli 4.2.21 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/lib/morpheus/api/api_client.rb +30 -0
- data/lib/morpheus/api/billing_interface.rb +34 -0
- data/lib/morpheus/api/catalog_item_types_interface.rb +9 -0
- data/lib/morpheus/api/deploy_interface.rb +1 -1
- data/lib/morpheus/api/deployments_interface.rb +20 -1
- data/lib/morpheus/api/forgot_password_interface.rb +17 -0
- data/lib/morpheus/api/instances_interface.rb +16 -2
- data/lib/morpheus/api/rest_interface.rb +0 -6
- data/lib/morpheus/api/roles_interface.rb +14 -0
- data/lib/morpheus/api/search_interface.rb +13 -0
- data/lib/morpheus/api/servers_interface.rb +14 -0
- data/lib/morpheus/api/service_catalog_interface.rb +89 -0
- data/lib/morpheus/api/usage_interface.rb +18 -0
- data/lib/morpheus/cli.rb +7 -3
- data/lib/morpheus/cli/apps.rb +6 -27
- data/lib/morpheus/cli/backup_jobs_command.rb +3 -0
- data/lib/morpheus/cli/backups_command.rb +3 -0
- data/lib/morpheus/cli/catalog_item_types_command.rb +622 -0
- data/lib/morpheus/cli/cli_command.rb +70 -21
- data/lib/morpheus/cli/commands/standard/curl_command.rb +26 -12
- data/lib/morpheus/cli/commands/standard/history_command.rb +3 -1
- data/lib/morpheus/cli/commands/standard/man_command.rb +74 -40
- data/lib/morpheus/cli/commands/standard/source_command.rb +1 -1
- data/lib/morpheus/cli/commands/standard/update_command.rb +76 -0
- data/lib/morpheus/cli/containers_command.rb +14 -24
- data/lib/morpheus/cli/cypher_command.rb +6 -2
- data/lib/morpheus/cli/deploy.rb +199 -90
- data/lib/morpheus/cli/deployments.rb +341 -28
- data/lib/morpheus/cli/deploys.rb +206 -41
- data/lib/morpheus/cli/error_handler.rb +7 -0
- data/lib/morpheus/cli/forgot_password.rb +133 -0
- data/lib/morpheus/cli/groups.rb +1 -1
- data/lib/morpheus/cli/health_command.rb +59 -2
- data/lib/morpheus/cli/hosts.rb +265 -34
- data/lib/morpheus/cli/instances.rb +186 -100
- data/lib/morpheus/cli/invoices_command.rb +33 -16
- data/lib/morpheus/cli/jobs_command.rb +28 -6
- data/lib/morpheus/cli/library_option_lists_command.rb +15 -7
- data/lib/morpheus/cli/library_option_types_command.rb +5 -2
- data/lib/morpheus/cli/logs_command.rb +9 -6
- data/lib/morpheus/cli/mixins/accounts_helper.rb +12 -7
- data/lib/morpheus/cli/mixins/backups_helper.rb +2 -4
- data/lib/morpheus/cli/mixins/deployments_helper.rb +31 -3
- data/lib/morpheus/cli/mixins/option_source_helper.rb +1 -1
- data/lib/morpheus/cli/mixins/print_helper.rb +46 -21
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +100 -4
- data/lib/morpheus/cli/network_pools_command.rb +14 -6
- data/lib/morpheus/cli/option_types.rb +271 -22
- data/lib/morpheus/cli/ping.rb +0 -1
- data/lib/morpheus/cli/remote.rb +35 -12
- data/lib/morpheus/cli/reports_command.rb +99 -30
- data/lib/morpheus/cli/roles.rb +453 -113
- data/lib/morpheus/cli/search_command.rb +182 -0
- data/lib/morpheus/cli/service_catalog_command.rb +1474 -0
- data/lib/morpheus/cli/service_plans_command.rb +2 -2
- data/lib/morpheus/cli/setup.rb +1 -1
- data/lib/morpheus/cli/shell.rb +33 -11
- data/lib/morpheus/cli/storage_providers_command.rb +40 -56
- data/lib/morpheus/cli/tasks.rb +29 -32
- data/lib/morpheus/cli/usage_command.rb +203 -0
- data/lib/morpheus/cli/user_settings_command.rb +1 -0
- data/lib/morpheus/cli/users.rb +12 -1
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/virtual_images.rb +429 -254
- data/lib/morpheus/cli/whoami.rb +6 -6
- data/lib/morpheus/cli/workflows.rb +34 -41
- data/lib/morpheus/formatters.rb +75 -7
- data/lib/morpheus/terminal.rb +6 -2
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f4b5a29dcfa1a915ab2d3fed9ad07197d2a760758b2bc3b76e72cf6899c4372
|
4
|
+
data.tar.gz: 59c981a5aede057b69e08f5c717d27c884bdd64aed84fb81361b35291b3aaf72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 678ff7f73923c9883968ee8bba29b8d75d5464a4899ca812477ce943b25f758c74f187a481c781500928206c4d540d5153f858ee4e2242cfb24cc2604be1602d
|
7
|
+
data.tar.gz: c27881081abb71b05eceb4857280f51a4f838e9a568658baa34385afe7fc2b86be61eb31a070a4e3a9381000337ceb9b11f58fe8572fff8066882225133742ba
|
data/Dockerfile
CHANGED
@@ -342,10 +342,18 @@ class Morpheus::APIClient
|
|
342
342
|
Morpheus::AuthInterface.new({url: @base_url, client_id: @client_id}).setopts(@options)
|
343
343
|
end
|
344
344
|
|
345
|
+
def forgot
|
346
|
+
Morpheus::ForgotPasswordInterface.new(common_interface_options).setopts(@options)
|
347
|
+
end
|
348
|
+
|
345
349
|
def whoami
|
346
350
|
Morpheus::WhoamiInterface.new(common_interface_options).setopts(@options)
|
347
351
|
end
|
348
352
|
|
353
|
+
def search
|
354
|
+
Morpheus::SearchInterface.new(common_interface_options).setopts(@options)
|
355
|
+
end
|
356
|
+
|
349
357
|
def user_settings
|
350
358
|
Morpheus::UserSettingsInterface.new(common_interface_options).setopts(@options)
|
351
359
|
end
|
@@ -764,6 +772,28 @@ class Morpheus::APIClient
|
|
764
772
|
Morpheus::BackupJobsInterface.new(common_interface_options).setopts(@options)
|
765
773
|
end
|
766
774
|
|
775
|
+
def catalog_item_types
|
776
|
+
Morpheus::CatalogItemTypesInterface.new(common_interface_options).setopts(@options)
|
777
|
+
end
|
778
|
+
|
779
|
+
def catalog
|
780
|
+
Morpheus::ServiceCatalogInterface.new(common_interface_options).setopts(@options)
|
781
|
+
end
|
782
|
+
|
783
|
+
def usage
|
784
|
+
Morpheus::UsageInterface.new(common_interface_options).setopts(@options)
|
785
|
+
end
|
786
|
+
|
787
|
+
def billing
|
788
|
+
Morpheus::BillingInterface.new(common_interface_options).setopts(@options)
|
789
|
+
end
|
790
|
+
|
767
791
|
# add new interfaces here
|
768
792
|
|
793
|
+
protected
|
794
|
+
|
795
|
+
def validate_id!(id)
|
796
|
+
raise "#{self.class} passed a blank id!" if id.to_s.strip.empty?
|
797
|
+
end
|
798
|
+
|
769
799
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::BillingInterface < Morpheus::APIClient
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/billing"
|
7
|
+
end
|
8
|
+
|
9
|
+
# this is an alias for /usage
|
10
|
+
def list(params={})
|
11
|
+
execute(method: :get, url: "#{base_path}", params: params)
|
12
|
+
end
|
13
|
+
|
14
|
+
def list_account(params={})
|
15
|
+
execute(method: :get, url: "#{base_path}/account", params: params)
|
16
|
+
end
|
17
|
+
|
18
|
+
def list_zones(params={})
|
19
|
+
execute(method: :get, url: "#{base_path}/zones", params: params)
|
20
|
+
end
|
21
|
+
|
22
|
+
def list_instances(params={})
|
23
|
+
execute(method: :get, url: "#{base_path}/instances", params: params)
|
24
|
+
end
|
25
|
+
|
26
|
+
def list_servers(params={})
|
27
|
+
execute(method: :get, url: "#{base_path}/servers", params: params)
|
28
|
+
end
|
29
|
+
|
30
|
+
def list_discovered_servers(params={})
|
31
|
+
execute(method: :get, url: "#{base_path}/discoveredServers", params: params)
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -18,7 +18,7 @@ class Morpheus::DeployInterface < Morpheus::APIClient
|
|
18
18
|
execute(method: :get, url: "#{base_path}", params: params)
|
19
19
|
end
|
20
20
|
|
21
|
-
def get(
|
21
|
+
def get(id, params={})
|
22
22
|
validate_id!(id)
|
23
23
|
execute(method: :get, url: "#{base_path}/#{id}", params: params)
|
24
24
|
end
|
@@ -40,7 +40,8 @@ class Morpheus::DeploymentsInterface < Morpheus::RestInterface
|
|
40
40
|
if destination.empty? || destination == "/" || destination == "." || destination.include?("../")
|
41
41
|
raise "#{self.class}.upload_file() passed a bad destination: '#{destination}'"
|
42
42
|
end
|
43
|
-
url = "#{@base_url}/#{base_path}/#{deployment_id}/versions/#{id}/files"
|
43
|
+
# url = "#{@base_url}/#{base_path}/#{deployment_id}/versions/#{id}/files"
|
44
|
+
url = "#{base_path}/#{deployment_id}/versions/#{id}/files"
|
44
45
|
if !destination.to_s.empty?
|
45
46
|
url += "/#{destination}"
|
46
47
|
end
|
@@ -57,4 +58,22 @@ class Morpheus::DeploymentsInterface < Morpheus::RestInterface
|
|
57
58
|
execute(method: :post, url: url, headers: headers, payload: payload, params: params, timeout: 172800)
|
58
59
|
end
|
59
60
|
|
61
|
+
# upload a file without multipart
|
62
|
+
# local_file is the full absolute local filename
|
63
|
+
# destination should be the full remote file path, including the file name.
|
64
|
+
def destroy_file(deployment_id, id, destination, params={})
|
65
|
+
if destination.empty? || destination == "/" || destination == "." || destination.include?("../")
|
66
|
+
raise "#{self.class}.upload_file() passed a bad destination: '#{destination}'"
|
67
|
+
end
|
68
|
+
# url = "#{@base_url}/#{base_path}/#{deployment_id}/versions/#{id}/files"
|
69
|
+
url = "#{base_path}/#{deployment_id}/versions/#{id}/files"
|
70
|
+
if !destination.to_s.empty?
|
71
|
+
url += "/#{destination}"
|
72
|
+
end
|
73
|
+
# use URI to escape path
|
74
|
+
uri = URI.parse(url)
|
75
|
+
url = uri.path
|
76
|
+
execute(method: :delete, url: url, params: params)
|
77
|
+
end
|
78
|
+
|
60
79
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
# There is no Authorization required for this API.
|
3
|
+
class Morpheus::ForgotPasswordInterface < Morpheus::APIClient
|
4
|
+
|
5
|
+
def authorization_required?
|
6
|
+
false
|
7
|
+
end
|
8
|
+
|
9
|
+
def send_email(payload, params={})
|
10
|
+
execute(method: :post, url: "/api/forgot/send-email", params: params, payload: payload.to_json)
|
11
|
+
end
|
12
|
+
|
13
|
+
def reset_password(payload, params={})
|
14
|
+
execute(method: :post, url: "/api/forgot/reset-password", params: params, payload: payload.to_json)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -169,10 +169,10 @@ class Morpheus::InstancesInterface < Morpheus::APIClient
|
|
169
169
|
execute(opts)
|
170
170
|
end
|
171
171
|
|
172
|
-
def backup(id,
|
172
|
+
def backup(id, payload={})
|
173
173
|
url = "#{@base_url}/api/instances/#{id}/backup"
|
174
174
|
headers = {:authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
175
|
-
opts = {method: :put, url: url, headers: headers}
|
175
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
176
176
|
execute(opts)
|
177
177
|
end
|
178
178
|
|
@@ -218,6 +218,20 @@ class Morpheus::InstancesInterface < Morpheus::APIClient
|
|
218
218
|
execute(opts)
|
219
219
|
end
|
220
220
|
|
221
|
+
def snapshot(id, payload={})
|
222
|
+
url = "#{@base_url}/api/instances/#{id}/snapshot"
|
223
|
+
headers = {:authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
224
|
+
opts = {method: :put, url: url, headers: headers, payload: payload.to_json}
|
225
|
+
execute(opts)
|
226
|
+
end
|
227
|
+
|
228
|
+
def snapshots(instance_id, params={})
|
229
|
+
url = "#{@base_url}/api/instances/#{instance_id}/snapshots"
|
230
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
231
|
+
opts = {method: :get, url: url, headers: headers}
|
232
|
+
execute(opts)
|
233
|
+
end
|
234
|
+
|
221
235
|
def import_snapshot(id, params={}, payload={})
|
222
236
|
url = "#{@base_url}/api/instances/#{id}/import-snapshot"
|
223
237
|
headers = {:authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -31,10 +31,4 @@ class Morpheus::RestInterface < Morpheus::APIClient
|
|
31
31
|
execute(method: :delete, url: "#{base_path}/#{id}", params: params)
|
32
32
|
end
|
33
33
|
|
34
|
-
protected
|
35
|
-
|
36
|
-
def validate_id!(id)
|
37
|
-
raise "#{self.class} passed a blank id!" if id.to_s.strip.empty?
|
38
|
-
end
|
39
|
-
|
40
34
|
end
|
@@ -77,6 +77,20 @@ class Morpheus::RolesInterface < Morpheus::APIClient
|
|
77
77
|
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
78
78
|
end
|
79
79
|
|
80
|
+
def update_catalog_item_type(account_id, id, options)
|
81
|
+
url = build_url(account_id, id) + "/update-catalog-item-type"
|
82
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
83
|
+
payload = options
|
84
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
85
|
+
end
|
86
|
+
|
87
|
+
def update_persona(account_id, id, options)
|
88
|
+
url = build_url(account_id, id) + "/update-persona"
|
89
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
90
|
+
payload = options
|
91
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
92
|
+
end
|
93
|
+
|
80
94
|
private
|
81
95
|
|
82
96
|
def build_url(account_id=nil, role_id=nil)
|
@@ -169,4 +169,18 @@ class Morpheus::ServersInterface < Morpheus::APIClient
|
|
169
169
|
execute(opts)
|
170
170
|
end
|
171
171
|
|
172
|
+
def snapshots(id, params={})
|
173
|
+
url = "#{@base_url}/api/servers/#{id}/snapshots"
|
174
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
175
|
+
opts = {method: :get, url: url, headers: headers}
|
176
|
+
execute(opts)
|
177
|
+
end
|
178
|
+
|
179
|
+
def software(id, params={})
|
180
|
+
url = "#{@base_url}/api/servers/#{id}/software"
|
181
|
+
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
182
|
+
opts = {method: :get, url: url, headers: headers}
|
183
|
+
execute(opts)
|
184
|
+
end
|
185
|
+
|
172
186
|
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
# Service Catalog Persona interface
|
3
|
+
class Morpheus::ServiceCatalogInterface < Morpheus::APIClient
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
# "/api/service-catalog"
|
7
|
+
"/api/catalog"
|
8
|
+
end
|
9
|
+
|
10
|
+
# dashboard
|
11
|
+
def dashboard(params={})
|
12
|
+
execute(method: :get, url: "#{base_path}/dashboard", params: params)
|
13
|
+
end
|
14
|
+
|
15
|
+
# list catalog types available for ordering
|
16
|
+
def list_types(params={})
|
17
|
+
execute(method: :get, url: "#{base_path}/types", params: params)
|
18
|
+
end
|
19
|
+
|
20
|
+
# get specific catalog type
|
21
|
+
def get_type(id, params={})
|
22
|
+
validate_id!(id)
|
23
|
+
execute(method: :get, url: "#{base_path}/types/#{id}", params: params)
|
24
|
+
end
|
25
|
+
|
26
|
+
# list catalog inventory (items)
|
27
|
+
def list_inventory(params={})
|
28
|
+
execute(method: :get, url: "#{base_path}/items", params: params)
|
29
|
+
end
|
30
|
+
|
31
|
+
# get catalog inventory item
|
32
|
+
def get_inventory(id, params={})
|
33
|
+
validate_id!(id)
|
34
|
+
execute(method: :get, url: "#{base_path}/items/#{id}", params: params)
|
35
|
+
end
|
36
|
+
|
37
|
+
# delete a catalog inventory item
|
38
|
+
def destroy_inventory(id, params = {})
|
39
|
+
validate_id!(id)
|
40
|
+
execute(method: :delete, url: "#{base_path}/items/#{id}", params: params)
|
41
|
+
end
|
42
|
+
|
43
|
+
# get cart (one per user)
|
44
|
+
def get_cart(params={})
|
45
|
+
execute(method: :get, url: "#{base_path}/cart", params: params)
|
46
|
+
end
|
47
|
+
|
48
|
+
# update cart (set cart name)
|
49
|
+
def update_cart(payload, params={})
|
50
|
+
execute(method: :put, url: "#{base_path}/cart", params: params, payload: payload.to_json)
|
51
|
+
end
|
52
|
+
|
53
|
+
# validate a new item, can be used before before adding it
|
54
|
+
def validate_cart_item(payload, params={})
|
55
|
+
execute(method: :post, url: "#{base_path}/cart/items/validate", params: params, payload: payload.to_json)
|
56
|
+
end
|
57
|
+
|
58
|
+
# add item to cart
|
59
|
+
def create_cart_item(payload, params={})
|
60
|
+
execute(method: :post, url: "#{base_path}/cart/items", params: params, payload: payload.to_json)
|
61
|
+
end
|
62
|
+
|
63
|
+
# update item in the cart
|
64
|
+
def update_cart_item(id, payload, params={})
|
65
|
+
validate_id!(id)
|
66
|
+
execute(method: :put, url: "#{base_path}/cart/items/#{id}", params: params, payload: payload.to_json)
|
67
|
+
end
|
68
|
+
|
69
|
+
# remove item from the cart
|
70
|
+
def destroy_cart_item(id, params={})
|
71
|
+
validate_id!(id)
|
72
|
+
execute(method: :delete, url: "#{base_path}/cart/items/#{id}", params: params)
|
73
|
+
end
|
74
|
+
|
75
|
+
# place order with cart
|
76
|
+
def checkout(payload, params={})
|
77
|
+
execute(method: :post, url: "#{base_path}/checkout", params: params, payload: payload.to_json)
|
78
|
+
end
|
79
|
+
|
80
|
+
# remove all items from cart and reset name
|
81
|
+
def clear_cart(params={})
|
82
|
+
execute(method: :delete, url: "#{base_path}/cart", params: params)
|
83
|
+
end
|
84
|
+
|
85
|
+
# create an order from scratch, without using a cart
|
86
|
+
def create_order(payload, params={})
|
87
|
+
execute(method: :post, url: "#{base_path}/orders", params: params, payload: payload.to_json)
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'morpheus/api/api_client'
|
2
|
+
|
3
|
+
class Morpheus::UsageInterface < Morpheus::APIClient
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/usage" # not /usages ?
|
7
|
+
end
|
8
|
+
|
9
|
+
def list(params={})
|
10
|
+
execute(method: :get, url: "#{base_path}", params: params)
|
11
|
+
end
|
12
|
+
|
13
|
+
def get(id, params={})
|
14
|
+
validate_id!(id)
|
15
|
+
execute(method: :get, url: "#{base_path}/#{id}", params: params)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/lib/morpheus/cli.rb
CHANGED
@@ -67,8 +67,6 @@ module Morpheus
|
|
67
67
|
# all standard commands
|
68
68
|
Dir[File.dirname(__FILE__) + "/cli/commands/standard/**/*.rb"].each {|file| load file }
|
69
69
|
|
70
|
-
# shell scripting commands
|
71
|
-
|
72
70
|
# all the known commands
|
73
71
|
load 'morpheus/cli/remote.rb'
|
74
72
|
load 'morpheus/cli/doc.rb'
|
@@ -76,9 +74,11 @@ module Morpheus
|
|
76
74
|
load 'morpheus/cli/setup.rb'
|
77
75
|
load 'morpheus/cli/login.rb'
|
78
76
|
load 'morpheus/cli/logout.rb'
|
77
|
+
load 'morpheus/cli/forgot_password.rb'
|
79
78
|
load 'morpheus/cli/whoami.rb'
|
80
79
|
load 'morpheus/cli/access_token_command.rb'
|
81
80
|
load 'morpheus/cli/user_settings_command.rb'
|
81
|
+
load 'morpheus/cli/search_command.rb'
|
82
82
|
load 'morpheus/cli/dashboard_command.rb'
|
83
83
|
load 'morpheus/cli/recent_activity_command.rb' # deprecated, removing soon
|
84
84
|
load 'morpheus/cli/activity_command.rb'
|
@@ -96,11 +96,12 @@ module Morpheus
|
|
96
96
|
load 'morpheus/cli/tasks.rb'
|
97
97
|
load 'morpheus/cli/workflows.rb'
|
98
98
|
load 'morpheus/cli/deployments.rb'
|
99
|
+
load 'morpheus/cli/deploy.rb'
|
100
|
+
load 'morpheus/cli/deploys.rb'
|
99
101
|
load 'morpheus/cli/instances.rb'
|
100
102
|
load 'morpheus/cli/containers_command.rb'
|
101
103
|
load 'morpheus/cli/apps.rb'
|
102
104
|
load 'morpheus/cli/blueprints_command.rb'
|
103
|
-
load 'morpheus/cli/deploys.rb'
|
104
105
|
load 'morpheus/cli/license.rb'
|
105
106
|
load 'morpheus/cli/instance_types.rb'
|
106
107
|
load 'morpheus/cli/jobs_command.rb'
|
@@ -174,6 +175,9 @@ module Morpheus
|
|
174
175
|
load 'morpheus/cli/projects_command.rb'
|
175
176
|
load 'morpheus/cli/backups_command.rb'
|
176
177
|
load 'morpheus/cli/backup_jobs_command.rb'
|
178
|
+
load 'morpheus/cli/catalog_item_types_command.rb' # catalog-types
|
179
|
+
load 'morpheus/cli/service_catalog_command.rb' # catalog
|
180
|
+
load 'morpheus/cli/usage_command.rb'
|
177
181
|
# add new commands here...
|
178
182
|
|
179
183
|
end
|
data/lib/morpheus/cli/apps.rb
CHANGED
@@ -72,9 +72,6 @@ class Morpheus::Cli::Apps
|
|
72
72
|
options[:owner] = val
|
73
73
|
end
|
74
74
|
opts.add_hidden_option('--created-by')
|
75
|
-
opts.on('--details', "Display more details: memory and storage usage used / max values." ) do
|
76
|
-
options[:details] = true
|
77
|
-
end
|
78
75
|
opts.on('--pending-removal', "Include apps pending removal.") do
|
79
76
|
options[:showDeleted] = true
|
80
77
|
end
|
@@ -88,14 +85,16 @@ class Morpheus::Cli::Apps
|
|
88
85
|
opts.on('--status STATUS', "Filter by status.") do |val|
|
89
86
|
params['status'] = (params['status'] || []) + val.to_s.split(',').collect {|s| s.strip }.select {|s| s != "" }
|
90
87
|
end
|
88
|
+
opts.on('-a', '--details', "Display all details: memory and storage usage used / max values." ) do
|
89
|
+
options[:details] = true
|
90
|
+
end
|
91
91
|
build_common_options(opts, options, [:list, :query, :json, :yaml, :csv, :fields, :dry_run, :remote])
|
92
92
|
opts.footer = "List apps."
|
93
93
|
end
|
94
94
|
optparse.parse!(args)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
return 1
|
95
|
+
# verify_args!(args:args, optparse:optparse, count:0)
|
96
|
+
if args.count > 0
|
97
|
+
options[:phrase] = args.join(" ")
|
99
98
|
end
|
100
99
|
connect(options)
|
101
100
|
begin
|
@@ -2186,26 +2185,6 @@ EOT
|
|
2186
2185
|
print reset
|
2187
2186
|
end
|
2188
2187
|
|
2189
|
-
def format_app_status(app, return_color=cyan)
|
2190
|
-
out = ""
|
2191
|
-
status_string = app['status'] || app['appStatus'] || ''
|
2192
|
-
if status_string == 'running'
|
2193
|
-
out = "#{green}#{status_string.upcase}#{return_color}"
|
2194
|
-
elsif status_string == 'provisioning'
|
2195
|
-
out = "#{cyan}#{status_string.upcase}#{cyan}"
|
2196
|
-
elsif status_string == 'stopped' or status_string == 'failed'
|
2197
|
-
out = "#{red}#{status_string.upcase}#{return_color}"
|
2198
|
-
elsif status_string == 'unknown'
|
2199
|
-
out = "#{yellow}#{status_string.upcase}#{return_color}"
|
2200
|
-
elsif status_string == 'warning' && app['instanceCount'].to_i == 0
|
2201
|
-
# show this instead of WARNING
|
2202
|
-
out = "#{cyan}EMPTY#{return_color}"
|
2203
|
-
else
|
2204
|
-
out = "#{yellow}#{status_string.upcase}#{return_color}"
|
2205
|
-
end
|
2206
|
-
out
|
2207
|
-
end
|
2208
|
-
|
2209
2188
|
def format_app_tiers(app)
|
2210
2189
|
out = ""
|
2211
2190
|
begin
|