Class: Megam::ServerAPI
- Inherits:
-
Object
- Object
- Megam::ServerAPI
- Defined in:
- lib/megam/core/server_api.rb
Overview
Basic HTTP client, with support for adding features via middleware
Direct Known Subclasses
Account, AppRequest, Assemblies, Assembly, Availableunits, Balances, Billinghistories, Billings, CSAR, CloudToolSetting, Components, Credithistories, Discounts, Domains, Event, MarketPlace, MarketPlaceAddons, Organizations, PredefCloud, Request, SshKey, Subscriptions
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
-
#initialize(email = nil, api_key = nil) ⇒ ServerAPI
constructor
Create a Megam REST object.
-
#megam_rest ⇒ Object
Build a megam api client.
Constructor Details
#initialize(email = nil, api_key = nil) ⇒ ServerAPI
Create a Megam REST object. The supplied email and api_key is used as the base for all subsequent requests. For example, when initialized with an email, api_key url api.megam.co, a call to get
with ‘nodes’ will make an HTTP GET request to api.megam.co/nodes using the email, api_key
30 31 32 33 |
# File 'lib/megam/core/server_api.rb', line 30 def initialize(email=nil, api_key=nil) @email = email @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
23 24 25 |
# File 'lib/megam/core/server_api.rb', line 23 def api_key @api_key end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
22 23 24 |
# File 'lib/megam/core/server_api.rb', line 22 def email @email end |