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.



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

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#actionsObject



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

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

#containersObject



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

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

#headersObject



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

#imagesObject



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

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

#node_clustersObject



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

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

#node_typesObject



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

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

#nodesObject



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

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

#providersObject



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

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

#servicesObject



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

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