class Tutum
Constants
- VERSION
Attributes
api_key[R]
tutum_auth[R]
username[R]
Public Class Methods
new(*options)
click to toggle source
# File lib/tutum.rb, line 16 def initialize(*options) @options = extract_options! options @username = @options[:username] @api_key = @options[:api_key] @tutum_auth = @options[:tutum_auth] end
Public Instance Methods
actions()
click to toggle source
# File lib/tutum.rb, line 31 def actions @actions ||= TutumActions.new(headers) end
containers()
click to toggle source
# File lib/tutum.rb, line 35 def containers @containers ||= TutumContainers.new(headers) end
headers()
click to toggle source
# 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()
click to toggle source
# File lib/tutum.rb, line 39 def images @images ||= TutumImages.new(headers) end
node_clusters()
click to toggle source
# File lib/tutum.rb, line 43 def node_clusters @node_clusters ||= TutumNodeClusters.new(headers) end
node_types()
click to toggle source
# File lib/tutum.rb, line 47 def node_types @node_types ||= TutumNodeTypes.new(headers) end
nodes()
click to toggle source
# File lib/tutum.rb, line 51 def nodes @nodes ||= TutumNodes.new(headers) end
providers()
click to toggle source
# File lib/tutum.rb, line 55 def providers @providers ||= TutumProviders.new(headers) end
regions()
click to toggle source
# File lib/tutum.rb, line 59 def regions @regions ||= TutumRegions.new(headers) end
services()
click to toggle source
# File lib/tutum.rb, line 63 def services @services ||= TutumServices.new(headers) end
stacks()
click to toggle source
# File lib/tutum.rb, line 67 def stacks @stacks ||= TutumStacks.new(headers) end
Private Instance Methods
extract_options!(args)
click to toggle source
# File lib/tutum.rb, line 73 def extract_options!(args) options = {} if args[0].class == String options[:username] = args[0] options[:api_key] = args[1] else options = args[0] end options end