report

package
v0.11.10 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 17 Imported by: 10

Documentation

Overview

Package report implements reporting on client runs and node changes. See http://docs.opscode.com/reporting.html for details. CURRENTLY EXPERIMENTAL.

Index

Constants

View Source
const ReportTimeFormat = "2006-01-02 15:04:05 -0700"

The format for reporting start and end times in JSON. Of course, subtly different from MySQL's time format, but only subtly.

Variables

This section is empty.

Functions

func DeleteByAge added in v0.11.7

func DeleteByAge(dur time.Duration) (int, error)

DeleteByAge deletes reports older than the given duration. It returns the number of reports deleted, and an error if any.

func GetList

func GetList() []string

GetList returns a list of UUIDs of reports on the system.

func InitializeMetrics added in v0.10.4

func InitializeMetrics(metrics met.Backend)

Types

type ByTime added in v0.11.7

type ByTime []*Report

sorting routines for the benefit of purging old records with the in-memory data store.

func (ByTime) Len added in v0.11.7

func (b ByTime) Len() int

func (ByTime) Less added in v0.11.7

func (b ByTime) Less(i, j int) bool

func (ByTime) Swap added in v0.11.7

func (b ByTime) Swap(i, j int)

type Report

type Report struct {
	RunID         string                 `json:"run_id"`
	StartTime     time.Time              `json:"start_time"`
	EndTime       time.Time              `json:"end_time"`
	TotalResCount int                    `json:"total_res_count"`
	Status        string                 `json:"status"`
	RunList       string                 `json:"run_list"`
	Resources     []interface{}          `json:"resources"`
	Data          map[string]interface{} `json:"data"` // I think this is right
	NodeName      string                 `json:"node_name"`
	// contains filtered or unexported fields
}

Report holds information on a chef client's run, including when, what resources changed, what recipes were in the run list, and whether the run was successful or not.

func AllReports added in v0.5.2

func AllReports() []*Report

AllReports returns all run reports currently on the server for export.

func Get

func Get(runID string) (*Report, util.Gerror)

Get a report.

func GetNodeList

func GetNodeList(nodeName string, from, until time.Time, rows int, status string) ([]*Report, error)

GetNodeList returns a list of reports from the given node in the time range and status given. Status may be "" for all statuses.

func GetReportList

func GetReportList(from, until time.Time, rows int, status string) ([]*Report, error)

GetReportList returns a list of reports on the system in the given time range and with the given status, which may be "" for any status.

func New

func New(runID string, nodeName string) (*Report, util.Gerror)

New creates a new report.

func NewFromJSON added in v0.6.0

func NewFromJSON(nodeName string, jsonReport map[string]interface{}) (*Report, util.Gerror)

NewFromJSON creates a new report from the given uploaded JSON.

func (*Report) Delete

func (r *Report) Delete() error

Delete a report.

func (*Report) GobDecode

func (r *Report) GobDecode(b []byte) error

func (*Report) GobEncode

func (r *Report) GobEncode() ([]byte, error)

func (*Report) Save

func (r *Report) Save() error

Save a report.

func (*Report) UpdateFromJSON added in v0.6.0

func (r *Report) UpdateFromJSON(jsonReport map[string]interface{}) util.Gerror

UpdateFromJSON updates a report with the values in the uploaded JSON.

Jump to

Keyboard shortcuts

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