Files

69 lines
2.1 KiB
Go

package operations
import (
"time"
commonDto "git.ilapage.cn/ila/yovision/Sense/server/common/dto"
)
const (
ObjectDevice = "device"
ObjectMedia = "media"
ObjectLocalInference = "local_inference"
ProblemAuthentication = "authentication_failed"
ProblemBackoff = "backoff_wait"
ProblemClockDrift = "clock_drift"
ProblemOrphan = "orphan_safety_gate"
ProblemUnavailable = "capability_unavailable"
ProblemUnready = "not_converged"
)
type PageRequest struct {
commonDto.Pagination `search:"-"`
ObjectType string `form:"objectType"`
ProblemType string `form:"problemType"`
Severity string `form:"severity"`
Keyword string `form:"keyword"`
}
type RetryRequest struct {
ExpectedVersion int64 `json:"expectedVersion"`
}
type Summary struct {
ManagedCount int `json:"managedCount"`
ConvergedCount int `json:"convergedCount"`
ActionableProblems int `json:"actionableProblems"`
LocalInference string `json:"localInference"`
}
type Problem struct {
ID string `json:"id"`
ObjectType string `json:"objectType"`
ObjectID string `json:"objectId"`
ObjectName string `json:"objectName"`
Location string `json:"location,omitempty"`
ProblemType string `json:"problemType"`
Severity string `json:"severity"`
Expected string `json:"expected"`
Actual string `json:"actual"`
Difference string `json:"difference"`
NextAction string `json:"nextAction"`
NextRetryAt *time.Time `json:"nextRetryAt,omitempty"`
LastSuccessAt *time.Time `json:"lastSuccessAt,omitempty"`
AttemptCount int `json:"attemptCount"`
Retryable bool `json:"retryable"`
RetryInProgress bool `json:"retryInProgress"`
Version int64 `json:"version"`
SafetyGate string `json:"safetyGate"`
OperationalOnly bool `json:"operationalOnly"`
UpdatedAt time.Time `json:"updatedAt"`
}
type PageResponse struct {
Summary Summary `json:"summary"`
List []Problem `json:"list"`
Count int64 `json:"count"`
}