Skip to content

Commit

Permalink
Add Conditions to Status (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsli authored Dec 3, 2024
1 parent e5cf8b6 commit a4003e8
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,40 @@ const (
UpdatingState State = "Updating"
)

type Severity string

const (
// OKSeverity indicates normal operation.
OKSeverity Severity = "OK"
// WarningSeverity indicates the condition requires attention.
WarningSeverity Severity = "Warning"
// CriticalSeverity indicates the condition requires immediate attention
CriticalSeverity Severity = "Critical"
)

type Condition struct {
// LogEntry contains a link to the log entry created for this condition.
LogEntry Link
// Message contains the human-readable message for this condition.
Message string
// Severity contains the severity of this condition.
Severity Severity
// MessageId contains the identifier for the message
MessageID string
// OriginOfCondition contains a link to the resource or object that originated the condition
OriginOfCondition Link
// Resolution contains the recommended actions to resolve this condition
Resolution string
// Timestamp contains the time the condition was last changed
Timestamp string
}

// Status describes the status and health of a resource and its children.
type Status struct {
Health Health `json:"Health"`
HealthRollup Health `json:"HealthRollup"`
State State `json:"State"`
Health Health `json:"Health"`
HealthRollup Health `json:"HealthRollup"`
State State `json:"State"`
Conditions []Condition `json:"Conditions"`
}

// LocationType shall name the type of location in use.
Expand Down

0 comments on commit a4003e8

Please sign in to comment.