Class: Morpheus::InstanceTypesInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::InstanceTypesInterface
- Defined in:
- lib/morpheus/api/instance_types_interface.rb
Instance Method Summary collapse
- #get(options = nil) ⇒ Object
-
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ InstanceTypesInterface
constructor
A new instance of InstanceTypesInterface.
Constructor Details
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ InstanceTypesInterface
Returns a new instance of InstanceTypesInterface.
4 5 6 7 8 9 |
# File 'lib/morpheus/api/instance_types_interface.rb', line 4 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 |
# File 'lib/morpheus/api/instance_types_interface.rb', line 12 def get(=nil) url = "#{@base_url}/api/instance-types" headers = { params: {}, authorization: "Bearer #{@access_token}" } if .is_a?(Hash) headers[:params].merge!() elsif .is_a?(Numeric) url = "#{@base_url}/api/instance-types/#{options}" elsif .is_a?(String) headers[:params]['name'] = end execute(method: :get, url: url, headers: headers) end |