Class: Cloudkick::Node

Inherits:
Base
  • Object
show all
Defined in:
lib/cloudkick/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#access_token, #consumer, #get

Constructor Details

#initialize(agent_state, color, id, ipaddress, name, provider_id, provider_name, status, tags) ⇒ Node

Returns a new instance of Node.



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cloudkick/node.rb', line 23

def initialize(agent_state, color, id, ipaddress, name,
               provider_id, provider_name, status, tags)
  @agent_state = agent_state
  @color = color
  @id = id
  @ipaddress = ipaddress
  @name = name
  @provider_id = provider_id
  @provider_name = provider_name
  @status = status
  @tags = tags
end

Instance Attribute Details

#agent_stateObject (readonly)

Returns the value of attribute agent_state.



20
21
22
# File 'lib/cloudkick/node.rb', line 20

def agent_state
  @agent_state
end

#colorObject (readonly)

Returns the value of attribute color.



20
21
22
# File 'lib/cloudkick/node.rb', line 20

def color
  @color
end

#idObject (readonly)

Returns the value of attribute id.



20
21
22
# File 'lib/cloudkick/node.rb', line 20

def id
  @id
end

#ipaddressObject (readonly)

Returns the value of attribute ipaddress.



20
21
22
# File 'lib/cloudkick/node.rb', line 20

def ipaddress
  @ipaddress
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/cloudkick/node.rb', line 20

def name
  @name
end

#provider_idObject (readonly)

Returns the value of attribute provider_id.



21
22
23
# File 'lib/cloudkick/node.rb', line 21

def provider_id
  @provider_id
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



21
22
23
# File 'lib/cloudkick/node.rb', line 21

def provider_name
  @provider_name
end

#statusObject (readonly)

Returns the value of attribute status.



21
22
23
# File 'lib/cloudkick/node.rb', line 21

def status
  @status
end

#tagsObject (readonly)

Returns the value of attribute tags.



21
22
23
# File 'lib/cloudkick/node.rb', line 21

def tags
  @tags
end

Instance Method Details

#check(type = nil) ⇒ Object



36
37
38
39
40
# File 'lib/cloudkick/node.rb', line 36

def check(type=nil)
  resp, data = access_token.get("/1.0/query/node/#{@id}/check/#{type}")

  Crack::JSON.parse(data)
end