choria_utilclient

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package choria_utilclient is an API client to the Choria Choria_util agent Version 0.28.0.

Actions:

  • Info - Choria related information from the running Daemon and Middleware
  • MachineState - Retrieves the current state of a specific Choria Autonomous Agent
  • MachineStates - States of the hosted Choria Autonomous Agents
  • MachineTransition - Attempts to force a transition in a hosted Choria Autonomous Agent

Index

Constants

View Source
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
)
View Source
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

func DDL

func DDL() (*agent.DDL, error)

DDL is a parsed and loaded DDL for the agent

func DDLBytes

func DDLBytes() ([]byte, error)

DDLBytes is the raw JSON encoded DDL file for the agent

Types

type BroadcastNS

type BroadcastNS struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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 inter.Framework, filters []FilterFunc) ([]string, error)

Discover performs the discovery of nodes against the Choria Network

func (*BroadcastNS) Reset

func (b *BroadcastNS) Reset()

Reset resets the internal node cache

type ChoriaUtilClient

type ChoriaUtilClient struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ChoriaUtilClient to the choria_util agent

func Must

func Must(fw inter.Framework, opts ...InitializationOption) (client *ChoriaUtilClient)

Must create a new client and panics on error

func New

func New(fw inter.Framework, 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) MachineState added in v0.21.0

func (p *ChoriaUtilClient) MachineState() *MachineStateRequester

MachineState performs the machine_state action

Description: Retrieves the current state of a specific Choria Autonomous Agent

Optional Inputs:

  • instance (string) - Machine Instance ID
  • name (string) - Machine Name
  • path (string) - Machine Path

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(inputTransition 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) OptionReplyTo added in v0.23.0

func (p *ChoriaUtilClient) OptionReplyTo(t string) *ChoriaUtilClient

OptionReplyTo sets a custom reply target

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 DisplayMode

type DisplayMode uint8

DisplayMode overrides the DDL display hints

type ExternalNS added in v0.20.0

type ExternalNS struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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 inter.Framework, filters []FilterFunc) ([]string, error)

func (*ExternalNS) Reset added in v0.20.0

func (p *ExternalNS) Reset()

Reset resets the internal node cache

type FilterFunc

type FilterFunc func(f *protocol.Filter) error

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() string

ChoriaVersion is the value of the choria_version output

Description: Choria version

func (*InfoOutput) ClientFlavour

func (d *InfoOutput) ClientFlavour() string

ClientFlavour is the value of the client_flavour output

Description: Middleware client library flavour

func (*InfoOutput) ClientOptions

func (d *InfoOutput) ClientOptions() map[string]any

ClientOptions is the value of the client_options output

Description: Active Middleware client options

func (*InfoOutput) ClientStats

func (d *InfoOutput) ClientStats() map[string]any

ClientStats is the value of the client_stats output

Description: Middleware client statistics

func (*InfoOutput) ClientVersion

func (d *InfoOutput) ClientVersion() string

ClientVersion is the value of the client_version output

Description: Middleware client library version

func (*InfoOutput) ConnectedServer

func (d *InfoOutput) ConnectedServer() string

ConnectedServer is the value of the connected_server output

Description: Connected middleware server

func (*InfoOutput) Connector

func (d *InfoOutput) Connector() string

Connector is the value of the connector output

Description: Connector plugin

func (*InfoOutput) ConnectorTls

func (d *InfoOutput) ConnectorTls() bool

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() string

FacterCommand is the value of the facter_command output

Description: Command used for Facter

func (*InfoOutput) FacterDomain

func (d *InfoOutput) FacterDomain() string

FacterDomain is the value of the facter_domain output

Description: Facter domain

func (*InfoOutput) HashMap

func (d *InfoOutput) HashMap() map[string]any

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() []any

MiddlewareServers is the value of the middleware_servers output

Description: Middleware Servers configured or discovered

func (*InfoOutput) ParseInfoOutput

func (d *InfoOutput) ParseInfoOutput(target any) error

ParseInfoOutput parses the result value from the Info action into target

func (*InfoOutput) Path

func (d *InfoOutput) Path() string

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() bool

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() string

Security is the value of the security output

Description: Security Provider plugin

func (*InfoOutput) SrvDomain

func (d *InfoOutput) SrvDomain() string

SrvDomain is the value of the srv_domain output

Description: Configured SRV domain

func (*InfoOutput) UsingSrv

func (d *InfoOutput) UsingSrv() bool

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) AllOutputs added in v0.26.0

func (d *InfoResult) AllOutputs() []*InfoOutput

AllOutputs provide access to all outputs

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

func (*InfoResult) Stats

func (d *InfoResult) Stats() Stats

Stats is the rpc request stats

type InitializationOption

type InitializationOption func(opts *initOptions)

InitializationOption is an optional setting used to initialize the client

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

Logger sets the logger to use else one is made via the Choria framework

func Progress

func Progress() InitializationOption

Progress enables displaying a progress bar

type Log

type Log interface {
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
	Fatalf(format string, args ...any)
	Panicf(format string, args ...any)
}

type MachineStateOutput added in v0.21.0

type MachineStateOutput struct {
	// contains filtered or unexported fields
}

MachineStateOutput is the output from the machine_state action

func (*MachineStateOutput) AvailableTransitions added in v0.21.0

func (d *MachineStateOutput) AvailableTransitions() []any

AvailableTransitions is the value of the available_transitions output

Description: The list of available transitions this autonomous agent can make

func (*MachineStateOutput) CurrentState added in v0.21.0

func (d *MachineStateOutput) CurrentState() any

