Class: Tutum

Inherits:
Object
  • Object
show all
Defined in:
lib/tutum.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject (readonly)

Returns the value of attribute api_key.



13
14
15
# File 'lib/tutum.rb', line 13

def api_key
  @api_key
end

#usernameObject (readonly)

Returns the value of attribute username.



13
14
15
# File 'lib/tutum.rb', line 13

def username
  @username
end

Instance Method Details

#actionsObject



28
29
30
# File 'lib/tutum.rb', line 28

def actions
  @actions ||= TutumContainers.new(headers)
end

#containersObject



32
33
34
# File 'lib/tutum.rb', line 32

def containers
  @containers ||= TutumContainers.new(headers)
end

#headersObject



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

#imagesObject



36
37
38
# File 'lib/tutum.rb', line 36

def images
  @images ||= TutumImages.new(headers)
end

#node_clustersObject



40
41
42
# File 'lib/tutum.rb', line 40

def node_clusters
  @node_clusters ||= TutumNodeClusters.new(headers)
end

#node_typesObject



44
45
46
# File 'lib/tutum.rb', line 44

def node_types
  @node_types ||= TutumNodeTypes.new(headers)
end

#nodesObject



48
49
50
# File 'lib/tutum.rb', line 48

def nodes
  @nodes ||= TutumNodes.new(headers)
end

#providersObject



52
53
54
# File 'lib/tutum.rb', line 52

def providers
  @providers ||= TutumProviders.new(headers)
end

#servicesObject



56
57
58
# File 'lib/tutum.rb', line 56

def services
  @services ||= TutumServices.new(headers)
end