Documentation
¶
Overview ¶
Package api provides types for Preflight reports and some common helpers.
Index ¶
Constants ¶
const TimeFormat = time.RFC3339
TimeFormat defines the format used for timestamps across all this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterSummary ¶
type ClusterSummary struct {
Cluster string `json:"cluster"`
LatestReportSet *ReportSet `json:"latestReportSet"`
}
ClusterSummary contains a summary of the most recent status of a cluster.
type Report ¶
type Report struct {
// Unique ID of the report
ID string `json:"id"`
// Timestamp indicates when the report was generated
Timestamp Time `json:"timestamp"`
// Cluster indicates which was the target of the report
Cluster string `json:"cluster"`
// Package indicates which package was used for the report
Package string `json:"package"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Sections []ReportSection `json:"sections,omitempty"`
}
Report contains the fields of a Preflight report
type ReportMetadata ¶
type ReportMetadata struct {
Cluster string `json:"cluster"`
Timestamp Time `json:"timestamp"`
Package string `json:"package"`
ID string `json:"id"`
}
ReportMetadata contains metadata about a report
type ReportRule ¶
type ReportRule struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Manual bool `json:"manual,omitempty"`
Remediation string `json:"remediation,omitempty"`
Links []string `json:"links,omitempty"`
Success bool `json:"success"`
Value interface{} `json:"value,omitempty"`
Missing bool `json:"missing"`
}
ReportRule contains the fields of a rule inside a Report
type ReportSection ¶
type ReportSection struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Rules []ReportRule `json:"rules,omitempty"`
}
ReportSection contains the fields of a section inside a Report
type ReportSet ¶
type ReportSet struct {
Cluster string `json:"-"`
Timestamp Time `json:"timestamp"`
FailureCount int `json:"failureCount"`
SuccessCount int `json:"successCount"`
Reports []*ReportSummary `json:"reports"`
}
ReportSet groups one or more reports of different packages with the same timestamp for the same cluster.
type ReportSummary ¶
type ReportSummary struct {
ID string `json:"id"`
Package string `json:"package"`
Cluster string `json:"-"`
Timestamp Time `json:"-"`
FailureCount int `json:"failureCount"`
SuccessCount int `json:"successCount"`
}
ReportSummary constains a summary of a report.
type Time ¶
Time is a wrapper around time.Time that overrides how it is marshaled into JSON
func (Time) MarshalJSON ¶
MarshalJSON marshals the timestamp with RFC3339 format