CurrentState is the value of the current_state output

Description: The Choria Scout specific state for Scout checks

func (*MachineStateOutput) HashMap added in v0.21.0

func (d *MachineStateOutput) HashMap() map[string]any

HashMap is the raw output data

func (*MachineStateOutput) Id added in v0.21.0

func (d *MachineStateOutput) Id() string

Id is the value of the id output

Description: The unique running ID of the autonomous agent

func (*MachineStateOutput) JSON added in v0.21.0

func (d *MachineStateOutput) JSON() ([]byte, error)

JSON is the JSON representation of the output data

func (*MachineStateOutput) Name added in v0.21.0

func (d *MachineStateOutput) Name() string

Name is the value of the name output

Description: The name of the autonomous agent

func (*MachineStateOutput) ParseMachineStateOutput added in v0.21.0

func (d *MachineStateOutput) ParseMachineStateOutput(target any) error

ParseMachineStateOutput parses the result value from the MachineState action into target

func (*MachineStateOutput) Path added in v0.21.0

func (d *MachineStateOutput) Path() string

Path is the value of the path output

Description: The location on disk where the autonomous agent is stored

func (*MachineStateOutput) ResultDetails added in v0.21.0

func (d *MachineStateOutput) ResultDetails() *ResultDetails

ResultDetails is the details about the request

func (*MachineStateOutput) Scout added in v0.21.0

func (d *MachineStateOutput) Scout() bool

Scout is the value of the scout output

Description: True when this autonomous agent represents a Choria Scout Check

func (*MachineStateOutput) StartTime added in v0.21.0

func (d *MachineStateOutput) StartTime() string

StartTime is the value of the start_time output

Description: The time the autonomous agent was started in unix seconds

func (*MachineStateOutput) State added in v0.21.0

func (d *MachineStateOutput) State() string

State is the value of the state output

Description: The current state the agent is in

func (*MachineStateOutput) Version added in v0.21.0

func (d *MachineStateOutput) Version() string

Version is the value of the version output

Description: The version of the autonomous agent

type MachineStateRequester added in v0.21.0

type MachineStateRequester struct {
	// contains filtered or unexported fields
}

MachineStateRequester performs a RPC request to choria_util#machine_state

func (*MachineStateRequester) Do added in v0.21.0

Do performs the request

func (*MachineStateRequester) Instance added in v0.21.0

Instance is an optional input to the machine_state action

Description: Machine Instance ID

func (*MachineStateRequester) Name added in v0.21.0

Name is an optional input to the machine_state action

Description: Machine Name

func (*MachineStateRequester) Path added in v0.21.0

Path is an optional input to the machine_state action

Description: Machine Path

type MachineStateResult added in v0.21.0

type MachineStateResult struct {
	// contains filtered or unexported fields
}

MachineStateResult is the result from a machine_state action

func (*MachineStateResult) AllOutputs added in v0.26.0

func (d *MachineStateResult) AllOutputs() []*MachineStateOutput

AllOutputs provide access to all outputs

func (*MachineStateResult) EachOutput added in v0.21.0

func (d *MachineStateResult) EachOutput(h func(r *MachineStateOutput))

EachOutput iterates over all results received

func (*MachineStateResult) RenderResults added in v0.21.0

func (d *MachineStateResult) RenderResults(w io.Writer, format RenderFormat, displayMode DisplayMode, verbose bool, silent bool, colorize bool, log Log) error

func (*MachineStateResult) Stats added in v0.21.0

func (d *MachineStateResult) Stats() Stats

Stats is the rpc request stats

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]any

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() []any

MachineIds is the value of the machine_ids output

Description: List of running machine IDs

func (*MachineStatesOutput) MachineNames

func (d *MachineStatesOutput) MachineNames() []any

MachineNames is the value of the machine_names output

Description: List of running machine names

func (*MachineStatesOutput) ParseMachineStatesOutput

func (d *MachineStatesOutput) ParseMachineStatesOutput(target any) error

ParseMachineStatesOutput 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() map[string]any

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

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) AllOutputs added in v0.26.0

func (d *MachineStatesResult) AllOutputs() []*MachineStatesOutput

AllOutputs provide access to all outputs

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]any

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 any) error

ParseMachineTransitionOutput 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() bool

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

Do performs the request

func (*MachineTransitionRequester) Instance

Instance is an optional input to the machine_transition action

Description: Machine Instance ID

func (*MachineTransitionRequester) Name

Name is an optional input to the machine_transition action

Description: Machine Name

func (*MachineTransitionRequester) Path

Path is an optional input to the machine_transition action

Description: Machine Path

func (*MachineTransitionRequester) Version

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) AllOutputs added in v0.26.0

AllOutputs provide access to all outputs

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 inter.Framework, _ []FilterFunc) ([]string, error)

Discover performs the discovery of nodes against the Choria Network.

func (*MetaNS) Reset added in v0.20.0

func (p *MetaNS) Reset()

Reset resets the internal node cache

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 inter.Framework, filters []FilterFunc) ([]string, error)
}

NodeSource discovers nodes

type PuppetDBNS

type PuppetDBNS struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PuppetDBNS is a NodeSource that uses the PuppetDB PQL Queries to discover nodes

func (*PuppetDBNS) Discover

func (p *PuppetDBNS) Discover(ctx context.Context, fw inter.Framework, filters []FilterFunc) ([]string, error)

Discover performs the discovery of nodes against the Choria Network

func (*PuppetDBNS) Reset

func (p *PuppetDBNS) Reset()

Reset resets the internal node cache

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 renders only the request summary statistics
	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)
	UniqueRequestID() string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL