Sha256: bcb177a5f6822cfade895fe3144bffb14103ff77d7ed9e63e5555d02492ffd2c

Contents?: true

Size: 1.26 KB

Versions: 21

Compression:

Stored size: 1.26 KB

Contents

# require all commands
Dir.glob(File.dirname(File.absolute_path(__FILE__)) + '/cloud66_agent/commands/*', &method(:require))

class Cloud66Agent
	def self.configure(server_uid, cloud)
		raise ArgumentError.new if server_uid.nil?		
		Cloud66::Commands::Configure.perform(server_uid, cloud)
	end

	def self.pulse
		Cloud66::Commands::Pulse.perform
	end

	def self.vitals
		Cloud66::Commands::Vitals.perform
	end

	def self.address
		Cloud66::Commands::Address.perform
	end

	def self.job_start(job_uid)
		raise ArgumentError.new if job_uid.nil?
		Cloud66::Commands::JobStart.perform(job_uid)
	end

	def self.job_end(job_uid, run_uid, run_status, run_time, results_file)
		raise ArgumentError.new if run_status.nil? || job_uid.nil? || run_uid.nil? || run_time.nil? || results_file.nil?
		Cloud66::Commands::JobEnd.perform(job_uid, run_uid, run_status, run_time, results_file)
	end

	def self.fail2ban(is_banned, ip_address, attack, port)
		raise ArgumentError.new if is_banned.nil? || ip_address.nil? || attack.nil? || port.nil?
		Cloud66::Commands::Fail2ban.perform(is_banned, ip_address, attack, port)
	end

	def self.send_message(key,options)
		raise ArgumentError.new if key.nil?  || (!options.nil? && !options.is_a?(Hash))
		Cloud66::Commands::SendMessage.perform(key,options)
	end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cloud66_agent-1.4.5 lib/cloud66_agent.rb
cloud66_agent-1.4.4 lib/cloud66_agent.rb
cloud66_agent-1.4.3 lib/cloud66_agent.rb
cloud66_agent-1.4.2 lib/cloud66_agent.rb
cloud66_agent-1.4.1 lib/cloud66_agent.rb
cloud66_agent-1.4.0 lib/cloud66_agent.rb
cloud66_agent-1.3.1 lib/cloud66_agent.rb
cloud66_agent-1.3.0 lib/cloud66_agent.rb
cloud66_agent-1.2.8 lib/cloud66_agent.rb
cloud66_agent-1.2.7 lib/cloud66_agent.rb
cloud66_agent-1.2.6 lib/cloud66_agent.rb
cloud66_agent-1.2.5 lib/cloud66_agent.rb
cloud66_agent-1.2.5.beta2 lib/cloud66_agent.rb
cloud66_agent-1.2.5.beta1 lib/cloud66_agent.rb
cloud66_agent-1.2.4 lib/cloud66_agent.rb
cloud66_agent-1.2.4.beta1 lib/cloud66_agent.rb
cloud66_agent-1.2.3 lib/cloud66_agent.rb
cloud66_agent-1.2.2 lib/cloud66_agent.rb
cloud66_agent-1.2.1 lib/cloud66_agent.rb
cloud66_agent-1.2.1.beta1 lib/cloud66_agent.rb