morpheus-cli 2.10.0 → 2.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/morpheus +27 -32
- data/lib/morpheus/api/accounts_interface.rb +36 -47
- data/lib/morpheus/api/api_client.rb +141 -110
- data/lib/morpheus/api/app_templates_interface.rb +56 -72
- data/lib/morpheus/api/apps_interface.rb +111 -132
- data/lib/morpheus/api/auth_interface.rb +30 -0
- data/lib/morpheus/api/clouds_interface.rb +71 -76
- data/lib/morpheus/api/custom_instance_types_interface.rb +21 -46
- data/lib/morpheus/api/dashboard_interface.rb +10 -17
- data/lib/morpheus/api/deploy_interface.rb +60 -72
- data/lib/morpheus/api/deployments_interface.rb +53 -71
- data/lib/morpheus/api/groups_interface.rb +55 -45
- data/lib/morpheus/api/instance_types_interface.rb +19 -23
- data/lib/morpheus/api/instances_interface.rb +179 -177
- data/lib/morpheus/api/key_pairs_interface.rb +11 -17
- data/lib/morpheus/api/license_interface.rb +18 -23
- data/lib/morpheus/api/load_balancers_interface.rb +54 -69
- data/lib/morpheus/api/logs_interface.rb +25 -29
- data/lib/morpheus/api/options_interface.rb +13 -17
- data/lib/morpheus/api/provision_types_interface.rb +19 -22
- data/lib/morpheus/api/roles_interface.rb +75 -94
- data/lib/morpheus/api/security_group_rules_interface.rb +28 -37
- data/lib/morpheus/api/security_groups_interface.rb +39 -51
- data/lib/morpheus/api/servers_interface.rb +113 -115
- data/lib/morpheus/api/setup_interface.rb +31 -0
- data/lib/morpheus/api/task_sets_interface.rb +36 -38
- data/lib/morpheus/api/tasks_interface.rb +56 -69
- data/lib/morpheus/api/users_interface.rb +67 -76
- data/lib/morpheus/api/virtual_images_interface.rb +61 -61
- data/lib/morpheus/api/whoami_interface.rb +12 -15
- data/lib/morpheus/cli.rb +71 -60
- data/lib/morpheus/cli/accounts.rb +254 -315
- data/lib/morpheus/cli/alias_command.rb +219 -0
- data/lib/morpheus/cli/app_templates.rb +264 -272
- data/lib/morpheus/cli/apps.rb +608 -671
- data/lib/morpheus/cli/cli_command.rb +259 -21
- data/lib/morpheus/cli/cli_registry.rb +99 -14
- data/lib/morpheus/cli/clouds.rb +599 -372
- data/lib/morpheus/cli/config_file.rb +126 -0
- data/lib/morpheus/cli/credentials.rb +141 -117
- data/lib/morpheus/cli/dashboard_command.rb +48 -56
- data/lib/morpheus/cli/deployments.rb +254 -268
- data/lib/morpheus/cli/deploys.rb +150 -142
- data/lib/morpheus/cli/error_handler.rb +38 -0
- data/lib/morpheus/cli/groups.rb +551 -179
- data/lib/morpheus/cli/hosts.rb +862 -617
- data/lib/morpheus/cli/instance_types.rb +103 -95
- data/lib/morpheus/cli/instances.rb +1335 -1009
- data/lib/morpheus/cli/key_pairs.rb +82 -90
- data/lib/morpheus/cli/library.rb +498 -499
- data/lib/morpheus/cli/license.rb +83 -101
- data/lib/morpheus/cli/load_balancers.rb +314 -300
- data/lib/morpheus/cli/login.rb +66 -44
- data/lib/morpheus/cli/logout.rb +47 -46
- data/lib/morpheus/cli/mixins/accounts_helper.rb +69 -31
- data/lib/morpheus/cli/mixins/infrastructure_helper.rb +106 -0
- data/lib/morpheus/cli/mixins/print_helper.rb +181 -17
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +535 -458
- data/lib/morpheus/cli/mixins/whoami_helper.rb +2 -2
- data/lib/morpheus/cli/option_parser.rb +35 -0
- data/lib/morpheus/cli/option_types.rb +232 -192
- data/lib/morpheus/cli/recent_activity_command.rb +61 -65
- data/lib/morpheus/cli/remote.rb +446 -199
- data/lib/morpheus/cli/roles.rb +884 -906
- data/lib/morpheus/cli/security_group_rules.rb +213 -203
- data/lib/morpheus/cli/security_groups.rb +237 -192
- data/lib/morpheus/cli/shell.rb +338 -231
- data/lib/morpheus/cli/tasks.rb +326 -308
- data/lib/morpheus/cli/users.rb +457 -462
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/version_command.rb +16 -18
- data/lib/morpheus/cli/virtual_images.rb +526 -345
- data/lib/morpheus/cli/whoami.rb +125 -111
- data/lib/morpheus/cli/workflows.rb +338 -185
- data/lib/morpheus/formatters.rb +8 -1
- data/lib/morpheus/logging.rb +1 -1
- data/lib/morpheus/rest_client.rb +17 -8
- metadata +9 -3
- data/lib/morpheus/api/custom_instance_types.rb +0 -55
@@ -1,29 +1,24 @@
|
|
1
|
-
require '
|
2
|
-
require 'morpheus/rest_client'
|
1
|
+
require 'morpheus/api/api_client'
|
3
2
|
|
4
3
|
class Morpheus::CustomInstanceTypesInterface < Morpheus::APIClient
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
11
10
|
|
12
|
-
|
11
|
+
def list(options={})
|
13
12
|
url = "#{@base_url}/api/custom-instance-types"
|
14
13
|
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
15
14
|
headers[:params].merge!(options)
|
16
|
-
|
17
|
-
timeout: 10, headers: headers, verify_ssl:false)
|
18
|
-
JSON.parse(response.to_s)
|
15
|
+
execute(method: :get, url: url, headers: headers)
|
19
16
|
end
|
20
17
|
|
21
18
|
def get(id)
|
22
19
|
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
23
20
|
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
24
|
-
|
25
|
-
timeout: 10, headers: headers, verify_ssl:false)
|
26
|
-
JSON.parse(response.to_s)
|
21
|
+
execute(method: :get, url: url, headers: headers)
|
27
22
|
end
|
28
23
|
|
29
24
|
def create(options)
|
@@ -36,9 +31,7 @@ class Morpheus::CustomInstanceTypesInterface < Morpheus::APIClient
|
|
36
31
|
# if it
|
37
32
|
# it.each { |k,v| payload["instanceType.#{k}"] = v }
|
38
33
|
# end
|
39
|
-
|
40
|
-
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
41
|
-
JSON.parse(response.to_s)
|
34
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
42
35
|
end
|
43
36
|
|
44
37
|
def update(id, options)
|
@@ -51,83 +44,65 @@ class Morpheus::CustomInstanceTypesInterface < Morpheus::APIClient
|
|
51
44
|
# if it
|
52
45
|
# it.each { |k,v| payload["instanceType.#{k}"] = v }
|
53
46
|
# end
|
54
|
-
|
55
|
-
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
56
|
-
JSON.parse(response.to_s)
|
47
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
57
48
|
end
|
58
49
|
|
59
50
|
# NOT json, multipart file upload
|
60
51
|
def update_logo(id, logo_file)
|
61
|
-
url = "#{@base_url}/api/custom-instance-types/#{id}/
|
52
|
+
url = "#{@base_url}/api/custom-instance-types/#{id}/update-logo"
|
62
53
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}"}
|
63
54
|
payload = {}
|
64
55
|
payload[:logo] = logo_file
|
65
56
|
payload[:multipart] = true
|
66
|
-
|
67
|
-
timeout: 10, headers: headers, payload: payload, verify_ssl:false)
|
68
|
-
JSON.parse(response.to_s)
|
57
|
+
execute(method: :post, url: url, headers: headers, payload: payload)
|
69
58
|
end
|
70
59
|
|
71
60
|
def destroy(id)
|
72
61
|
url = "#{@base_url}/api/custom-instance-types/#{id}"
|
73
62
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
74
|
-
|
75
|
-
timeout: 10, headers: headers, verify_ssl:false)
|
76
|
-
JSON.parse(response.to_s)
|
63
|
+
execute(method: :delete, url: url, headers: headers)
|
77
64
|
end
|
78
65
|
|
79
66
|
def create_version(instance_type_id, options)
|
80
67
|
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/versions"
|
81
68
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
82
69
|
payload = options
|
83
|
-
|
84
|
-
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
85
|
-
JSON.parse(response.to_s)
|
70
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
86
71
|
end
|
87
72
|
|
88
73
|
def update_version(instance_type_id, id, options)
|
89
74
|
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/versions/#{id}"
|
90
75
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
91
76
|
payload = options
|
92
|
-
|
93
|
-
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
94
|
-
JSON.parse(response.to_s)
|
77
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
95
78
|
end
|
96
79
|
|
97
80
|
def destroy_version(instance_type_id, id)
|
98
81
|
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/versions/#{id}"
|
99
82
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
100
83
|
payload = options
|
101
|
-
|
102
|
-
timeout: 10, headers: headers, verify_ssl:false)
|
103
|
-
JSON.parse(response.to_s)
|
84
|
+
execute(method: :delete, url: url, headers: headers)
|
104
85
|
end
|
105
86
|
|
106
87
|
def create_upgrade(instance_type_id, options)
|
107
88
|
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/upgrades"
|
108
89
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
109
90
|
payload = options
|
110
|
-
|
111
|
-
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
112
|
-
JSON.parse(response.to_s)
|
91
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
113
92
|
end
|
114
93
|
|
115
94
|
def update_upgrade(instance_type_id, id, options)
|
116
95
|
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/upgrades/#{id}"
|
117
96
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
118
97
|
payload = options
|
119
|
-
|
120
|
-
timeout: 10, headers: headers, payload: payload.to_json, verify_ssl:false)
|
121
|
-
JSON.parse(response.to_s)
|
98
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
122
99
|
end
|
123
100
|
|
124
101
|
def destroy_upgrade(instance_type_id, id)
|
125
102
|
url = "#{@base_url}/api/custom-instance-types/#{instance_type_id}/upgrades/#{id}"
|
126
103
|
headers = { :params => {}, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json'}
|
127
104
|
payload = options
|
128
|
-
|
129
|
-
timeout: 10, headers: headers, verify_ssl:false)
|
130
|
-
JSON.parse(response.to_s)
|
105
|
+
execute(method: :delete, url: url, headers: headers)
|
131
106
|
end
|
132
107
|
|
133
108
|
end
|
@@ -1,13 +1,12 @@
|
|
1
|
-
require '
|
2
|
-
require 'rest-client'
|
1
|
+
require 'morpheus/api/api_client'
|
3
2
|
|
4
3
|
class Morpheus::DashboardInterface < Morpheus::APIClient
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
11
10
|
|
12
11
|
def get(options={})
|
13
12
|
dashboard(options)
|
@@ -17,21 +16,15 @@ class Morpheus::DashboardInterface < Morpheus::APIClient
|
|
17
16
|
url = "#{@base_url}/api/dashboard"
|
18
17
|
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
19
18
|
headers[:params].merge!(options)
|
20
|
-
|
21
|
-
timeout: 30, headers: headers, verify_ssl: false)
|
22
|
-
JSON.parse(response.to_s)
|
19
|
+
execute(method: :get, url: url, headers: headers)
|
23
20
|
end
|
24
21
|
|
25
|
-
|
22
|
+
def recent_activity(account_id=nil, options={})
|
26
23
|
url = "#{@base_url}/api/dashboard/recentActivity"
|
27
24
|
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
28
25
|
headers[:params].merge!(options)
|
29
26
|
headers[:params]['accountId'] = account_id if account_id
|
30
|
-
|
31
|
-
timeout: 10, headers: headers)
|
32
|
-
JSON.parse(response.to_s)
|
27
|
+
execute(method: :get, url: url, headers: headers)
|
33
28
|
end
|
34
29
|
|
35
|
-
|
36
|
-
|
37
30
|
end
|
@@ -1,88 +1,76 @@
|
|
1
|
-
require '
|
1
|
+
require 'morpheus/api/api_client'
|
2
2
|
require 'net/http/post/multipart'
|
3
3
|
require 'mime/types'
|
4
|
-
require 'morpheus/rest_client'
|
5
4
|
|
6
5
|
class Morpheus::DeployInterface < Morpheus::APIClient
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
|
7
|
+
@access_token = access_token
|
8
|
+
@refresh_token = refresh_token
|
9
|
+
@base_url = base_url
|
10
|
+
@expires_at = expires_at
|
11
|
+
end
|
13
12
|
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def get(instanceId, options=nil)
|
15
|
+
url = "#{@base_url}/api/instances/#{instanceId}/deploy"
|
16
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
JSON.parse(response.to_s)
|
27
|
-
end
|
18
|
+
if options.is_a?(Hash)
|
19
|
+
headers[:params].merge!(options)
|
20
|
+
elsif options.is_a?(String)
|
21
|
+
headers[:params]['name'] = options
|
22
|
+
end
|
23
|
+
execute(method: :get, url: url, headers: headers)
|
24
|
+
end
|
28
25
|
|
29
26
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
timeout: 30, headers: headers, payload: payload.to_json)
|
37
|
-
JSON.parse(response.to_s)
|
38
|
-
end
|
27
|
+
def create(instanceId, options=nil)
|
28
|
+
url = "#{@base_url}/api/instances/#{instanceId}/deploy"
|
29
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
30
|
+
payload = options || {}
|
31
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
32
|
+
end
|
39
33
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
timeout: 30, headers: headers)
|
47
|
-
JSON.parse(response.to_s)
|
48
|
-
end
|
34
|
+
def list_files(id)
|
35
|
+
url = "#{@base_url}/api/deploy/#{id}/files"
|
36
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
37
|
+
payload = options
|
38
|
+
execute(method: :get, url: url, headers: headers)
|
39
|
+
end
|
49
40
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
41
|
+
# todo: use execute() to support @dry_run?
|
42
|
+
def upload_file(id,path,destination=nil)
|
43
|
+
url_string = "#{@base_url}/api/deploy/#{id}/files"
|
44
|
+
if !destination.empty?
|
45
|
+
url_string += "/#{destination}"
|
46
|
+
end
|
55
47
|
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
url = URI.parse(url_string)
|
49
|
+
req = Net::HTTP::Post::Multipart.new url.path,
|
50
|
+
"file" => UploadIO.new(File.new(path,'rb'), "image/jpeg", File.basename(path))
|
59
51
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
52
|
+
req['Authorization'] = "Bearer #{@access_token}"
|
53
|
+
res = Net::HTTP.start(url.host, url.port) do |http|
|
54
|
+
http.request(req)
|
55
|
+
end
|
56
|
+
res
|
57
|
+
end
|
67
58
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
JSON.parse(response.to_s)
|
74
|
-
end
|
59
|
+
def destroy(id)
|
60
|
+
url = "#{@base_url}/api/deploy/#{id}"
|
61
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
62
|
+
execute(method: :delete, url: url, headers: headers)
|
63
|
+
end
|
75
64
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
end
|
65
|
+
def deploy(id, options)
|
66
|
+
url = "#{@base_url}/api/deploy/#{id}/deploy"
|
67
|
+
payload = options
|
68
|
+
if !options[:appDeploy].nil?
|
69
|
+
if !options[:appDeploy][:config].nil?
|
70
|
+
options[:appDeploy][:config] = options[:appDeploy][:config].to_json
|
71
|
+
end
|
72
|
+
end
|
73
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
74
|
+
execute(method: :post, url: url, headers: headers, timeout: nil, payload: payload.to_json)
|
75
|
+
end
|
88
76
|
end
|
@@ -1,82 +1,64 @@
|
|
1
|
-
require '
|
2
|
-
require 'morpheus/rest_client'
|
1
|
+
require 'morpheus/api/api_client'
|
3
2
|
|
4
3
|
class Morpheus::DeploymentsInterface < Morpheus::APIClient
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
11
10
|
|
11
|
+
def get(options=nil)
|
12
|
+
url = "#{@base_url}/api/deployments"
|
13
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
14
|
+
if options.is_a?(Hash)
|
15
|
+
headers[:params].merge!(options)
|
16
|
+
elsif options.is_a?(Numeric)
|
17
|
+
url = "#{@base_url}/api/deployments/#{options}"
|
18
|
+
elsif options.is_a?(String)
|
19
|
+
headers[:params]['name'] = options
|
20
|
+
end
|
21
|
+
execute(method: :get, url: url, headers: headers)
|
22
|
+
end
|
12
23
|
|
13
|
-
|
14
|
-
|
15
|
-
|
24
|
+
def list_versions(deployment_id,options=nil)
|
25
|
+
url = "#{@base_url}/api/deployments/#{deployment_id}/versions"
|
26
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
16
27
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
JSON.parse(response.to_s)
|
27
|
-
end
|
28
|
+
if options.is_a?(Hash)
|
29
|
+
headers[:params].merge!(options)
|
30
|
+
elsif options.is_a?(Numeric)
|
31
|
+
url = "#{@base_url}/api/deployments/#{deployment_id}/versions/#{options}"
|
32
|
+
elsif options.is_a?(String)
|
33
|
+
headers[:params]['name'] = options
|
34
|
+
end
|
35
|
+
execute(method: :get, url: url, headers: headers)
|
36
|
+
end
|
28
37
|
|
29
|
-
|
30
|
-
|
31
|
-
|
38
|
+
def get_version(deployment_id,version_id)
|
39
|
+
url = "#{@base_url}/api/deployments/#{deployment_id}/versions/#{version_id}"
|
40
|
+
headers = { params: {}, authorization: "Bearer #{@access_token}" }
|
41
|
+
execute(method: :get, url: url, headers: headers)
|
42
|
+
end
|
32
43
|
|
33
|
-
if options.is_a?(Hash)
|
34
|
-
headers[:params].merge!(options)
|
35
|
-
elsif options.is_a?(Numeric)
|
36
|
-
url = "#{@base_url}/api/deployments/#{deployment_id}/versions/#{options}"
|
37
|
-
elsif options.is_a?(String)
|
38
|
-
headers[:params]['name'] = options
|
39
|
-
end
|
40
|
-
response = Morpheus::RestClient.execute(method: :get, url: url,
|
41
|
-
timeout: 30, headers: headers, verify_ssl:false)
|
42
|
-
JSON.parse(response.to_s)
|
43
|
-
end
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
def create(options)
|
46
|
+
url = "#{@base_url}/api/deployments"
|
47
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
48
|
+
payload = options
|
49
|
+
execute(method: :post, url: url, headers: headers, payload: payload.to_json)
|
50
|
+
end
|
48
51
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
52
|
+
def update(id, options)
|
53
|
+
url = "#{@base_url}/api/deployments/#{id}"
|
54
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
55
|
+
payload = options
|
56
|
+
execute(method: :put, url: url, headers: headers, payload: payload.to_json)
|
57
|
+
end
|
53
58
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
payload = options
|
60
|
-
response = Morpheus::RestClient.execute(method: :post, url: url,
|
61
|
-
timeout: 30, headers: headers, verify_ssl:false, payload: payload.to_json)
|
62
|
-
JSON.parse(response.to_s)
|
63
|
-
end
|
64
|
-
|
65
|
-
def update(id, options)
|
66
|
-
url = "#{@base_url}/api/deployments/#{id}"
|
67
|
-
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
68
|
-
|
69
|
-
payload = options
|
70
|
-
response = Morpheus::RestClient.execute(method: :put, url: url,
|
71
|
-
timeout: 10, headers: headers, payload: payload.to_json)
|
72
|
-
JSON.parse(response.to_s)
|
73
|
-
end
|
74
|
-
|
75
|
-
def destroy(id)
|
76
|
-
url = "#{@base_url}/api/deployments/#{id}"
|
77
|
-
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
78
|
-
response = Morpheus::RestClient.execute(method: :delete, url: url,
|
79
|
-
timeout: 30, headers: headers, verify_ssl:false)
|
80
|
-
JSON.parse(response.to_s)
|
81
|
-
end
|
59
|
+
def destroy(id)
|
60
|
+
url = "#{@base_url}/api/deployments/#{id}"
|
61
|
+
headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
|
62
|
+
execute(method: :delete, url: url, headers: headers)
|
63
|
+
end
|
82
64
|
end
|