morpheus-cli 5.3.1 → 5.3.1.1
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/account_groups_interface.rb +0 -6
- data/lib/morpheus/api/accounts_interface.rb +1 -7
- data/lib/morpheus/api/api_client.rb +108 -106
- data/lib/morpheus/api/appliance_settings_interface.rb +6 -9
- data/lib/morpheus/api/approvals_interface.rb +5 -8
- data/lib/morpheus/api/apps_interface.rb +0 -7
- data/lib/morpheus/api/archive_buckets_interface.rb +9 -16
- data/lib/morpheus/api/archive_files_interface.rb +0 -6
- data/lib/morpheus/api/auth_interface.rb +4 -4
- data/lib/morpheus/api/backup_settings_interface.rb +5 -8
- data/lib/morpheus/api/blueprints_interface.rb +1 -7
- data/lib/morpheus/api/budgets_interface.rb +0 -6
- data/lib/morpheus/api/cloud_datastores_interface.rb +0 -6
- data/lib/morpheus/api/cloud_folders_interface.rb +1 -7
- data/lib/morpheus/api/cloud_policies_interface.rb +0 -6
- data/lib/morpheus/api/cloud_resource_pools_interface.rb +0 -6
- data/lib/morpheus/api/clouds_interface.rb +0 -6
- data/lib/morpheus/api/clusters_interface.rb +39 -42
- data/lib/morpheus/api/containers_interface.rb +0 -6
- data/lib/morpheus/api/custom_instance_types_interface.rb +0 -6
- data/lib/morpheus/api/cypher_interface.rb +0 -6
- data/lib/morpheus/api/datastores_interface.rb +4 -7
- data/lib/morpheus/api/deploy_interface.rb +1 -6
- data/lib/morpheus/api/environments_interface.rb +0 -6
- data/lib/morpheus/api/execute_schedules_interface.rb +0 -6
- data/lib/morpheus/api/execution_request_interface.rb +0 -6
- data/lib/morpheus/api/file_copy_request_interface.rb +2 -9
- data/lib/morpheus/api/group_policies_interface.rb +0 -6
- data/lib/morpheus/api/groups_interface.rb +0 -7
- data/lib/morpheus/api/guidance_interface.rb +9 -12
- data/lib/morpheus/api/health_interface.rb +0 -6
- data/lib/morpheus/api/image_builder_boot_scripts_interface.rb +0 -6
- data/lib/morpheus/api/image_builder_image_builds_interface.rb +0 -6
- data/lib/morpheus/api/image_builder_interface.rb +3 -9
- data/lib/morpheus/api/image_builder_preseed_scripts_interface.rb +0 -6
- data/lib/morpheus/api/instance_types_interface.rb +0 -7
- data/lib/morpheus/api/instances_interface.rb +8 -19
- data/lib/morpheus/api/integrations_interface.rb +30 -0
- data/lib/morpheus/api/invoice_line_items_interface.rb +4 -9
- data/lib/morpheus/api/jobs_interface.rb +11 -14
- data/lib/morpheus/api/key_pairs_interface.rb +0 -6
- data/lib/morpheus/api/library_cluster_layouts_interface.rb +0 -6
- data/lib/morpheus/api/library_container_scripts_interface.rb +0 -6
- data/lib/morpheus/api/library_container_templates_interface.rb +0 -6
- data/lib/morpheus/api/library_container_types_interface.rb +0 -6
- data/lib/morpheus/api/library_container_upgrades_interface.rb +0 -6
- data/lib/morpheus/api/library_instance_types_interface.rb +0 -6
- data/lib/morpheus/api/library_layouts_interface.rb +0 -6
- data/lib/morpheus/api/library_spec_template_types_interface.rb +0 -6
- data/lib/morpheus/api/library_spec_templates_interface.rb +0 -6
- data/lib/morpheus/api/license_interface.rb +0 -6
- data/lib/morpheus/api/load_balancers_interface.rb +0 -6
- data/lib/morpheus/api/log_settings_interface.rb +9 -12
- data/lib/morpheus/api/logs_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_alerts_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_apps_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_checks_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_contacts_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_groups_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_incidents_interface.rb +0 -6
- data/lib/morpheus/api/monitoring_interface.rb +6 -12
- data/lib/morpheus/api/network_domain_records_interface.rb +0 -6
- data/lib/morpheus/api/network_domains_interface.rb +0 -6
- data/lib/morpheus/api/network_groups_interface.rb +0 -6
- data/lib/morpheus/api/network_pool_ips_interface.rb +0 -6
- data/lib/morpheus/api/network_pool_servers_interface.rb +0 -6
- data/lib/morpheus/api/network_pools_interface.rb +0 -6
- data/lib/morpheus/api/network_proxies_interface.rb +0 -6
- data/lib/morpheus/api/network_routers_interface.rb +0 -6
- data/lib/morpheus/api/network_security_servers_interface.rb +6 -9
- data/lib/morpheus/api/network_services_interface.rb +0 -14
- data/lib/morpheus/api/network_subnets_interface.rb +0 -6
- data/lib/morpheus/api/network_types_interface.rb +1 -7
- data/lib/morpheus/api/networks_interface.rb +0 -6
- data/lib/morpheus/api/option_type_lists_interface.rb +0 -6
- data/lib/morpheus/api/option_types_interface.rb +0 -6
- data/lib/morpheus/api/options_interface.rb +0 -6
- data/lib/morpheus/api/packages_interface.rb +0 -6
- data/lib/morpheus/api/policies_interface.rb +1 -8
- data/lib/morpheus/api/power_schedules_interface.rb +0 -6
- data/lib/morpheus/api/price_sets_interface.rb +8 -11
- data/lib/morpheus/api/prices_interface.rb +12 -15
- data/lib/morpheus/api/processes_interface.rb +0 -6
- data/lib/morpheus/api/provision_types_interface.rb +0 -6
- data/lib/morpheus/api/provisioning_license_types_interface.rb +0 -6
- data/lib/morpheus/api/provisioning_licenses_interface.rb +0 -6
- data/lib/morpheus/api/provisioning_settings_interface.rb +6 -9
- data/lib/morpheus/api/reports_interface.rb +0 -6
- data/lib/morpheus/api/roles_interface.rb +0 -6
- data/lib/morpheus/api/security_group_rules_interface.rb +0 -7
- data/lib/morpheus/api/security_groups_interface.rb +0 -6
- data/lib/morpheus/api/server_types_interface.rb +0 -6
- data/lib/morpheus/api/servers_interface.rb +0 -6
- data/lib/morpheus/api/service_plans_interface.rb +11 -14
- data/lib/morpheus/api/storage_providers_interface.rb +9 -16
- data/lib/morpheus/api/subnet_types_interface.rb +1 -7
- data/lib/morpheus/api/subnets_interface.rb +0 -6
- data/lib/morpheus/api/task_sets_interface.rb +0 -6
- data/lib/morpheus/api/tasks_interface.rb +0 -6
- data/lib/morpheus/api/user_groups_interface.rb +0 -6
- data/lib/morpheus/api/user_sources_interface.rb +0 -6
- data/lib/morpheus/api/users_interface.rb +0 -6
- data/lib/morpheus/api/virtual_images_interface.rb +0 -6
- data/lib/morpheus/api/whitelabel_settings_interface.rb +8 -11
- data/lib/morpheus/api/wiki_interface.rb +0 -6
- data/lib/morpheus/cli/access_token_command.rb +1 -1
- data/lib/morpheus/cli/account_groups_command.rb +4 -4
- data/lib/morpheus/cli/apps.rb +9 -9
- data/lib/morpheus/cli/archives_command.rb +5 -5
- data/lib/morpheus/cli/blueprints_command.rb +5 -5
- data/lib/morpheus/cli/boot_scripts_command.rb +1 -1
- data/lib/morpheus/cli/change_password_command.rb +4 -4
- data/lib/morpheus/cli/cli_command.rb +2 -1
- data/lib/morpheus/cli/clouds.rb +2 -2
- data/lib/morpheus/cli/clusters.rb +2 -2
- data/lib/morpheus/cli/credentials.rb +4 -11
- data/lib/morpheus/cli/environments_command.rb +1 -1
- data/lib/morpheus/cli/execute_schedules_command.rb +3 -3
- data/lib/morpheus/cli/hosts.rb +8 -8
- data/lib/morpheus/cli/image_builder_command.rb +6 -6
- data/lib/morpheus/cli/instance_types.rb +1 -1
- data/lib/morpheus/cli/instances.rb +54 -27
- data/lib/morpheus/cli/integrations_command.rb +567 -1
- data/lib/morpheus/cli/invoices_command.rb +75 -67
- data/lib/morpheus/cli/key_pairs.rb +2 -2
- data/lib/morpheus/cli/library_container_scripts_command.rb +1 -1
- data/lib/morpheus/cli/library_container_templates_command.rb +1 -1
- data/lib/morpheus/cli/library_container_types_command.rb +6 -6
- data/lib/morpheus/cli/library_instance_types_command.rb +4 -4
- data/lib/morpheus/cli/library_layouts_command.rb +5 -5
- data/lib/morpheus/cli/library_option_lists_command.rb +4 -4
- data/lib/morpheus/cli/library_option_types_command.rb +4 -4
- data/lib/morpheus/cli/library_upgrades_command.rb +6 -6
- data/lib/morpheus/cli/license.rb +2 -2
- data/lib/morpheus/cli/load_balancers.rb +1 -1
- data/lib/morpheus/cli/login.rb +3 -1
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +1 -1
- data/lib/morpheus/cli/option_types.rb +5 -1
- data/lib/morpheus/cli/policies_command.rb +0 -1
- data/lib/morpheus/cli/power_schedules_command.rb +3 -3
- data/lib/morpheus/cli/preseed_scripts_command.rb +1 -1
- data/lib/morpheus/cli/remote.rb +1 -1
- data/lib/morpheus/cli/roles.rb +9 -9
- data/lib/morpheus/cli/security_group_rules.rb +1 -1
- data/lib/morpheus/cli/setup.rb +0 -1
- data/lib/morpheus/cli/tenants_command.rb +3 -3
- data/lib/morpheus/cli/user_groups_command.rb +3 -3
- data/lib/morpheus/cli/user_sources_command.rb +3 -3
- data/lib/morpheus/cli/users.rb +3 -3
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/virtual_images.rb +1 -1
- data/lib/morpheus/cli/whoami.rb +0 -15
- data/lib/morpheus/cli/wiki_command.rb +1 -1
- metadata +2 -2
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::RolesInterface < 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
4
|
|
11
5
|
def get(account_id, id)
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -1,13 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::SecurityGroupRulesInterface < 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
4
|
|
12
5
|
def get(security_group_id, options=nil)
|
13
6
|
url = "#{@base_url}/api/security-groups/#{security_group_id}/rules"
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::SecurityGroupsInterface < 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
4
|
|
11
5
|
def list(params={})
|
12
6
|
url = "#{@base_url}/api/security-groups"
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::ServerTypesInterface < 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
4
|
|
11
5
|
def get(id, params={})
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::ServersInterface < 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
4
|
|
11
5
|
def get(options=nil)
|
12
6
|
url = "#{@base_url}/api/servers"
|
@@ -1,58 +1,55 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::ServicePlansInterface < Morpheus::APIClient
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
@base_url = base_url
|
8
|
-
@api_url = "#{@base_url}/api/service-plans"
|
9
|
-
@expires_at = expires_at
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/service-plans"
|
10
7
|
end
|
11
8
|
|
12
9
|
def list(params={})
|
13
|
-
url =
|
10
|
+
url = base_path
|
14
11
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
15
12
|
execute(method: :get, url: url, headers: headers)
|
16
13
|
end
|
17
14
|
|
18
15
|
def get(id, params={})
|
19
|
-
url = "#{
|
16
|
+
url = "#{base_path}/#{id}"
|
20
17
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
21
18
|
execute(method: :get, url: url, headers: headers)
|
22
19
|
end
|
23
20
|
|
24
21
|
def create(payload)
|
25
|
-
url =
|
22
|
+
url = base_path
|
26
23
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
27
24
|
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
28
25
|
end
|
29
26
|
|
30
27
|
def update(id, payload)
|
31
|
-
url = "#{
|
28
|
+
url = "#{base_path}/#{id}"
|
32
29
|
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
33
30
|
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
34
31
|
end
|
35
32
|
|
36
33
|
def activate(id, params={})
|
37
|
-
url = "#{
|
34
|
+
url = "#{base_path}/#{id}/activate"
|
38
35
|
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
39
36
|
execute(method: :put, url: url, headers: headers)
|
40
37
|
end
|
41
38
|
|
42
39
|
def deactivate(id, params={})
|
43
|
-
url = "#{
|
40
|
+
url = "#{base_path}/#{id}/deactivate"
|
44
41
|
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
45
42
|
execute(method: :put, url: url, headers: headers)
|
46
43
|
end
|
47
44
|
|
48
45
|
def provision_types(params={})
|
49
|
-
url = "#{
|
46
|
+
url = "#{base_path}/provision-types"
|
50
47
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
51
48
|
execute(method: :get, url: url, headers: headers)
|
52
49
|
end
|
53
50
|
|
54
51
|
def price_sets(params={})
|
55
|
-
url = "#{
|
52
|
+
url = "#{base_path}/price-sets"
|
56
53
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
57
54
|
execute(method: :get, url: url, headers: headers)
|
58
55
|
end
|
@@ -1,13 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
|
-
require 'uri'
|
3
2
|
|
4
3
|
class Morpheus::StorageProvidersInterface < 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
4
|
|
12
5
|
def get(id, params={})
|
13
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -49,7 +42,7 @@ class Morpheus::StorageProvidersInterface < Morpheus::APIClient
|
|
49
42
|
if file_path.to_s.strip == "/"
|
50
43
|
file_path = ""
|
51
44
|
end
|
52
|
-
url = "#{@base_url}/api/storage/buckets/#{
|
45
|
+
url = "#{@base_url}/api/storage/buckets/#{CGI::escape(id.to_s)}" + "/files/#{CGI::escape(file_path)}".squeeze('/')
|
53
46
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
54
47
|
opts = {method: :get, url: url, headers: headers}
|
55
48
|
execute(opts)
|
@@ -68,13 +61,13 @@ class Morpheus::StorageProvidersInterface < Morpheus::APIClient
|
|
68
61
|
end
|
69
62
|
path_chunks = path.split("/")
|
70
63
|
filename = path_chunks.pop
|
71
|
-
safe_dirname = path_chunks.collect {|it|
|
64
|
+
safe_dirname = path_chunks.collect {|it| CGI::escape(it) }.join("/")
|
72
65
|
# filename = File.basename(destination)
|
73
66
|
# dirname = File.dirname(destination)
|
74
67
|
# if filename == "" || filename == "/"
|
75
68
|
# filename = File.basename(local_file)
|
76
69
|
# end
|
77
|
-
url = "#{@base_url}/api/storage/buckets/#{
|
70
|
+
url = "#{@base_url}/api/storage/buckets/#{CGI::escape(id.to_s)}" + "/files/#{safe_dirname}".squeeze('/')
|
78
71
|
headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/octet-stream'}
|
79
72
|
headers[:params][:filename] = filename # File.basename(destination)
|
80
73
|
if !local_file.kind_of?(File)
|
@@ -88,8 +81,8 @@ class Morpheus::StorageProvidersInterface < Morpheus::APIClient
|
|
88
81
|
def download_file(id, file_path, params={})
|
89
82
|
raise "#{self.class}.download_file() passed a blank id!" if id.to_s == ''
|
90
83
|
raise "#{self.class}.download_file() passed a blank file path!" if file_path.to_s == ''
|
91
|
-
escaped_file_path = file_path.split("/").collect {|it|
|
92
|
-
url = "#{@base_url}/api/storage/buckets/#{
|
84
|
+
escaped_file_path = file_path.split("/").collect {|it| CGI::escape(it) }.join("/")
|
85
|
+
url = "#{@base_url}/api/storage/buckets/#{CGI::escape(id.to_s)}" + "/download-file/#{escaped_file_path}".squeeze('/')
|
93
86
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
94
87
|
opts = {method: :get, url: url, headers: headers}
|
95
88
|
execute(opts, false)
|
@@ -98,8 +91,8 @@ class Morpheus::StorageProvidersInterface < Morpheus::APIClient
|
|
98
91
|
def download_file_chunked(id, file_path, outfile, params={})
|
99
92
|
raise "#{self.class}.download_file() passed a blank id!" if id.to_s == ''
|
100
93
|
raise "#{self.class}.download_file() passed a blank file path!" if file_path.to_s == ''
|
101
|
-
escaped_file_path = file_path.split("/").collect {|it|
|
102
|
-
url = "#{@base_url}/api/storage/buckets/#{
|
94
|
+
escaped_file_path = file_path.split("/").collect {|it| CGI::escape(it) }.join("/")
|
95
|
+
url = "#{@base_url}/api/storage/buckets/#{CGI::escape(id.to_s)}" + "/download-file/#{escaped_file_path}".squeeze('/')
|
103
96
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
104
97
|
opts = {method: :get, url: url, headers: headers}
|
105
98
|
# execute(opts, false)
|
@@ -127,8 +120,8 @@ class Morpheus::StorageProvidersInterface < Morpheus::APIClient
|
|
127
120
|
end
|
128
121
|
|
129
122
|
def download_zip_chunked(id, outfile, params={})
|
130
|
-
#url = "#{@base_url}/api/storage/buckets/#{
|
131
|
-
url = "#{@base_url}/api/storage/buckets/#{
|
123
|
+
#url = "#{@base_url}/api/storage/buckets/#{CGI::escape(id.to_s)}" + ".zip"
|
124
|
+
url = "#{@base_url}/api/storage/buckets/#{CGI::escape(id.to_s)}/download-zip"
|
132
125
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
133
126
|
opts = {method: :get, url: url, headers: headers}
|
134
127
|
# execute(opts, false)
|
@@ -1,14 +1,8 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::SubnetTypesInterface < 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
4
|
|
11
|
-
def get(id, params={})
|
5
|
+
def get(id, params={})
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
13
7
|
url = "#{@base_url}/api/subnet-types/#{id}"
|
14
8
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::SubnetsInterface < 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
4
|
|
11
5
|
def get(id, params={})
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::TaskSetsInterface < 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
4
|
|
11
5
|
def list(params={})
|
12
6
|
url = "#{@base_url}/api/task-sets"
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::TasksInterface < 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
4
|
|
11
5
|
def list(params={})
|
12
6
|
url = "#{@base_url}/api/tasks"
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::UserGroupsInterface < 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
4
|
|
11
5
|
def get(account_id, id)
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::UserSourcesInterface < 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
4
|
|
11
5
|
def get(account_id, id)
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::UsersInterface < 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
4
|
|
11
5
|
def get(account_id, id, params={})
|
12
6
|
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
|
@@ -4,12 +4,6 @@ require 'zlib'
|
|
4
4
|
require 'forwardable'
|
5
5
|
|
6
6
|
class Morpheus::VirtualImagesInterface < Morpheus::APIClient
|
7
|
-
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
8
|
-
@access_token = access_token
|
9
|
-
@refresh_token = refresh_token
|
10
|
-
@base_url = base_url
|
11
|
-
@expires_at = expires_at
|
12
|
-
end
|
13
7
|
|
14
8
|
def virtual_image_types(options={})
|
15
9
|
url = "#{@base_url}/api/virtual-image-types"
|
@@ -1,41 +1,38 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::WhitelabelSettingsInterface < Morpheus::APIClient
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
@base_url = base_url
|
8
|
-
@api_url = "#{base_url}/api/#{api}"
|
9
|
-
@expires_at = expires_at
|
4
|
+
|
5
|
+
def base_path
|
6
|
+
"/api/whitelabel-settings"
|
10
7
|
end
|
11
8
|
|
12
9
|
def get(params={})
|
13
|
-
url =
|
10
|
+
url = base_path
|
14
11
|
headers = { params: params, authorization: "Bearer #{@access_token}" }
|
15
12
|
execute(method: :get, url: url, headers: headers)
|
16
13
|
end
|
17
14
|
|
18
15
|
def update(payload, params={})
|
19
|
-
url =
|
16
|
+
url = base_path
|
20
17
|
headers = { params: params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
21
18
|
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
22
19
|
end
|
23
20
|
|
24
21
|
def update_images(payload, params={})
|
25
|
-
url = "#{
|
22
|
+
url = "#{base_path}/images"
|
26
23
|
headers = { params: params, :authorization => "Bearer #{@access_token}" }
|
27
24
|
payload[:multipart] = true
|
28
25
|
execute(method: :post, url: url, headers: headers, payload: payload)
|
29
26
|
end
|
30
27
|
|
31
28
|
def reset_image(image_type, params={})
|
32
|
-
url = "#{
|
29
|
+
url = "#{base_path}/images/#{image_type}"
|
33
30
|
headers = { params: params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
34
31
|
execute(method: :delete, url: url, headers: headers)
|
35
32
|
end
|
36
33
|
|
37
34
|
def download_image(image_type, outfile, params={})
|
38
|
-
url = "#{
|
35
|
+
url = "#{base_path}/images/#{image_type}"
|
39
36
|
headers = { params: params, :authorization => "Bearer #{@access_token}" }
|
40
37
|
opts = {method: :get, url: url, headers: headers, timeout: 172800}
|
41
38
|
|
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'morpheus/api/api_client'
|
2
2
|
|
3
3
|
class Morpheus::WikiInterface < 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
4
|
|
11
5
|
def get(id, params={})
|
12
6
|
raise "#{self.class}.get() passed a blank name!" if id.to_s == ''
|
@@ -156,7 +156,7 @@ class Morpheus::Cli::AccessTokenCommand
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
if options[:dry_run]
|
159
|
-
print_dry_run
|
159
|
+
print_dry_run @api_client.auth.dry.use_refresh_token(refresh_token_value)
|
160
160
|
return 0
|
161
161
|
end
|
162
162
|
unless options[:quiet]
|
@@ -28,11 +28,11 @@ class Morpheus::Cli::AccountGroupsCommand
|
|
28
28
|
|
29
29
|
def connect(opts)
|
30
30
|
@api_client = establish_remote_appliance_connection(opts)
|
31
|
-
@account_groups_interface =
|
32
|
-
@accounts_interface =
|
31
|
+
@account_groups_interface = @api_client.account_groups
|
32
|
+
@accounts_interface = @api_client.accounts
|
33
33
|
|
34
|
-
@groups_interface =
|
35
|
-
@clouds_interface =
|
34
|
+
@groups_interface = @api_client.groups
|
35
|
+
@clouds_interface = @api_client.clouds
|
36
36
|
end
|
37
37
|
|
38
38
|
def handle(args)
|
data/lib/morpheus/cli/apps.rb
CHANGED
@@ -37,15 +37,15 @@ class Morpheus::Cli::Apps
|
|
37
37
|
@api_client = establish_remote_appliance_connection(opts)
|
38
38
|
@accounts_interface = @api_client.accounts
|
39
39
|
@users_interface = @api_client.users
|
40
|
-
@apps_interface =
|
41
|
-
@blueprints_interface =
|
42
|
-
@instance_types_interface =
|
43
|
-
@library_layouts_interface =
|
44
|
-
@instances_interface =
|
45
|
-
@options_interface =
|
46
|
-
@groups_interface =
|
47
|
-
@clouds_interface =
|
48
|
-
@logs_interface =
|
40
|
+
@apps_interface = @api_client.apps
|
41
|
+
@blueprints_interface = @api_client.blueprints
|
42
|
+
@instance_types_interface = @api_client.instance_types
|
43
|
+
@library_layouts_interface = @api_client.library_layouts
|
44
|
+
@instances_interface = @api_client.instances
|
45
|
+
@options_interface = @api_client.options
|
46
|
+
@groups_interface = @api_client.groups
|
47
|
+
@clouds_interface = @api_client.clouds
|
48
|
+
@logs_interface = @api_client.logs
|
49
49
|
@processes_interface = @api_client.processes
|
50
50
|
@active_group_id = Morpheus::Cli::Groups.active_groups[@appliance_name]
|
51
51
|
end
|