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.
15 16 17 18 |
# File 'lib/tutum.rb', line 15 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.
13 14 15 |
# File 'lib/tutum.rb', line 13 def api_key @api_key end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
13 14 15 |
# File 'lib/tutum.rb', line 13 def username @username end |
Instance Method Details
#actions ⇒ Object
28 29 30 |
# File 'lib/tutum.rb', line 28 def actions @actions ||= TutumContainers.new(headers) end |
#containers ⇒ Object
32 33 34 |
# File 'lib/tutum.rb', line 32 def containers @containers ||= TutumContainers.new(headers) end |
#headers ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/tutum.rb', line 20 def headers { 'Authorization' => "ApiKey #{@username}:#{@api_key}", 'Accept' => 'application/json', 'Content-Type' => 'application/json' } end |
#images ⇒ Object
36 37 38 |
# File 'lib/tutum.rb', line 36 def images @images ||= TutumImages.new(headers) end |
#node_clusters ⇒ Object
40 41 42 |
# File 'lib/tutum.rb', line 40 def node_clusters @node_clusters ||= TutumNodeClusters.new(headers) end |
#node_types ⇒ Object
44 45 46 |
# File 'lib/tutum.rb', line 44 def node_types @node_types ||= TutumNodeTypes.new(headers) end |
#nodes ⇒ Object
48 49 50 |
# File 'lib/tutum.rb', line 48 def nodes @nodes ||= TutumNodes.new(headers) end |
#providers ⇒ Object
52 53 54 |
# File 'lib/tutum.rb', line 52 def providers @providers ||= TutumProviders.new(headers) end |
#services ⇒ Object
56 57 58 |
# File 'lib/tutum.rb', line 56 def services @services ||= TutumServices.new(headers) end |