morpheus-cli 0.9.10 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/morpheus +48 -33
- data/lib/morpheus/api/api_client.rb +12 -0
- data/lib/morpheus/api/custom_instance_types.rb +55 -0
- data/lib/morpheus/api/custom_instance_types_interface.rb +133 -0
- data/lib/morpheus/api/dashboard_interface.rb +37 -0
- data/lib/morpheus/api/users_interface.rb +17 -0
- data/lib/morpheus/api/whoami_interface.rb +20 -0
- data/lib/morpheus/cli.rb +13 -1
- data/lib/morpheus/cli/app_templates.rb +1 -1
- data/lib/morpheus/cli/cli_command.rb +22 -1
- data/lib/morpheus/cli/cli_registry.rb +1 -1
- data/lib/morpheus/cli/credentials.rb +33 -11
- data/lib/morpheus/cli/dashboard_command.rb +74 -0
- data/lib/morpheus/cli/instance_types.rb +4 -2
- data/lib/morpheus/cli/key_pairs.rb +1 -1
- data/lib/morpheus/cli/library.rb +539 -0
- data/lib/morpheus/cli/login.rb +57 -0
- data/lib/morpheus/cli/logout.rb +61 -0
- data/lib/morpheus/cli/mixins/accounts_helper.rb +52 -10
- data/lib/morpheus/cli/mixins/print_helper.rb +23 -16
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +1 -1
- data/lib/morpheus/cli/mixins/whoami_helper.rb +34 -0
- data/lib/morpheus/cli/option_types.rb +15 -1
- data/lib/morpheus/cli/recent_activity_command.rb +83 -0
- data/lib/morpheus/cli/remote.rb +71 -28
- data/lib/morpheus/cli/roles.rb +89 -24
- data/lib/morpheus/cli/shell.rb +24 -11
- data/lib/morpheus/cli/users.rb +166 -24
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/version_command.rb +45 -0
- data/lib/morpheus/cli/whoami.rb +139 -0
- data/lib/morpheus/logging.rb +78 -0
- metadata +15 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 812e393024472b2ee42ef0136aa373a8de3d85e3
|
4
|
+
data.tar.gz: 8d2947e92d627e420f6e18c1349b92294d5f9999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4744303a2f1d76a3ed90c8ecf084729ed06ea0ee7b10360fd488bd27f903a1309f124008202378cffa27093bda79562123000a5ed63cede7dafae87c563240f1
|
7
|
+
data.tar.gz: fcaa57787c5421fb1a12edac4c60907765b718b1f3516e8944c44bc91cf3f9e30bd0d8f1d1bc3ce91a29fa46116513b641ed516592e5eb5ee632adab4d17cb66
|
data/bin/morpheus
CHANGED
@@ -1,44 +1,59 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
require 'optparse'
|
2
3
|
require 'morpheus/cli'
|
3
4
|
require 'morpheus/rest_client'
|
4
5
|
require 'morpheus/cli/cli_registry'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
# short circuit version switch
|
8
|
+
if ARGV[0] == '-v' && ARGV.size == 1
|
9
|
+
version = Morpheus::Cli::VERSION
|
10
|
+
puts version
|
11
|
+
exit 0
|
11
12
|
end
|
12
13
|
|
13
|
-
|
14
|
+
# handle global options
|
15
|
+
args = ARGV
|
16
|
+
# set global log level to debug (print stack trace for bubbled exceptions)
|
17
|
+
if args.find {|arg| arg == '-V' || arg == '--debug'}
|
18
|
+
Morpheus::Logging.set_log_level(Morpheus::Logging::Logger::DEBUG)
|
19
|
+
end
|
20
|
+
args = args.find_all {|arg| arg != '-V' && arg != '--debug'}
|
14
21
|
|
15
|
-
|
16
|
-
|
17
|
-
|
22
|
+
# JD: figure out what to do with --insecure option
|
23
|
+
if args.find {|arg| arg == '--insecure'}
|
24
|
+
Morpheus::RestClient.enable_ssl_verification = false
|
18
25
|
end
|
26
|
+
args = args.find_all {|arg| arg != '--insecure'}
|
19
27
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
28
|
+
# all commands should be registered commands
|
29
|
+
if Morpheus::Cli::CliRegistry.has_command?(args[0])
|
30
|
+
begin
|
31
|
+
Morpheus::Cli::CliRegistry.exec(args[0], args[1..-1])
|
32
|
+
exit 0
|
33
|
+
rescue OptionParser::InvalidOption => e
|
34
|
+
# raise e
|
35
|
+
print Term::ANSIColor.red, "\n", "#{e.message}", "", Term::ANSIColor.reset
|
36
|
+
print "\n", "Try -h for help with this command.", "\n\n"
|
37
|
+
if Morpheus::Logging.print_stacktrace?
|
38
|
+
print Term::ANSIColor.red, "\n", "#{e.class}: #{e.message}", "\n", Term::ANSIColor.reset
|
39
|
+
print e.backtrace.join("\n"), "\n\n"
|
40
|
+
end
|
41
|
+
exit 1
|
42
|
+
rescue => e
|
43
|
+
print Term::ANSIColor.red, "\n", "Unexpected Error", "\n\n", Term::ANSIColor.reset
|
44
|
+
if Morpheus::Logging.print_stacktrace?
|
45
|
+
print Term::ANSIColor.red, "\n", "#{e.class}: #{e.message}", "\n", Term::ANSIColor.reset
|
46
|
+
print e.backtrace.join("\n"), "\n\n"
|
47
|
+
end
|
48
|
+
exit 1
|
49
|
+
end
|
50
|
+
exit 0
|
51
|
+
else
|
52
|
+
puts "\nUsage: morpheus [command] [options]\n"
|
53
|
+
puts "\nCommands:\n"
|
54
|
+
Morpheus::Cli::CliRegistry.all.each {|cmd,klass|
|
55
|
+
puts "\t#{cmd.to_s}"
|
56
|
+
}
|
57
|
+
puts ""
|
58
|
+
exit 127
|
44
59
|
end
|
@@ -11,6 +11,10 @@ class Morpheus::APIClient
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
def whoami
|
15
|
+
Morpheus::WhoamiInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
|
16
|
+
end
|
17
|
+
|
14
18
|
def options
|
15
19
|
Morpheus::OptionsInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
|
16
20
|
end
|
@@ -103,4 +107,12 @@ class Morpheus::APIClient
|
|
103
107
|
Morpheus::LicenseInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
|
104
108
|
end
|
105
109
|
|
110
|
+
def custom_instance_types
|
111
|
+
Morpheus::CustomInstanceTypesInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
|
112
|
+
end
|
113
|
+
|
114
|
+
def dashboard
|
115
|
+
Morpheus::DashboardInterface.new(@access_token, @refresh_token, @expires_at, @base_url)
|
116
|
+
end
|
117
|
+
|
106
118
|
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'morpheus/rest_client'
|
3
|
+
|
4
|
+
class Morpheus::CustomInstanceTypesInterface < Morpheus::APIClient
|
5
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
6
|
+
@access_token = access_token
|
7
|
+
@refresh_token = refresh_token
|
8
|
+
@base_url = base_url
|
9
|
+
@expires_at = expires_at
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(id)
|
13
|
+
url = "#{@base_url}/api/custom-instance-types"
|
14
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
15
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
16
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
17
|
+
JSON.parse(response.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
def list(options={})
|
21
|
+
url = "#{@base_url}/api/custom-instance-types"
|
22
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
23
|
+
headers[:params].merge!(options)
|
24
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
25
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
26
|
+
JSON.parse(response.to_s)
|
27
|
+
end
|
28
|
+
|
29
|
+
def create(options)
|
30
|
+
url = "#{@base_url}/api/custom-instance-types"
|
31
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
32
|
+
payload = options
|
33
|
+
response = Morpheus::RestClient.execute(method: :post, url: url,
|
34
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
35
|
+
JSON.parse(response.to_s)
|
36
|
+
end
|
37
|
+
|
38
|
+
def update(id, options)
|
39
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
40
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
41
|
+
payload = options
|
42
|
+
response = Morpheus::RestClient.execute(method: :put, url: url,
|
43
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
44
|
+
JSON.parse(response.to_s)
|
45
|
+
end
|
46
|
+
|
47
|
+
def destroy(id)
|
48
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
49
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
50
|
+
response = Morpheus::RestClient.execute(method: :delete, url: url,
|
51
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
52
|
+
JSON.parse(response.to_s)
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'morpheus/rest_client'
|
3
|
+
|
4
|
+
class Morpheus::CustomInstanceTypesInterface < Morpheus::APIClient
|
5
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
6
|
+
@access_token = access_token
|
7
|
+
@refresh_token = refresh_token
|
8
|
+
@base_url = base_url
|
9
|
+
@expires_at = expires_at
|
10
|
+
end
|
11
|
+
|
12
|
+
def list(options={})
|
13
|
+
url = "#{@base_url}/api/custom-instance-types"
|
14
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
15
|
+
headers[:params].merge!(options)
|
16
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
17
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
18
|
+
JSON.parse(response.to_s)
|
19
|
+
end
|
20
|
+
|
21
|
+
def get(id)
|
22
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
23
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
24
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
25
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
26
|
+
JSON.parse(response.to_s)
|
27
|
+
end
|
28
|
+
|
29
|
+
def create(options)
|
30
|
+
url = "#{@base_url}/api/custom-instance-types"
|
31
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
32
|
+
payload = options
|
33
|
+
# payload[:multipart] = true
|
34
|
+
# convert to grails params
|
35
|
+
# it = payload.delete('instanceType') || payload.delete(:instanceType)
|
36
|
+
# if it
|
37
|
+
# it.each { |k,v| payload["instanceType.#{k}"] = v }
|
38
|
+
# end
|
39
|
+
response = Morpheus::RestClient.execute(method: :post, url: url,
|
40
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
41
|
+
JSON.parse(response.to_s)
|
42
|
+
end
|
43
|
+
|
44
|
+
def update(id, options)
|
45
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
46
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
47
|
+
payload = options
|
48
|
+
# payload[:multipart] = true
|
49
|
+
# convert to grails params
|
50
|
+
# it = payload.delete('instanceType') || payload.delete(:instanceType)
|
51
|
+
# if it
|
52
|
+
# it.each { |k,v| payload["instanceType.#{k}"] = v }
|
53
|
+
# end
|
54
|
+
response = Morpheus::RestClient.execute(method: :put, url: url,
|
55
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
56
|
+
JSON.parse(response.to_s)
|
57
|
+
end
|
58
|
+
|
59
|
+
# NOT json, multipart file upload
|
60
|
+
def update_logo(id, logo_file)
|
61
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}/updateLogo"
|
62
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}"}
|
63
|
+
payload = {}
|
64
|
+
payload[:logo] = logo_file
|
65
|
+
payload[:multipart] = true
|
66
|
+
response = Morpheus::RestClient.execute(method: :post, url: url,
|
67
|
+
timeout: 10, headers: headers, payload: payload, verify_ssl:false)
|
68
|
+
JSON.parse(response.to_s)
|
69
|
+
end
|
70
|
+
|
71
|
+
def destroy(id)
|
72
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
73
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
74
|
+
response = Morpheus::RestClient.execute(method: :delete, url: url,
|
75
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
76
|
+
JSON.parse(response.to_s)
|
77
|
+
end
|
78
|
+
|
79
|
+
def create_version(instance_type_id, options)
|
80
|
+
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/versions"
|
81
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
82
|
+
payload = options
|
83
|
+
response = Morpheus::RestClient.execute(method: :post, url: url,
|
84
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
85
|
+
JSON.parse(response.to_s)
|
86
|
+
end
|
87
|
+
|
88
|
+
def update_version(instance_type_id, id, options)
|
89
|
+
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/versions/#{id}"
|
90
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
91
|
+
payload = options
|
92
|
+
response = Morpheus::RestClient.execute(method: :put, url: url,
|
93
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
94
|
+
JSON.parse(response.to_s)
|
95
|
+
end
|
96
|
+
|
97
|
+
def destroy_version(instance_type_id, id)
|
98
|
+
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/versions/#{id}"
|
99
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
100
|
+
payload = options
|
101
|
+
response = Morpheus::RestClient.execute(method: :delete, url: url,
|
102
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
103
|
+
JSON.parse(response.to_s)
|
104
|
+
end
|
105
|
+
|
106
|
+
def create_upgrade(instance_type_id, options)
|
107
|
+
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/upgrades"
|
108
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
109
|
+
payload = options
|
110
|
+
response = Morpheus::RestClient.execute(method: :post, url: url,
|
111
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
112
|
+
JSON.parse(response.to_s)
|
113
|
+
end
|
114
|
+
|
115
|
+
def update_upgrade(instance_type_id, id, options)
|
116
|
+
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/upgrades/#{id}"
|
117
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
118
|
+
payload = options
|
119
|
+
response = Morpheus::RestClient.execute(method: :put, url: url,
|
120
|
+
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
121
|
+
JSON.parse(response.to_s)
|
122
|
+
end
|
123
|
+
|
124
|
+
def destroy_upgrade(instance_type_id, id)
|
125
|
+
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/upgrades/#{id}"
|
126
|
+
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
127
|
+
payload = options
|
128
|
+
response = Morpheus::RestClient.execute(method: :delete, url: url,
|
129
|
+
timeout: 10, headers: headers, verify_ssl:false)
|
130
|
+
JSON.parse(response.to_s)
|
131
|
+
end
|
132
|
+
|
133
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'rest-client'
|
3
|
+
|
4
|
+
class Morpheus::DashboardInterface < Morpheus::APIClient
|
5
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
6
|
+
@access_token = access_token
|
7
|
+
@refresh_token = refresh_token
|
8
|
+
@base_url = base_url
|
9
|
+
@expires_at = expires_at
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(options={})
|
13
|
+
dashboard(options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def dashboard(options={})
|
17
|
+
url = "#{@base_url}/api/dashboard"
|
18
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
19
|
+
headers[:params].merge!(options)
|
20
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
21
|
+
timeout: 30, headers: headers, verify_ssl: false)
|
22
|
+
JSON.parse(response.to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
def recent_activity(account_id=nil, options={})
|
26
|
+
url = "#{@base_url}/api/dashboard/recentActivity"
|
27
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
28
|
+
headers[:params].merge!(options)
|
29
|
+
headers[:params]['accountId'] = account_id if account_id
|
30
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
31
|
+
timeout: 10, headers: headers)
|
32
|
+
JSON.parse(response.to_s)
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
end
|
@@ -28,6 +28,23 @@ class Morpheus::UsersInterface < Morpheus::APIClient
|
|
28
28
|
JSON.parse(response.to_s)
|
29
29
|
end
|
30
30
|
|
31
|
+
def feature_permissions(account_id, id)
|
32
|
+
url = build_url(account_id, id) + "/feature-permissions"
|
33
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
34
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
35
|
+
timeout: 10, headers: headers)
|
36
|
+
JSON.parse(response.to_s)
|
37
|
+
end
|
38
|
+
|
39
|
+
def available_roles(account_id, id=nil, options={})
|
40
|
+
url = build_url(account_id, id) + "/available-roles"
|
41
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
42
|
+
headers[:params].merge!(options)
|
43
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
44
|
+
timeout: 10, headers: headers)
|
45
|
+
JSON.parse(response.to_s)
|
46
|
+
end
|
47
|
+
|
31
48
|
def create(account_id, options)
|
32
49
|
url = build_url(account_id)
|
33
50
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'rest-client'
|
3
|
+
|
4
|
+
class Morpheus::WhoamiInterface < Morpheus::APIClient
|
5
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
6
|
+
@access_token = access_token
|
7
|
+
@refresh_token = refresh_token
|
8
|
+
@base_url = base_url
|
9
|
+
@expires_at = expires_at
|
10
|
+
end
|
11
|
+
|
12
|
+
def get()
|
13
|
+
url = "#{@base_url}/api/whoami"
|
14
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
15
|
+
response = Morpheus::RestClient.execute(method: :get, url: url,
|
16
|
+
timeout: 30, headers: headers, verify_ssl: false)
|
17
|
+
JSON.parse(response.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/lib/morpheus/cli.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "morpheus/cli/version"
|
2
2
|
require "morpheus/rest_client"
|
3
3
|
require 'morpheus/formatters'
|
4
|
+
require 'morpheus/logging'
|
4
5
|
require 'term/ansicolor'
|
5
6
|
|
6
7
|
Dir[File.dirname(__FILE__) + "/ext/*.rb"].each {|file| require file }
|
@@ -8,6 +9,7 @@ Dir[File.dirname(__FILE__) + "/ext/*.rb"].each {|file| require file }
|
|
8
9
|
module Morpheus
|
9
10
|
module Cli
|
10
11
|
require 'morpheus/api/api_client'
|
12
|
+
require 'morpheus/api/whoami_interface'
|
11
13
|
require 'morpheus/api/options_interface'
|
12
14
|
require 'morpheus/api/groups_interface'
|
13
15
|
require 'morpheus/api/clouds_interface'
|
@@ -31,9 +33,17 @@ module Morpheus
|
|
31
33
|
require 'morpheus/api/logs_interface'
|
32
34
|
require 'morpheus/api/roles_interface'
|
33
35
|
require 'morpheus/api/key_pairs_interface'
|
36
|
+
require 'morpheus/api/custom_instance_types_interface'
|
37
|
+
require 'morpheus/api/dashboard_interface'
|
34
38
|
|
39
|
+
require 'morpheus/cli/cli_command'
|
40
|
+
require 'morpheus/cli/remote'
|
41
|
+
require 'morpheus/cli/login'
|
42
|
+
require 'morpheus/cli/logout'
|
43
|
+
require 'morpheus/cli/whoami'
|
44
|
+
require 'morpheus/cli/dashboard_command'
|
45
|
+
require 'morpheus/cli/recent_activity_command'
|
35
46
|
require 'morpheus/cli/credentials'
|
36
|
-
require 'morpheus/cli/remote'
|
37
47
|
require 'morpheus/cli/groups'
|
38
48
|
require 'morpheus/cli/clouds'
|
39
49
|
require 'morpheus/cli/hosts'
|
@@ -55,6 +65,8 @@ module Morpheus
|
|
55
65
|
require 'morpheus/cli/roles'
|
56
66
|
require 'morpheus/cli/key_pairs'
|
57
67
|
require 'morpheus/cli/virtual_images'
|
68
|
+
require 'morpheus/cli/library'
|
69
|
+
require 'morpheus/cli/version_command'
|
58
70
|
# Your code goes here...
|
59
71
|
end
|
60
72
|
end
|
@@ -813,7 +813,7 @@ private
|
|
813
813
|
json_response = @app_templates_interface.get(id.to_i)
|
814
814
|
return json_response['appTemplate']
|
815
815
|
rescue RestClient::Exception => e
|
816
|
-
if e.response.code == 404
|
816
|
+
if e.response && e.response.code == 404
|
817
817
|
print_red_alert "App Template not found by id #{id}"
|
818
818
|
else
|
819
819
|
raise e
|