Documentation ¶
Index ¶
- func GetSingleStatusItem(ctx *log.Context, statusType types.StatusType, c types.Cmd, msg string) (types.StatusItem, error)
- func MarshalStatusReportIntoJson(statusReport types.StatusReport, indent bool) ([]byte, error)
- func ReportStatusToLocalFile(ctx *log.Context, hEnv types.HandlerEnvironment, metadata types.RCMetadata, ...) error
- func SaveStatusReport(statusFolder string, extName string, seqNo int, rootStatusJson []byte) error
- type ImmediateHandlerStatus
- type ImmediateStatus
- type ImmediateTopLevelStatus
- type StatusObserver
- func (o *StatusObserver) GetStatusForKey(key types.GoalStateKey) (types.StatusItem, bool)
- func (o *StatusObserver) Initialize(ctx *log.Context)
- func (o *StatusObserver) OnNotify(status types.StatusEventArgs) error
- func (o *StatusObserver) RemoveProcessedGoalStates(goalStateKeys []types.GoalStateKey)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSingleStatusItem ¶ added in v1.3.14
func GetSingleStatusItem(ctx *log.Context, statusType types.StatusType, c types.Cmd, msg string) (types.StatusItem, error)
getSingleStatusItem returns a single status item for the given status type, command, and message. This is useful when only a single status item is needed for an immediate status report.
func MarshalStatusReportIntoJson ¶ added in v1.3.11
func MarshalStatusReportIntoJson(statusReport types.StatusReport, indent bool) ([]byte, error)
func ReportStatusToLocalFile ¶
func ReportStatusToLocalFile(ctx *log.Context, hEnv types.HandlerEnvironment, metadata types.RCMetadata, statusType types.StatusType, c types.Cmd, msg string) error
ReportStatusToLocalFile saves operation status to the status file for the extension handler with the optional given message, if the given cmd requires reporting status.
If an error occurs reporting the status, it will be logged and returned.
This function is used by default for reporting status to the local file system unless a different method is specified.
func SaveStatusReport ¶ added in v1.3.11
SaveStatusReport persists the status message to the specified status folder using the sequence number. The operation consists of writing to a temporary file in the same folder and moving it to the final destination for atomicity.
Types ¶
type ImmediateHandlerStatus ¶ added in v1.3.14
type ImmediateHandlerStatus struct { HandlerName string `json:"handlerName" validate:"required"` AggregateImmediateStatus []ImmediateStatus `json:"aggregateImmediateStatus" validate:"required"` }
Status of the handler that is capable of handling immediate goal states
type ImmediateStatus ¶ added in v1.3.14
type ImmediateStatus struct { SequenceNumber int `json:"sequenceNumber" validate:"required"` TimestampUTC string `json:"timestampUTC" validate:"required"` Status types.StatusItem `json:"status" validate:"required"` }
Status of an immediate extension processed by a given handler
type ImmediateTopLevelStatus ¶ added in v1.3.14
type ImmediateTopLevelStatus struct {
AggregateHandlerImmediateStatus []ImmediateHandlerStatus `json:"aggregateHandlerImmediateStatus" validate:"required"`
}
This is the serializable data contract for VM Aggregate Immediate Status in CRP
type StatusObserver ¶ added in v1.3.14
type StatusObserver struct { // Reporter is the status Reporter Reporter statusreporter.IGuestInformationServiceClient // contains filtered or unexported fields }
Observer defines a type that can receive notifications from a Notifier. Must implement the Observer interface.
func (*StatusObserver) GetStatusForKey ¶ added in v1.3.14
func (o *StatusObserver) GetStatusForKey(key types.GoalStateKey) (types.StatusItem, bool)
func (*StatusObserver) Initialize ¶ added in v1.3.14
func (o *StatusObserver) Initialize(ctx *log.Context)
func (*StatusObserver) OnNotify ¶ added in v1.3.14
func (o *StatusObserver) OnNotify(status types.StatusEventArgs) error
func (*StatusObserver) RemoveProcessedGoalStates ¶ added in v1.3.14
func (o *StatusObserver) RemoveProcessedGoalStates(goalStateKeys []types.GoalStateKey)
Remove the goal states that have already been processed from the event map If the goal state that was added before is not in the new list of goal states, it should be removed This is to ensure that the event map only contains the goal states that are currently being processed