Documentation ¶
Overview ¶
Package choria_utilclient is an API client to the Choria Choria_util agent Version 0.19.0.
Actions:
- Info - Choria related information from the running Daemon and Middleware
- MachineStates - States of the hosted Choria Autonomous Agents
- MachineTransition - Attempts to force a transition in a hosted Choria Autonomous Agent
Index ¶
- Constants
- func DDL() (*agent.DDL, error)
- func DDLBytes() ([]byte, error)
- type BroadcastNS
- type ChoriaFramework
- type ChoriaUtilClient
- func (p *ChoriaUtilClient) AgentMetadata() *Metadata
- func (p *ChoriaUtilClient) DiscoverNodes(ctx context.Context) (nodes []string, err error)
- func (p *ChoriaUtilClient) Info() *InfoRequester
- func (p *ChoriaUtilClient) MachineStates() *MachineStatesRequester
- func (p *ChoriaUtilClient) MachineTransition(transitionI string) *MachineTransitionRequester
- func (p *ChoriaUtilClient) OptionAgentFilter(a ...string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionClassFilter(f ...string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionCollective(c string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionCombinedFilter(f ...string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionCompoundFilter(f ...string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionDiscoveryTimeout(t time.Duration) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionExprFilter(f string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionFactFilter(f ...string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionIdentityFilter(f ...string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionInBatches(size int, sleep int) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionLimitMethod(m string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionLimitSeed(s int64) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionLimitSize(s string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionReset() *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionTargets(t []string) *ChoriaUtilClient
- func (p *ChoriaUtilClient) OptionWorkers(w int) *ChoriaUtilClient
- type DisplayMode
- type ExternalNS
- type FilterFunc
- type InfoOutput
- func (d *InfoOutput) ChoriaVersion() interface{}
- func (d *InfoOutput) ClientFlavour() interface{}
- func (d *InfoOutput) ClientOptions() interface{}
- func (d *InfoOutput) ClientStats() interface{}
- func (d *InfoOutput) ClientVersion() interface{}
- func (d *InfoOutput) ConnectedServer() interface{}
- func (d *InfoOutput) Connector() interface{}
- func (d *InfoOutput) ConnectorTls() interface{}
- func (d *InfoOutput) FacterCommand() interface{}
- func (d *InfoOutput) FacterDomain() interface{}
- func (d *InfoOutput) HashMap() map[string]interface{}
- func (d *InfoOutput) JSON() ([]byte, error)
- func (d *InfoOutput) MiddlewareServers() interface{}
- func (d *InfoOutput) ParseInfoOutput(target interface{}) error
- func (d *InfoOutput) Path() interface{}
- func (d *InfoOutput) ResultDetails() *ResultDetails
- func (d *InfoOutput) SecureProtocol() interface{}
- func (d *InfoOutput) Security() interface{}
- func (d *InfoOutput) SrvDomain() interface{}
- func (d *InfoOutput) UsingSrv() interface{}
- type InfoRequester
- type InfoResult
- type InitializationOption
- type Log
- type MachineStatesOutput
- func (d *MachineStatesOutput) HashMap() map[string]interface{}
- func (d *MachineStatesOutput) JSON() ([]byte, error)
- func (d *MachineStatesOutput) MachineIds() interface{}
- func (d *MachineStatesOutput) MachineNames() interface{}
- func (d *MachineStatesOutput) ParseMachineStatesOutput(target interface{}) error
- func (d *MachineStatesOutput) ResultDetails() *ResultDetails
- func (d *MachineStatesOutput) States() interface{}
- type MachineStatesRequester
- type MachineStatesResult
- type MachineTransitionOutput
- func (d *MachineTransitionOutput) HashMap() map[string]interface{}
- func (d *MachineTransitionOutput) JSON() ([]byte, error)
- func (d *MachineTransitionOutput) ParseMachineTransitionOutput(target interface{}) error
- func (d *MachineTransitionOutput) ResultDetails() *ResultDetails
- func (d *MachineTransitionOutput) Success() interface{}
- type MachineTransitionRequester
- func (d *MachineTransitionRequester) Do(ctx context.Context) (*MachineTransitionResult, error)
- func (d *MachineTransitionRequester) Instance(v string) *MachineTransitionRequester
- func (d *MachineTransitionRequester) Name(v string) *MachineTransitionRequester
- func (d *MachineTransitionRequester) Path(v string) *MachineTransitionRequester
- func (d *MachineTransitionRequester) Version(v string) *MachineTransitionRequester
- type MachineTransitionResult
- type MetaNS
- type Metadata
- type NodeSource
- type PuppetDBNS
- type RenderFormat
- type ResultDetails
- type Stats
- type StatusCode
Constants ¶
const ( // DisplayDDL shows results based on the configuration in the DDL file DisplayDDL = DisplayMode(iota) // DisplayOK shows only passing results DisplayOK // DisplayFailed shows only failed results DisplayFailed // DisplayAll shows all results DisplayAll // DisplayNone shows no results DisplayNone )
const ( // OK is the reply status when all worked OK = StatusCode(iota) // Aborted is status for when the action could not run, most failures in an action should set this Aborted // UnknownAction is the status for unknown actions requested UnknownAction // MissingData is the status for missing input data MissingData // InvalidData is the status for invalid input data InvalidData // UnknownError is the status general failures in agents should set when things go bad UnknownError )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BroadcastNS ¶
BroadcastNS is a NodeSource that uses the Choria network broadcast method to discover nodes
func (*BroadcastNS) Discover ¶
func (b *BroadcastNS) Discover(ctx context.Context, fw ChoriaFramework, filters []FilterFunc) ([]string, error)
Discover performs the discovery of nodes against the Choria Network
type ChoriaFramework ¶
type ChoriaFramework interface { Logger(string) *logrus.Entry SetLogger(*logrus.Logger) Configuration() *config.Config NewMessage(payload string, agent string, collective string, msgType string, request *choria.Message) (msg *choria.Message, err error) NewReplyFromTransportJSON(payload []byte, skipvalidate bool) (msg protocol.Reply, err error) NewTransportFromJSON(data string) (message protocol.TransportMessage, err error) MiddlewareServers() (servers srvcache.Servers, err error) NewConnector(ctx context.Context, servers func() (srvcache.Servers, error), name string, logger *logrus.Entry) (conn choria.Connector, err error) NewRequestID() (string, error) Certname() string PQLQueryCertNames(query string) ([]string, error) Colorize(c string, format string, a ...interface{}) string ProgressWidth() int }
ChoriaFramework is the Choria framework
type ChoriaUtilClient ¶
ChoriaUtilClient to the choria_util agent
func Must ¶
func Must(opts ...InitializationOption) (client *ChoriaUtilClient)
Must create a new client and panics on error
func New ¶
func New(opts ...InitializationOption) (client *ChoriaUtilClient, err error)
New creates a new client to the choria_util agent
func (*ChoriaUtilClient) AgentMetadata ¶
func (p *ChoriaUtilClient) AgentMetadata() *Metadata
AgentMetadata is the agent metadata this client supports
func (*ChoriaUtilClient) DiscoverNodes ¶
func (p *ChoriaUtilClient) DiscoverNodes(ctx context.Context) (nodes []string, err error)
DiscoverNodes performs a discovery using the configured filter and node source
func (*ChoriaUtilClient) Info ¶
func (p *ChoriaUtilClient) Info() *InfoRequester
Info performs the info action
Description: Choria related information from the running Daemon and Middleware
func (*ChoriaUtilClient) MachineStates ¶
func (p *ChoriaUtilClient) MachineStates() *MachineStatesRequester
MachineStates performs the machine_states action
Description: States of the hosted Choria Autonomous Agents
func (*ChoriaUtilClient) MachineTransition ¶
func (p *ChoriaUtilClient) MachineTransition(transitionI string) *MachineTransitionRequester
MachineTransition performs the machine_transition action
Description: Attempts to force a transition in a hosted Choria Autonomous Agent
Required Inputs:
- transition (string) - The transition event to send to the machine
Optional Inputs:
- instance (string) - Machine Instance ID
- name (string) - Machine Name
- path (string) - Machine Path
- version (string) - Machine Version
func (*ChoriaUtilClient) OptionAgentFilter ¶
func (p *ChoriaUtilClient) OptionAgentFilter(a ...string) *ChoriaUtilClient
OptionAgentFilter adds an agent filter
func (*ChoriaUtilClient) OptionClassFilter ¶
func (p *ChoriaUtilClient) OptionClassFilter(f ...string) *ChoriaUtilClient
OptionClassFilter adds a class filter
func (*ChoriaUtilClient) OptionCollective ¶
func (p *ChoriaUtilClient) OptionCollective(c string) *ChoriaUtilClient
OptionCollective sets the collective to target
func (*ChoriaUtilClient) OptionCombinedFilter ¶
func (p *ChoriaUtilClient) OptionCombinedFilter(f ...string) *ChoriaUtilClient
OptionCombinedFilter adds a combined filter
func (*ChoriaUtilClient) OptionCompoundFilter ¶
func (p *ChoriaUtilClient) OptionCompoundFilter(f ...string) *ChoriaUtilClient
OptionCompoundFilter adds a compound filter
func (*ChoriaUtilClient) OptionDiscoveryTimeout ¶
func (p *ChoriaUtilClient) OptionDiscoveryTimeout(t time.Duration) *ChoriaUtilClient
OptionDiscoveryTimeout configures the request discovery timeout, defaults to configured discovery timeout
func (*ChoriaUtilClient) OptionExprFilter ¶
func (p *ChoriaUtilClient) OptionExprFilter(f string) *ChoriaUtilClient
OptionExprFilter sets a filter expression that will remove results from the result set
func (*ChoriaUtilClient) OptionFactFilter ¶
func (p *ChoriaUtilClient) OptionFactFilter(f ...string) *ChoriaUtilClient
OptionFactFilter adds a fact filter
func (*ChoriaUtilClient) OptionIdentityFilter ¶
func (p *ChoriaUtilClient) OptionIdentityFilter(f ...string) *ChoriaUtilClient
OptionIdentityFilter adds an identity filter
func (*ChoriaUtilClient) OptionInBatches ¶
func (p *ChoriaUtilClient) OptionInBatches(size int, sleep int) *ChoriaUtilClient
OptionInBatches performs requests in batches
func (*ChoriaUtilClient) OptionLimitMethod ¶
func (p *ChoriaUtilClient) OptionLimitMethod(m string) *ChoriaUtilClient
OptionLimitMethod configures the method to use when limiting targets - "random" or "first"
func (*ChoriaUtilClient) OptionLimitSeed ¶
func (p *ChoriaUtilClient) OptionLimitSeed(s int64) *ChoriaUtilClient
OptionLimitSeed sets the random seed used to select targets when limiting and limit method is "random"
func (*ChoriaUtilClient) OptionLimitSize ¶
func (p *ChoriaUtilClient) OptionLimitSize(s string) *ChoriaUtilClient
OptionLimitSize sets limits on the targets, either a number of a percentage like "10%"
func (*ChoriaUtilClient) OptionReset ¶
func (p *ChoriaUtilClient) OptionReset() *ChoriaUtilClient
OptionReset resets the client options to use across requests to an empty list
func (*ChoriaUtilClient) OptionTargets ¶
func (p *ChoriaUtilClient) OptionTargets(t []string) *ChoriaUtilClient
OptionTargets sets specific node targets which would avoid discovery for all action calls until reset
func (*ChoriaUtilClient) OptionWorkers ¶
func (p *ChoriaUtilClient) OptionWorkers(w int) *ChoriaUtilClient
OptionWorkers sets how many worker connections should be started to the broker
type ExternalNS ¶ added in v0.20.0
ExternalNS is a NodeSource that calls an external command for discovery
func (*ExternalNS) Discover ¶ added in v0.20.0
func (p *ExternalNS) Discover(ctx context.Context, fw ChoriaFramework, filters []FilterFunc) ([]string, error)
func (*ExternalNS) Reset ¶ added in v0.20.0
func (p *ExternalNS) Reset()
Reset resets the internal node cache
type FilterFunc ¶
FilterFunc can generate a Choria filter
type InfoOutput ¶
type InfoOutput struct {
// contains filtered or unexported fields
}
InfoOutput is the output from the info action
func (*InfoOutput) ChoriaVersion ¶
func (d *InfoOutput) ChoriaVersion() interface{}
ChoriaVersion is the value of the choria_version output
Description: Choria version
func (*InfoOutput) ClientFlavour ¶
func (d *InfoOutput) ClientFlavour() interface{}
ClientFlavour is the value of the client_flavour output
Description: Middleware client gem flavour
func (*InfoOutput) ClientOptions ¶
func (d *InfoOutput) ClientOptions() interface{}
ClientOptions is the value of the client_options output
Description: Active Middleware client gem options
func (*InfoOutput) ClientStats ¶
func (d *InfoOutput) ClientStats() interface{}
ClientStats is the value of the client_stats output
Description: Middleware client gem statistics
func (*InfoOutput) ClientVersion ¶
func (d *InfoOutput) ClientVersion() interface{}
ClientVersion is the value of the client_version output
Description: Middleware client library version
func (*InfoOutput) ConnectedServer ¶
func (d *InfoOutput) ConnectedServer() interface{}
ConnectedServer is the value of the connected_server output
Description: Connected middleware server
func (*InfoOutput) Connector ¶
func (d *InfoOutput) Connector() interface{}
Connector is the value of the connector output
Description: Connector plugin
func (*InfoOutput) ConnectorTls ¶
func (d *InfoOutput) ConnectorTls() interface{}
ConnectorTls is the value of the connector_tls output
Description: If the connector is running with TLS security enabled
func (*InfoOutput) FacterCommand ¶
func (d *InfoOutput) FacterCommand() interface{}
FacterCommand is the value of the facter_command output
Description: Command used for Facter
func (*InfoOutput) FacterDomain ¶
func (d *InfoOutput) FacterDomain() interface{}
FacterDomain is the value of the facter_domain output
Description: Facter domain
func (*InfoOutput) HashMap ¶
func (d *InfoOutput) HashMap() map[string]interface{}
HashMap is the raw output data
func (*InfoOutput) JSON ¶
func (d *InfoOutput) JSON() ([]byte, error)
JSON is the JSON representation of the output data
func (*InfoOutput) MiddlewareServers ¶
func (d *InfoOutput) MiddlewareServers() interface{}
MiddlewareServers is the value of the middleware_servers output
Description: Middleware Servers configured or discovered
func (*InfoOutput) ParseInfoOutput ¶
func (d *InfoOutput) ParseInfoOutput(target interface{}) error
ParseOutput parses the result value from the Info action into target
func (*InfoOutput) Path ¶
func (d *InfoOutput) Path() interface{}
Path is the value of the path output
Description: Active OS PATH
func (*InfoOutput) ResultDetails ¶
func (d *InfoOutput) ResultDetails() *ResultDetails
ResultDetails is the details about the request
func (*InfoOutput) SecureProtocol ¶
func (d *InfoOutput) SecureProtocol() interface{}
SecureProtocol is the value of the secure_protocol output
Description: If the protocol is running with PKI security enabled
func (*InfoOutput) Security ¶
func (d *InfoOutput) Security() interface{}
Security is the value of the security output
Description: Security Provider plugin
func (*InfoOutput) SrvDomain ¶
func (d *InfoOutput) SrvDomain() interface{}
SrvDomain is the value of the srv_domain output
Description: Configured SRV domain
func (*InfoOutput) UsingSrv ¶
func (d *InfoOutput) UsingSrv() interface{}
UsingSrv is the value of the using_srv output
Description: Indicates if SRV records are considered
type InfoRequester ¶
type InfoRequester struct {
// contains filtered or unexported fields
}
InfoRequester performs a RPC request to choria_util#info
func (*InfoRequester) Do ¶
func (d *InfoRequester) Do(ctx context.Context) (*InfoResult, error)
Do performs the request
type InfoResult ¶
type InfoResult struct {
// contains filtered or unexported fields
}
InfoResult is the result from a info action
func (*InfoResult) EachOutput ¶
func (d *InfoResult) EachOutput(h func(r *InfoOutput))
EachOutput iterates over all results received
func (*InfoResult) RenderResults ¶
func (d *InfoResult) RenderResults(w io.Writer, format RenderFormat, displayMode DisplayMode, verbose bool, silent bool, colorize bool, log Log) error
type InitializationOption ¶
type InitializationOption func(opts *initOptions)
InitializationOption is an optional setting used to initialize the client
func ConfigFile ¶
func ConfigFile(f string) InitializationOption
ConfigFile sets the config file to use, when not set will use the user default
func Discovery ¶
func Discovery(ns NodeSource) InitializationOption
Discovery sets the NodeSource to use when finding nodes to manage
func DiscoveryMethod ¶
func DiscoveryMethod(m string) InitializationOption
DiscoveryMethod accepts a discovery method name as supplied from the CLI and configures the correct NodeSource reverts to broadcast method if an unsupported method is supplied, custom node sources can be set using Discovery()
func DiscoveryTimeout ¶
func DiscoveryTimeout(t time.Duration) InitializationOption
DiscoveryTimeout sets a timeout for discovery for those methods that support it
func Logger ¶
func Logger(l *logrus.Entry) InitializationOption
Logger sets the logger to use else one is made via the Choria framework
type MachineStatesOutput ¶
type MachineStatesOutput struct {
// contains filtered or unexported fields
}
MachineStatesOutput is the output from the machine_states action
func (*MachineStatesOutput) HashMap ¶
func (d *MachineStatesOutput) HashMap() map[string]interface{}
HashMap is the raw output data
func (*MachineStatesOutput) JSON ¶
func (d *MachineStatesOutput) JSON() ([]byte, error)
JSON is the JSON representation of the output data
func (*MachineStatesOutput) MachineIds ¶
func (d *MachineStatesOutput) MachineIds() interface{}
MachineIds is the value of the machine_ids output
Description: List of running machine IDs
func (*MachineStatesOutput) MachineNames ¶
func (d *MachineStatesOutput) MachineNames() interface{}
MachineNames is the value of the machine_names output
Description: List of running machine names
func (*MachineStatesOutput) ParseMachineStatesOutput ¶
func (d *MachineStatesOutput) ParseMachineStatesOutput(target interface{}) error
ParseOutput parses the result value from the MachineStates action into target
func (*MachineStatesOutput) ResultDetails ¶
func (d *MachineStatesOutput) ResultDetails() *ResultDetails
ResultDetails is the details about the request
func (*MachineStatesOutput) States ¶
func (d *MachineStatesOutput) States() interface{}
States is the value of the states output
Description: Hash map of machine statusses indexed by machine ID
type MachineStatesRequester ¶
type MachineStatesRequester struct {
// contains filtered or unexported fields
}
MachineStatesRequester performs a RPC request to choria_util#machine_states
func (*MachineStatesRequester) Do ¶
func (d *MachineStatesRequester) Do(ctx context.Context) (*MachineStatesResult, error)
Do performs the request
type MachineStatesResult ¶
type MachineStatesResult struct {
// contains filtered or unexported fields
}
MachineStatesResult is the result from a machine_states action
func (*MachineStatesResult) EachOutput ¶
func (d *MachineStatesResult) EachOutput(h func(r *MachineStatesOutput))
EachOutput iterates over all results received
func (*MachineStatesResult) RenderResults ¶
func (d *MachineStatesResult) RenderResults(w io.Writer, format RenderFormat, displayMode DisplayMode, verbose bool, silent bool, colorize bool, log Log) error
func (*MachineStatesResult) Stats ¶
func (d *MachineStatesResult) Stats() Stats
Stats is the rpc request stats
type MachineTransitionOutput ¶
type MachineTransitionOutput struct {
// contains filtered or unexported fields
}
MachineTransitionOutput is the output from the machine_transition action
func (*MachineTransitionOutput) HashMap ¶
func (d *MachineTransitionOutput) HashMap() map[string]interface{}
HashMap is the raw output data
func (*MachineTransitionOutput) JSON ¶
func (d *MachineTransitionOutput) JSON() ([]byte, error)
JSON is the JSON representation of the output data
func (*MachineTransitionOutput) ParseMachineTransitionOutput ¶
func (d *MachineTransitionOutput) ParseMachineTransitionOutput(target interface{}) error
ParseOutput parses the result value from the MachineTransition action into target
func (*MachineTransitionOutput) ResultDetails ¶
func (d *MachineTransitionOutput) ResultDetails() *ResultDetails
ResultDetails is the details about the request
func (*MachineTransitionOutput) Success ¶
func (d *MachineTransitionOutput) Success() interface{}
Success is the value of the success output
Description: Indicates if the transition was successfully accepted
type MachineTransitionRequester ¶
type MachineTransitionRequester struct {
// contains filtered or unexported fields
}
MachineTransitionRequester performs a RPC request to choria_util#machine_transition
func (*MachineTransitionRequester) Do ¶
func (d *MachineTransitionRequester) Do(ctx context.Context) (*MachineTransitionResult, error)
Do performs the request
func (*MachineTransitionRequester) Instance ¶
func (d *MachineTransitionRequester) Instance(v string) *MachineTransitionRequester
Instance is an optional input to the machine_transition action
Description: Machine Instance ID
func (*MachineTransitionRequester) Name ¶
func (d *MachineTransitionRequester) Name(v string) *MachineTransitionRequester
Name is an optional input to the machine_transition action
Description: Machine Name
func (*MachineTransitionRequester) Path ¶
func (d *MachineTransitionRequester) Path(v string) *MachineTransitionRequester
Path is an optional input to the machine_transition action
Description: Machine Path
func (*MachineTransitionRequester) Version ¶
func (d *MachineTransitionRequester) Version(v string) *MachineTransitionRequester
Version is an optional input to the machine_transition action
Description: Machine Version
type MachineTransitionResult ¶
type MachineTransitionResult struct {
// contains filtered or unexported fields
}
MachineTransitionResult is the result from a machine_transition action
func (*MachineTransitionResult) EachOutput ¶
func (d *MachineTransitionResult) EachOutput(h func(r *MachineTransitionOutput))
EachOutput iterates over all results received
func (*MachineTransitionResult) RenderResults ¶
func (d *MachineTransitionResult) RenderResults(w io.Writer, format RenderFormat, displayMode DisplayMode, verbose bool, silent bool, colorize bool, log Log) error
func (*MachineTransitionResult) Stats ¶
func (d *MachineTransitionResult) Stats() Stats
Stats is the rpc request stats
type MetaNS ¶ added in v0.20.0
type MetaNS struct { // Options is the CLI options to discover based on Options *discovery.StandardOptions // Agent should be the agent the request is targeted at Agent string // DisablePipedDiscovery prevents the STDIN being used as a discovery source DisablePipedDiscovery bool sync.Mutex // contains filtered or unexported fields }
MetaNS is a NodeSource that assists CLI tools in creating Choria standard command line based discovery.
func NewMetaNS ¶ added in v0.20.0
func NewMetaNS(opts *discovery.StandardOptions, enablePipeMode bool) *MetaNS
NewMetaNS creates a new meta discovery node source
func (*MetaNS) Discover ¶ added in v0.20.0
func (p *MetaNS) Discover(ctx context.Context, fw ChoriaFramework, _ []FilterFunc) ([]string, error)
Discover performs the discovery of nodes against the Choria Network.
type Metadata ¶
type Metadata struct { License string `json:"license"` Author string `json:"author"` Timeout int `json:"timeout"` Name string `json:"name"` Version string `json:"version"` URL string `json:"url"` Description string `json:"description"` }
Metadata is the agent metadata
type NodeSource ¶
type NodeSource interface { Reset() Discover(ctx context.Context, fw ChoriaFramework, filters []FilterFunc) ([]string, error) }
NodeSource discovers nodes
type PuppetDBNS ¶
PuppetDBNS is a NodeSource that uses the PuppetDB PQL Queries to discover nodes
func (*PuppetDBNS) Discover ¶
func (p *PuppetDBNS) Discover(ctx context.Context, fw ChoriaFramework, filters []FilterFunc) ([]string, error)
Discover performs the discovery of nodes against the Choria Network
type RenderFormat ¶
type RenderFormat int
RenderFormat is the format used by the RenderResults helper
const ( // JSONFormat renders the results as a JSON document JSONFormat RenderFormat = iota // TextFormat renders the results as a Choria typical result set in line with choria req output TextFormat // TableFormat renders all successful responses in a table TableFormat TXTFooter )
type ResultDetails ¶
type ResultDetails struct {
// contains filtered or unexported fields
}
ResultDetails is the details about a result
func (*ResultDetails) OK ¶
func (d *ResultDetails) OK() bool
OK determines if the request was successful
func (*ResultDetails) Sender ¶
func (d *ResultDetails) Sender() string
Sender is the identity of the remote that produced the message
func (*ResultDetails) StatusCode ¶
func (d *ResultDetails) StatusCode() StatusCode
StatusCode is the status code produced by the remote
func (*ResultDetails) StatusMessage ¶
func (d *ResultDetails) StatusMessage() string
StatusMessage is the status message produced by the remote
type Stats ¶
type Stats interface { Agent() string Action() string All() bool NoResponseFrom() []string UnexpectedResponseFrom() []string DiscoveredCount() int DiscoveredNodes() *[]string FailCount() int OKCount() int ResponsesCount() int PublishDuration() (time.Duration, error) RequestDuration() (time.Duration, error) DiscoveryDuration() (time.Duration, error) OverrideDiscoveryTime(start time.Time, end time.Time) }
Stats are the statistics for a request
type StatusCode ¶
type StatusCode uint8
StatusCode is a reply status as defined by MCollective SimpleRPC - integers 0 to 5
See the constants OK, RPCAborted, UnknownRPCAction, MissingRPCData, InvalidRPCData and UnknownRPCError