Module MCollective::RPC
In: lib/mcollective/audit/logfile.rb
lib/mcollective/rpc.rb
lib/mcollective/rpc/stats.rb
lib/mcollective/rpc/actionrunner.rb
lib/mcollective/rpc/reply.rb
lib/mcollective/rpc/progress.rb
lib/mcollective/rpc/helpers.rb
lib/mcollective/rpc/result.rb
lib/mcollective/rpc/client.rb
lib/mcollective/rpc/request.rb
lib/mcollective/rpc/audit.rb
lib/mcollective/rpc/agent.rb

Toolset to create a standard interface of client and agent using an RPC metaphor, standard compliant agents will make it easier to create generic clients like web interfaces etc

Methods

Classes and Modules

Class MCollective::RPC::ActionRunner
Class MCollective::RPC::Agent
Class MCollective::RPC::Audit
Class MCollective::RPC::Client
Class MCollective::RPC::Helpers
Class MCollective::RPC::Logfile
Class MCollective::RPC::Progress
Class MCollective::RPC::Reply
Class MCollective::RPC::Request
Class MCollective::RPC::Result
Class MCollective::RPC::Stats

Public Class methods

means for other classes to drop discovered hosts into this module its a bit hacky but needed so that the mixin methods like printrpcstats can easily get access to it without users having to pass it around in params.

means for other classes to drop stats into this module its a bit hacky but needed so that the mixin methods like printrpcstats can easily get access to it without users having to pass it around in params.

Public Instance methods

Wrapper for MCollective::Util.empty_filter? to make clients less fugly to write - ticket 18

Prints the result of an RPC call.

In the default quiet mode - no flattening or verbose - only results that produce an error will be printed

To get details of each result run with the -v command line option.

Prints stats, requires stats to be saved from elsewhere using the MCollective::RPC.stats method.

If you‘ve passed -v on the command line a detailed stat block will be printed, else just a one liner.

You can pass flags into it:

  printrpcstats :caption => "Foo", :summarize => true

This will use "Foo" as the caption to the stats in verbose mode and print out any aggregate summary information if present

Wrapper to create clients, supposed to be used as a mixin:

include MCollective::RPC

exim = rpcclient("exim") printrpc exim.mailq

or

rpcclient("exim") do |exim|

   printrpc exim.mailq

end

It will take a few flags:

   :configfile => "etc/client.cfg"
   :options => options
   :exit_on_failure => true

Options would be a build up options hash from the Optionparser you can use the rpcoptions helper to create this

:exit_on_failure is true by default, and causes the application to exit if there is a failure constructing the RPC client. Set this flag to false to cause an Exception to be raised instead.

Creates a standard options hash, pass in a block to add extra headings etc see Optionparser

[Validate]