Class: Morpheus::ClustersInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::ClustersInterface
- Defined in:
- lib/morpheus/api/clusters_interface.rb
Instance Method Summary collapse
- #add_server(id, payload) ⇒ Object
- #api_config(id, params = {}) ⇒ Object
- #apply_template(id, payload = {}) ⇒ Object
- #available_updates(id, params = {}) ⇒ Object
- #base_path ⇒ Object
- #can_use_kubevip(payload) ⇒ Object
- #cluster_types(params = {}) ⇒ Object
- #create(payload) ⇒ Object
- #create_affinity_group(id, payload) ⇒ Object
- #create_datastore(id, payload) ⇒ Object
- #create_namespace(id, payload) ⇒ Object
- #destroy(id, params = {}) ⇒ Object (also: #delete)
- #destroy_affinity_group(id, affinity_group_id, params = {}) ⇒ Object
- #destroy_container(id, container_id, params = {}) ⇒ Object
- #destroy_container_group(id, container_group_id, resource_type, params = {}) ⇒ Object
- #destroy_datastore(id, datastore_id, params = {}) ⇒ Object
- #destroy_job(id, job_id = nil, params = {}, payload = {}) ⇒ Object
- #destroy_namespace(id, namespace_id, params = {}) ⇒ Object (also: #delete_namespace)
-
#destroy_service(id, service_id = nil, params = {}, payload = {}) ⇒ Object
this supports multiple ids.
-
#destroy_volume(id, volume_id = nil, params = {}, payload = {}) ⇒ Object
(also: #delete_volume)
this supports multiple ids.
- #destroy_worker(id, worker_id, params = {}) ⇒ Object
- #do_cluster_upgrade(id, params = {}) ⇒ Object
- #execute_update(id, payload) ⇒ Object
- #get(params = {}) ⇒ Object
- #get_affinity_group(id, affinity_group_id, params = {}) ⇒ Object
- #get_container_group(cluster_id, resource_type, id, params = {}) ⇒ Object
- #get_datastore(id, datastore_id, params = {}) ⇒ Object
- #get_namespace(id, namespace_id, params = {}) ⇒ Object
- #get_update(id, update_id, params = {}) ⇒ Object
- #get_upgrade_versions(id, params = {}) ⇒ Object
- #history(id, params = {}) ⇒ Object
- #history_details(id, process_id, params = {}) ⇒ Object
- #history_event_details(id, process_event_id, params = {}) ⇒ Object
- #list(params = {}) ⇒ Object
- #list_affinity_groups(id, params = {}) ⇒ Object
- #list_container_groups(id, resource_type, params = {}) ⇒ Object
- #list_containers(id, params = {}) ⇒ Object
- #list_datastores(id, params = {}) ⇒ Object
- #list_jobs(id, params = {}) ⇒ Object
- #list_masters(id, params = {}) ⇒ Object
- #list_namespaces(id, params = {}) ⇒ Object
- #list_resources(id, resources, params = {}) ⇒ Object
- #list_services(id, params = {}) ⇒ Object
- #list_updates(id, update_id, params = {}) ⇒ Object
- #list_volumes(id, params = {}) ⇒ Object
- #list_workers(id, params = {}) ⇒ Object
- #load_balancer_port(params = {}) ⇒ Object
- #refresh(id) ⇒ Object
- #restart_container(id, container_id, params = {}) ⇒ Object
- #restart_container_group(id, container_group_id, resource_type, params = {}) ⇒ Object
- #update(id, payload) ⇒ Object
- #update_affinity_group(id, affinity_group_id, payload) ⇒ Object
- #update_datastore(id, datastore_id, payload) ⇒ Object
- #update_namespace(id, namespace_id, payload) ⇒ Object
- #update_permissions(id, payload) ⇒ Object
- #update_wiki(id, payload) ⇒ Object
- #update_worker_count(id, params = {}) ⇒ Object
- #wiki(id, params) ⇒ Object
Instance Method Details
#add_server(id, payload) ⇒ Object
139 140 141 142 143 |
# File 'lib/morpheus/api/clusters_interface.rb', line 139 def add_server(id, payload) url = "#{base_path}/#{id}/servers" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#api_config(id, params = {}) ⇒ Object
300 301 302 303 304 |
# File 'lib/morpheus/api/clusters_interface.rb', line 300 def api_config(id, params={}) url = "#{base_path}/#{id}/api-config" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#apply_template(id, payload = {}) ⇒ Object
328 329 330 331 332 333 |
# File 'lib/morpheus/api/clusters_interface.rb', line 328 def apply_template(id, payload={}) url = "#{@base_url}/api/clusters/#{id}/apply-template" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#available_updates(id, params = {}) ⇒ Object
393 394 395 396 397 |
# File 'lib/morpheus/api/clusters_interface.rb', line 393 def available_updates(id, params={}) url = "#{base_path}/#{id}/available-updates" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#base_path ⇒ Object
5 6 7 |
# File 'lib/morpheus/api/clusters_interface.rb', line 5 def base_path "/api/clusters" end |
#can_use_kubevip(payload) ⇒ Object
342 343 344 345 346 347 |
# File 'lib/morpheus/api/clusters_interface.rb', line 342 def can_use_kubevip(payload) url = "#{@base_url}/api/clusters/can-use-kubevip" payload["requestSourceType"] = "api" headers = { authorization: "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :get, url: url, headers: headers, payload: payload.to_json) end |
#cluster_types(params = {}) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/morpheus/api/clusters_interface.rb', line 49 def cluster_types(params={}) url = "#{@base_url}/api/cluster-types" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#create(payload) ⇒ Object
29 30 31 32 33 |
# File 'lib/morpheus/api/clusters_interface.rb', line 29 def create(payload) url = base_path headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#create_affinity_group(id, payload) ⇒ Object
375 376 377 378 379 |
# File 'lib/morpheus/api/clusters_interface.rb', line 375 def create_affinity_group(id, payload) url = "#{base_path}/#{id}/affinity-groups" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#create_datastore(id, payload) ⇒ Object
268 269 270 271 272 |
# File 'lib/morpheus/api/clusters_interface.rb', line 268 def create_datastore(id, payload) url = "#{base_path}/#{id}/data-stores" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#create_namespace(id, payload) ⇒ Object
180 181 182 183 184 |
# File 'lib/morpheus/api/clusters_interface.rb', line 180 def create_namespace(id, payload) url = "#{base_path}/#{id}/namespaces" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#destroy(id, params = {}) ⇒ Object Also known as: delete
41 42 43 44 45 |
# File 'lib/morpheus/api/clusters_interface.rb', line 41 def destroy(id, params={}) url = "#{base_path}/#{id}" headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers) end |
#destroy_affinity_group(id, affinity_group_id, params = {}) ⇒ Object
387 388 389 390 391 |
# File 'lib/morpheus/api/clusters_interface.rb', line 387 def destroy_affinity_group(id, affinity_group_id, params={}) url = "#{base_path}/#{id}/affinity-groups/#{affinity_group_id}" headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers) end |
#destroy_container(id, container_id, params = {}) ⇒ Object
212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/morpheus/api/clusters_interface.rb', line 212 def destroy_container(id, container_id, params={}) if container_id.is_a?(Array) url = "#{base_path}/#{id}/containers" params['containerId'] = container_id elsif container_id.is_a?(Numeric) || container_id.is_a?(String) url = "#{base_path}/#{id}/containers/#{container_id}" else raise "passed a bad container_id: #{container_id || '(none)'}" # lazy end headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :delete, url: url, headers: headers) end |
#destroy_container_group(id, container_group_id, resource_type, params = {}) ⇒ Object
243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/morpheus/api/clusters_interface.rb', line 243 def destroy_container_group(id, container_group_id, resource_type, params={}) if container_group_id.is_a?(Array) url = "#{base_path}/#{id}/#{resource_type}s" params['containerGroupId'] = container_group_id elsif container_group_id.is_a?(Numeric) || container_group_id.is_a?(String) url = "#{base_path}/#{id}/#{resource_type}s/#{container_group_id}" else raise "passed a bad container_group_id: #{container_group_id || '(none)'}" # lazy end headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :delete, url: url, headers: headers) end |
#destroy_datastore(id, datastore_id, params = {}) ⇒ Object
280 281 282 283 284 |
# File 'lib/morpheus/api/clusters_interface.rb', line 280 def destroy_datastore(id, datastore_id, params={}) url = "#{base_path}/#{id}/datastores/#{datastore_id}" headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers) end |
#destroy_job(id, job_id = nil, params = {}, payload = {}) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/morpheus/api/clusters_interface.rb', line 68 def destroy_job(id, job_id=nil, params={}, payload={}) url = nil if job_id.is_a?(Array) url = "#{base_path}/#{id}/jobs" params['jobId'] = job_id elsif job_id.is_a?(Numeric) || job_id.is_a?(String) url = "#{base_path}/#{id}/jobs/#{job_id}" else raise "passed a bad volume_id: #{job_id || '(none)'}" # lazy end headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers, payload: payload.to_json) end |
#destroy_namespace(id, namespace_id, params = {}) ⇒ Object Also known as: delete_namespace
192 193 194 195 196 |
# File 'lib/morpheus/api/clusters_interface.rb', line 192 def destroy_namespace(id, namespace_id, params={}) url = "#{base_path}/#{id}/namespaces/#{namespace_id}" headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers) end |
#destroy_service(id, service_id = nil, params = {}, payload = {}) ⇒ Object
this supports multiple ids
125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/morpheus/api/clusters_interface.rb', line 125 def destroy_service(id, service_id=nil, params={}, payload={}) url = nil if service_id.is_a?(Array) url = "#{base_path}/#{id}/services" params['serviceId'] = service_id elsif service_id.is_a?(Numeric) || service_id.is_a?(String) url = "#{base_path}/#{id}/services/#{service_id}" else raise "passed a bad volume_id: #{service_id || '(none)'}" # lazy end headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers, payload: payload.to_json) end |
#destroy_volume(id, volume_id = nil, params = {}, payload = {}) ⇒ Object Also known as: delete_volume
this supports multiple ids
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/morpheus/api/clusters_interface.rb', line 152 def destroy_volume(id, volume_id=nil, params={}, payload={}) url = nil if volume_id.is_a?(Array) url = "#{base_path}/#{id}/volumes" params['volumeId'] = volume_id elsif volume_id.is_a?(Numeric) || volume_id.is_a?(String) url = "#{base_path}/#{id}/volumes/#{volume_id}" else raise "passed a bad volume_id: #{volume_id || '(none)'}" # lazy end headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers, payload: payload.to_json) end |
#destroy_worker(id, worker_id, params = {}) ⇒ Object
94 95 96 97 98 |
# File 'lib/morpheus/api/clusters_interface.rb', line 94 def destroy_worker(id, worker_id, params={}) url = "#{base_path}/#{id}/servers/#{worker_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :delete, url: url, headers: headers) end |
#do_cluster_upgrade(id, params = {}) ⇒ Object
112 113 114 115 116 |
# File 'lib/morpheus/api/clusters_interface.rb', line 112 def do_cluster_upgrade(id, params={}) url = "#{base_path}/#{id}/upgrade-cluster" headers = { params: params, authorization: "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers) end |
#execute_update(id, payload) ⇒ Object
411 412 413 414 415 |
# File 'lib/morpheus/api/clusters_interface.rb', line 411 def execute_update(id, payload) url = "#{base_path}/#{id}/execute-update" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :post, url: url, headers: headers, payload: payload.to_json) end |
#get(params = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/morpheus/api/clusters_interface.rb', line 15 def get(params={}) url = base_path headers = { params: {}, authorization: "Bearer #{@access_token}" } if params.is_a?(Hash) headers[:params].merge!(params) elsif params.is_a?(Numeric) url = "#{base_path}/#{params}" elsif params.is_a?(String) headers[:params]['name'] = params end execute(method: :get, url: url, headers: headers) end |
#get_affinity_group(id, affinity_group_id, params = {}) ⇒ Object
369 370 371 372 373 |
# File 'lib/morpheus/api/clusters_interface.rb', line 369 def get_affinity_group(id, affinity_group_id, params={}) url = "#{base_path}/#{id}/affinity-groups/#{affinity_group_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#get_container_group(cluster_id, resource_type, id, params = {}) ⇒ Object
231 232 233 234 235 |
# File 'lib/morpheus/api/clusters_interface.rb', line 231 def get_container_group(cluster_id, resource_type, id, params={}) url = "#{base_path}/#{cluster_id}/#{resource_type}s/#{id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#get_datastore(id, datastore_id, params = {}) ⇒ Object
262 263 264 265 266 |
# File 'lib/morpheus/api/clusters_interface.rb', line 262 def get_datastore(id, datastore_id, params={}) url = "#{base_path}/#{id}/datastores/#{datastore_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#get_namespace(id, namespace_id, params = {}) ⇒ Object
174 175 176 177 178 |
# File 'lib/morpheus/api/clusters_interface.rb', line 174 def get_namespace(id, namespace_id, params={}) url = "#{base_path}/#{id}/namespaces/#{namespace_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#get_update(id, update_id, params = {}) ⇒ Object
405 406 407 408 409 |
# File 'lib/morpheus/api/clusters_interface.rb', line 405 def get_update(id, update_id, params={}) url = "#{base_path}/#{id}/available-updates/#{update_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#get_upgrade_versions(id, params = {}) ⇒ Object
106 107 108 109 110 |
# File 'lib/morpheus/api/clusters_interface.rb', line 106 def get_upgrade_versions(id, params={}) url = "#{base_path}/#{id}/upgrade-cluster" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#history(id, params = {}) ⇒ Object
306 307 308 309 310 311 |
# File 'lib/morpheus/api/clusters_interface.rb', line 306 def history(id, params={}) url = "#{@base_url}/api/clusters/#{id}/history" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#history_details(id, process_id, params = {}) ⇒ Object
313 314 315 316 317 318 |
# File 'lib/morpheus/api/clusters_interface.rb', line 313 def history_details(id, process_id, params={}) url = "#{@base_url}/api/clusters/#{id}/history/#{process_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#history_event_details(id, process_event_id, params = {}) ⇒ Object
320 321 322 323 324 325 |
# File 'lib/morpheus/api/clusters_interface.rb', line 320 def history_event_details(id, process_event_id, params={}) url = "#{@base_url}/api/clusters/#{id}/history/events/#{process_event_id}" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#list(params = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/morpheus/api/clusters_interface.rb', line 9 def list(params={}) url = base_path headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_affinity_groups(id, params = {}) ⇒ Object
363 364 365 366 367 |
# File 'lib/morpheus/api/clusters_interface.rb', line 363 def list_affinity_groups(id, params={}) url = "#{base_path}/#{id}/affinity-groups" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_container_groups(id, resource_type, params = {}) ⇒ Object
225 226 227 228 229 |
# File 'lib/morpheus/api/clusters_interface.rb', line 225 def list_container_groups(id, resource_type, params={}) url = "#{base_path}/#{id}/#{resource_type}s" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_containers(id, params = {}) ⇒ Object
200 201 202 203 204 |
# File 'lib/morpheus/api/clusters_interface.rb', line 200 def list_containers(id, params={}) url = "#{base_path}/#{id}/containers" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_datastores(id, params = {}) ⇒ Object
256 257 258 259 260 |
# File 'lib/morpheus/api/clusters_interface.rb', line 256 def list_datastores(id, params={}) url = "#{base_path}/#{id}/datastores" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_jobs(id, params = {}) ⇒ Object
62 63 64 65 66 |
# File 'lib/morpheus/api/clusters_interface.rb', line 62 def list_jobs(id, params={}) url = "#{base_path}/#{id}/jobs" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_masters(id, params = {}) ⇒ Object
82 83 84 85 86 |
# File 'lib/morpheus/api/clusters_interface.rb', line 82 def list_masters(id, params={}) url = "#{base_path}/#{id}/masters" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_namespaces(id, params = {}) ⇒ Object
168 169 170 171 172 |
# File 'lib/morpheus/api/clusters_interface.rb', line 168 def list_namespaces(id, params={}) url = "#{base_path}/#{id}/namespaces" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_resources(id, resources, params = {}) ⇒ Object
349 350 351 352 353 |
# File 'lib/morpheus/api/clusters_interface.rb', line 349 def list_resources(id, resources, params={}) url = "#{base_path}/#{id}/#{resources}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_services(id, params = {}) ⇒ Object
118 119 120 121 122 |
# File 'lib/morpheus/api/clusters_interface.rb', line 118 def list_services(id, params={}) url = "#{base_path}/#{id}/services" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_updates(id, update_id, params = {}) ⇒ Object
399 400 401 402 403 |
# File 'lib/morpheus/api/clusters_interface.rb', line 399 def list_updates(id, update_id, params={}) url = "#{base_path}/#{id}/available-updates" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_volumes(id, params = {}) ⇒ Object
145 146 147 148 149 |
# File 'lib/morpheus/api/clusters_interface.rb', line 145 def list_volumes(id, params={}) url = "#{base_path}/#{id}/volumes" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list_workers(id, params = {}) ⇒ Object
88 89 90 91 92 |
# File 'lib/morpheus/api/clusters_interface.rb', line 88 def list_workers(id, params={}) url = "#{base_path}/#{id}/workers" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#load_balancer_port(params = {}) ⇒ Object
355 356 357 358 359 360 361 |
# File 'lib/morpheus/api/clusters_interface.rb', line 355 def load_balancer_port(params={}) url = "#{@base_url}/api/clusters/load-balancer-port" headers = { params: {}, authorization: "Bearer #{@access_token}" } headers[:params].merge!(params) execute(method: :get, url: url, headers: headers) end |
#refresh(id) ⇒ Object
335 336 337 338 339 340 |
# File 'lib/morpheus/api/clusters_interface.rb', line 335 def refresh(id) url = "#{@base_url}/api/clusters/#{id}/refresh" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :get, url: url, headers: headers} execute(opts) end |
#restart_container(id, container_id, params = {}) ⇒ Object
206 207 208 209 210 |
# File 'lib/morpheus/api/clusters_interface.rb', line 206 def restart_container(id, container_id, params={}) url = "#{base_path}/#{id}/containers/#{container_id}/restart" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :put, url: url, headers: headers) end |
#restart_container_group(id, container_group_id, resource_type, params = {}) ⇒ Object
237 238 239 240 241 |
# File 'lib/morpheus/api/clusters_interface.rb', line 237 def restart_container_group(id, container_group_id, resource_type, params={}) url = "#{base_path}/#{id}/#{resource_type}s/#{container_group_id}/restart" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :put, url: url, headers: headers) end |
#update(id, payload) ⇒ Object
35 36 37 38 39 |
# File 'lib/morpheus/api/clusters_interface.rb', line 35 def update(id, payload) url = "#{base_path}/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :put, url: url, headers: headers, payload: payload.to_json) end |
#update_affinity_group(id, affinity_group_id, payload) ⇒ Object
381 382 383 384 385 |
# File 'lib/morpheus/api/clusters_interface.rb', line 381 def update_affinity_group(id, affinity_group_id, payload) url = "#{base_path}/#{id}/affinity-groups/#{affinity_group_id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :put, url: url, headers: headers, payload: payload.to_json) end |
#update_datastore(id, datastore_id, payload) ⇒ Object
274 275 276 277 278 |
# File 'lib/morpheus/api/clusters_interface.rb', line 274 def update_datastore(id, datastore_id, payload) url = "#{base_path}/#{id}/datastores/#{datastore_id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :put, url: url, headers: headers, payload: payload.to_json) end |
#update_namespace(id, namespace_id, payload) ⇒ Object
186 187 188 189 190 |
# File 'lib/morpheus/api/clusters_interface.rb', line 186 def update_namespace(id, namespace_id, payload) url = "#{base_path}/#{id}/namespaces/#{namespace_id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :put, url: url, headers: headers, payload: payload.to_json) end |
#update_permissions(id, payload) ⇒ Object
56 57 58 59 60 |
# File 'lib/morpheus/api/clusters_interface.rb', line 56 def (id, payload) url = "#{base_path}/#{id}/permissions" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :put, url: url, headers: headers, payload: payload.to_json) end |
#update_wiki(id, payload) ⇒ Object
293 294 295 296 297 298 |
# File 'lib/morpheus/api/clusters_interface.rb', line 293 def update_wiki(id, payload) url = "#{@base_url}/api/clusters/#{id}/wiki" headers = {authorization: "Bearer #{@access_token}", 'Content-Type' => 'application/json' } opts = {method: :put, url: url, headers: headers, payload: payload.to_json} execute(opts) end |
#update_worker_count(id, params = {}) ⇒ Object
100 101 102 103 104 |
# File 'lib/morpheus/api/clusters_interface.rb', line 100 def update_worker_count(id, params={}) url = "#{base_path}/#{id}/worker-count" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :put, url: url, headers: headers) end |
#wiki(id, params) ⇒ Object
286 287 288 289 290 291 |
# File 'lib/morpheus/api/clusters_interface.rb', line 286 def wiki(id, params) url = "#{@base_url}/api/clusters/#{id}/wiki" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end |