class Morpheus::TaskSetsInterface
Public Instance Methods
Source
# File lib/morpheus/api/task_sets_interface.rb, line 25 def create(options) url = "#{@base_url}/api/task-sets" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = options execute(method: :post, url: url, headers: headers, payload: payload.to_json) end
Source
# File lib/morpheus/api/task_sets_interface.rb, line 39 def destroy(id) url = "#{@base_url}/api/task-sets/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :delete, url: url, headers: headers) end
Source
# File lib/morpheus/api/task_sets_interface.rb, line 12 def get(options=nil) url = "#{@base_url}/api/task-sets" headers = { params: {}, authorization: "Bearer #{@access_token}" } if options.is_a?(Hash) headers[:params].merge!(options) elsif options.is_a?(Numeric) url = "#{@base_url}/api/task-sets/#{options}" elsif options.is_a?(String) headers[:params]['name'] = options end execute(method: :get, url: url, headers: headers) end
Source
# File lib/morpheus/api/task_sets_interface.rb, line 5 def list(params={}) url = "#{@base_url}/api/task-sets" headers = { params: params, authorization: "Bearer #{@access_token}" } opts = {method: :get, url: url, headers: headers} execute(opts) end
Source
# File lib/morpheus/api/task_sets_interface.rb, line 45 def run(id, options) url = "#{@base_url}/api/task-sets/#{id}/execute" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = options execute(method: :post, url: url, headers: headers, payload: payload.to_json) end
Source
# File lib/morpheus/api/task_sets_interface.rb, line 32 def update(id, options) url = "#{@base_url}/api/task-sets/#{id}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } payload = options execute(method: :put, url: url, headers: headers, payload: payload.to_json) end