Documentation ¶
Overview ¶
Package shovey provides a means for pushing jobs out to nodes to be run independently of a chef-client run.
Index ¶
- func AllShoveyIDs() ([]string, util.Gerror)
- func DoesExist(runID string) (bool, util.Gerror)
- func GetList() []string
- func ImportShovey(shoveyJSON map[string]interface{}) error
- func ImportShoveyRun(sRunJSON map[string]interface{}) error
- func ImportShoveyRunStream(srStreamJSON map[string]interface{}) error
- type BySeq
- type Qerror
- type Shovey
- func (s *Shovey) Cancel() util.Gerror
- func (s *Shovey) CancelRuns(nodeNames []string) util.Gerror
- func (s *Shovey) GetNodeRuns() ([]*ShoveyRun, util.Gerror)
- func (s *Shovey) GetRun(nodeName string) (*ShoveyRun, util.Gerror)
- func (s *Shovey) Start() util.Gerror
- func (s *Shovey) ToJSON() (map[string]interface{}, util.Gerror)
- type ShoveyRun
- func (sr *ShoveyRun) AddStreamOutput(output string, outputType string, seq int, isLast bool) util.Gerror
- func (sr *ShoveyRun) CombineStreamOutput(outputType string, seq int) (string, util.Gerror)
- func (sr *ShoveyRun) GetStreamOutput(outputType string, seq int) ([]*ShoveyRunStream, util.Gerror)
- func (sr *ShoveyRun) ToJSON() (map[string]interface{}, util.Gerror)
- func (sr *ShoveyRun) UpdateFromJSON(srData map[string]interface{}) util.Gerror
- type ShoveyRunStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllShoveyIDs ¶
AllShoveyIDs returns all shovey run ids.
func DoesExist ¶ added in v0.11.4
DoesExist checks if there is a shovey instance with the given run id.
func ImportShovey ¶
ImportShovey is used to import shovey jobs from the exported JSON dump.
func ImportShoveyRun ¶
ImportShoveyRun is used to import shovey jobs from the exported JSON dump.
func ImportShoveyRunStream ¶
ImportShoveyRunStream is used to import shovey jobs from the exported JSON dump.
Types ¶
type Qerror ¶
type Qerror interface { String() string Error() string Status() string SetStatus(string) UpNodes() []string DownNodes() []string SetUpNodes([]string) SetDownNodes([]string) }
Qerror is a special error type for shovey runs.
type Shovey ¶
type Shovey struct { RunID string `json:"id"` NodeNames []string `json:"nodes"` Command string `json:"command"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Status string `json:"status"` Timeout time.Duration `json:"timeout"` Quorum string `json:"quorum"` }
Shovey holds all the overall information for a shovey run common to all nodes running the command.
func (*Shovey) CancelRuns ¶
CancelRuns cancels the shovey runs given in the slice of strings with the node names to cancel jobs on.
func (*Shovey) GetNodeRuns ¶
GetNodeRuns gets all of the ShoveyRuns associated with this shovey instance.
func (*Shovey) GetRun ¶
GetRun gets a particular node's shovey run associated with this shovey instance.
type ShoveyRun ¶
type ShoveyRun struct { ID int `json:"-"` ShoveyUUID string `json:"run_id"` NodeName string `json:"node_name"` Status string `json:"status"` AckTime time.Time `json:"ack_time"` EndTime time.Time `json:"end_time"` Error string `json:"error"` ExitStatus uint8 `json:"exit_status"` }
ShoveyRun represents a node's shovey run.
func AllShoveyRuns ¶
func AllShoveyRuns() []*ShoveyRun
func (*ShoveyRun) AddStreamOutput ¶
func (sr *ShoveyRun) AddStreamOutput(output string, outputType string, seq int, isLast bool) util.Gerror
AddStreamOutput adds a chunk of output from the job to the output list on the server stored in the ShoveyRunStream objects.
func (*ShoveyRun) CombineStreamOutput ¶
CombineStreamOutput combines a ShoveyRun's output streams.
func (*ShoveyRun) GetStreamOutput ¶
GetStreamOutput gets all ShoveyRunStream objects associated with a ShoveyRun of the given output type.
type ShoveyRunStream ¶
type ShoveyRunStream struct { ShoveyUUID string NodeName string Seq int OutputType string Output string IsLast bool CreatedAt time.Time }
ShoveyRunStream holds a chunk of output from a shovey run.
func AllShoveyRunStreams ¶
func AllShoveyRunStreams() []*ShoveyRunStream