report

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2014 License: Apache-2.0 Imports: 14 Imported by: 0

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 GetList

func GetList() []string

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

Types

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:"nodeName"`
	// 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