Permalink
Browse files

updated documentation code examples

  • Loading branch information...
1 parent fa5658e commit c301f16e107d79e838cdfae89e474ebe8505411b Mark Tran committed Apr 25, 2010
Showing with 8 additions and 8 deletions.
  1. +8 −8 doc/example.rb
View
@@ -1,22 +1,22 @@
require 'rubygems'
require 'cloudkick'
+# your OAuth consumer credentials.
+# https://support.cloudkick.com/API/Authentication#Generating_OAuth_Consumers
CONSUMER_KEY = 'ENTER_KEY'
CONSUMER_SECRET = 'ENTER_SECRET'
client = Cloudkick::Base.new(CONSUMER_KEY,
CONSUMER_SECRET)
-agent_nodes = client.get('nodes', 'tag:agent')
+# get all nodes and print name and status
nodes = client.get('nodes')
-
nodes.each do |node|
puts "#{node.name}: #{node.status}"
end
-# puts
-# puts nodes.pssh('hostname')
-
-# agent_nodes do |node|
-# puts node.check('mem')
-# end
+# get all nodes tagged "agent" and print memory information
+agent_nodes = client.get('nodes', 'tag:agent')
+agent_nodes do |node|
+ puts node.check('mem')
+end

0 comments on commit c301f16

Please sign in to comment.