Class: Tutum
- Inherits:
-
Object
- Object
- Tutum
- Defined in:
- lib/tutum.rb,
lib/version.rb
Constant Summary collapse
- VERSION =
"0.2.7"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#tutum_auth ⇒ Object
readonly
Returns the value of attribute tutum_auth.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #actions ⇒ Object
- #containers ⇒ Object
- #headers ⇒ Object
- #images ⇒ Object
-
#initialize(*options) ⇒ Tutum
constructor
A new instance of Tutum.
- #node_clusters ⇒ Object
- #node_types ⇒ Object
- #nodes ⇒ Object
- #providers ⇒ Object
- #regions ⇒ Object
- #services ⇒ Object
- #stacks ⇒ Object
Constructor Details
#initialize(*options) ⇒ Tutum
Returns a new instance of Tutum.
16 17 18 19 20 21 |
# File 'lib/tutum.rb', line 16 def initialize(*) @options = @username = @options[:username] @api_key = @options[:api_key] @tutum_auth = @options[:tutum_auth] 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 |
#tutum_auth ⇒ Object (readonly)
Returns the value of attribute tutum_auth.
14 15 16 |
# File 'lib/tutum.rb', line 14 def tutum_auth @tutum_auth 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
31 32 33 |
# File 'lib/tutum.rb', line 31 def actions @actions ||= TutumActions.new(headers) end |
#containers ⇒ Object
35 36 37 |
# File 'lib/tutum.rb', line 35 def containers @containers ||= TutumContainers.new(headers) end |
#headers ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/tutum.rb', line 23 def headers { 'Authorization' => @tutum_auth ? @tutum_auth : "ApiKey #{@username}:#{@api_key}", 'Accept' => 'application/json', 'Content-Type' => 'application/json' } end |
#images ⇒ Object
39 40 41 |
# File 'lib/tutum.rb', line 39 def images @images ||= TutumImages.new(headers) end |
#node_clusters ⇒ Object
43 44 45 |
# File 'lib/tutum.rb', line 43 def node_clusters @node_clusters ||= TutumNodeClusters.new(headers) end |
#node_types ⇒ Object
47 48 49 |
# File 'lib/tutum.rb', line 47 def node_types @node_types ||= TutumNodeTypes.new(headers) end |
#nodes ⇒ Object
51 52 53 |
# File 'lib/tutum.rb', line 51 def nodes @nodes ||= TutumNodes.new(headers) end |
#providers ⇒ Object
55 56 57 |
# File 'lib/tutum.rb', line 55 def providers @providers ||= TutumProviders.new(headers) end |
#regions ⇒ Object
59 60 61 |
# File 'lib/tutum.rb', line 59 def regions @regions ||= TutumRegions.new(headers) end |
#services ⇒ Object
63 64 65 |
# File 'lib/tutum.rb', line 63 def services @services ||= TutumServices.new(headers) end |
#stacks ⇒ Object
67 68 69 |
# File 'lib/tutum.rb', line 67 def stacks @stacks ||= TutumStacks.new(headers) end |