Class: Tutum
- Inherits:
-
Object
- Object
- Tutum
- Defined in:
- lib/tutum.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #actions ⇒ Object
- #containers ⇒ Object
- #headers ⇒ Object
- #images ⇒ Object
-
#initialize(username, api_key) ⇒ Tutum
constructor
A new instance of Tutum.
- #node_clusters ⇒ Object
- #node_types ⇒ Object
- #nodes ⇒ Object
- #providers ⇒ Object
- #services ⇒ Object
Constructor Details
#initialize(username, api_key) ⇒ Tutum
Returns a new instance of Tutum.
16 17 18 19 |
# File 'lib/tutum.rb', line 16 def initialize(username, api_key) @username = username @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
14 15 16 |
# File 'lib/tutum.rb', line 14 def api_key @api_key end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
14 15 16 |
# File 'lib/tutum.rb', line 14 def username @username end |
Instance Method Details
#actions ⇒ Object
29 30 31 |
# File 'lib/tutum.rb', line 29 def actions @actions ||= TutumContainers.new(headers) end |
#containers ⇒ Object
33 34 35 |
# File 'lib/tutum.rb', line 33 def containers @containers ||= TutumContainers.new(headers) end |
#headers ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/tutum.rb', line 21 def headers { 'Authorization' => "ApiKey #{@username}:#{@api_key}", 'Accept' => 'application/json', 'Content-Type' => 'application/json' } end |
#images ⇒ Object
37 38 39 |
# File 'lib/tutum.rb', line 37 def images @images ||= TutumImages.new(headers) end |
#node_clusters ⇒ Object
41 42 43 |
# File 'lib/tutum.rb', line 41 def node_clusters @node_clusters ||= TutumNodeClusters.new(headers) end |
#node_types ⇒ Object
45 46 47 |
# File 'lib/tutum.rb', line 45 def node_types @node_types ||= TutumNodeTypes.new(headers) end |
#nodes ⇒ Object
49 50 51 |
# File 'lib/tutum.rb', line 49 def nodes @nodes ||= TutumNodes.new(headers) end |
#providers ⇒ Object
53 54 55 |
# File 'lib/tutum.rb', line 53 def providers @providers ||= TutumProviders.new(headers) end |
#services ⇒ Object
57 58 59 |
# File 'lib/tutum.rb', line 57 def services @services ||= TutumServices.new(headers) end |