Class: Morpheus::ProvisionTypesInterface
- Defined in:
- lib/morpheus/api/provision_types_interface.rb
Instance Method Summary collapse
- #get(options = nil) ⇒ Object
-
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ ProvisionTypesInterface
constructor
A new instance of ProvisionTypesInterface.
Methods inherited from APIClient
#accounts, #app_templates, #apps, #clouds, #deploy, #deployments, #groups, #instance_types, #instances, #key_pairs, #license, #load_balancers, #logs, #options, #provision_types, #roles, #security_group_rules, #security_groups, #servers, #task_sets, #tasks, #users, #virtual_images
Constructor Details
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ ProvisionTypesInterface
Returns a new instance of ProvisionTypesInterface.
5 6 7 8 9 10 |
# File 'lib/morpheus/api/provision_types_interface.rb', line 5 def initialize(access_token, refresh_token,expires_at = nil, base_url=nil) @access_token = access_token @refresh_token = refresh_token @base_url = base_url @expires_at = expires_at end |
Instance Method Details
#get(options = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/morpheus/api/provision_types_interface.rb', line 12 def get(=nil) url = "#{@base_url}/api/provision-types" headers = { params: {}, authorization: "Bearer #{@access_token}" } if .is_a?(Hash) headers[:params].merge!() elsif .is_a?(Numeric) url = "#{@base_url}/api/provision-types/#{}" elsif .is_a?(String) headers[:params]['name'] = end response = Morpheus::RestClient.execute(method: :get, url: url, timeout: 30, headers: headers, verify_ssl:false) JSON.parse(response.to_s) end |