feat: build vehicle data platform and production pipeline
This commit is contained in:
@@ -7,6 +7,661 @@ type Page[T any] struct {
|
||||
Offset int `json:"offset"`
|
||||
}
|
||||
|
||||
type MonitorSummary struct {
|
||||
TotalVehicles int `json:"totalVehicles"`
|
||||
OnlineVehicles int `json:"onlineVehicles"`
|
||||
OfflineVehicles int `json:"offlineVehicles"`
|
||||
DrivingVehicles int `json:"drivingVehicles"`
|
||||
IdleVehicles int `json:"idleVehicles"`
|
||||
AlertVehicles int `json:"alertVehicles"`
|
||||
UnknownVehicles int `json:"unknownVehicles"`
|
||||
ActiveToday int `json:"activeToday"`
|
||||
FrameToday int `json:"frameToday"`
|
||||
AlertDataAvailable bool `json:"alertDataAvailable"`
|
||||
Truncated bool `json:"truncated"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type MonitorMapResponse struct {
|
||||
Mode string `json:"mode"`
|
||||
Zoom int `json:"zoom"`
|
||||
Total int `json:"total"`
|
||||
Truncated bool `json:"truncated"`
|
||||
Points []MonitorMapPoint `json:"points"`
|
||||
Clusters []MonitorMapCluster `json:"clusters"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type MonitorMapPoint struct {
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Protocol string `json:"protocol"`
|
||||
Protocols []string `json:"protocols"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
SpeedKmh float64 `json:"speedKmh"`
|
||||
SOCPercent float64 `json:"socPercent"`
|
||||
TotalMileageKm float64 `json:"totalMileageKm"`
|
||||
LastSeen string `json:"lastSeen"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type MonitorMapCluster struct {
|
||||
ID string `json:"id"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Count int `json:"count"`
|
||||
Online int `json:"online"`
|
||||
Offline int `json:"offline"`
|
||||
Driving int `json:"driving"`
|
||||
Idle int `json:"idle"`
|
||||
Unknown int `json:"unknown"`
|
||||
}
|
||||
|
||||
type TrackPlaybackResponse struct {
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Points []HistoryLocationRow `json:"points"`
|
||||
Events []TrackPlaybackEvent `json:"events"`
|
||||
Sources []TrackPlaybackSource `json:"sources"`
|
||||
Segments []TrackSegment `json:"segments"`
|
||||
Stops []TrackStop `json:"stops"`
|
||||
Summary TrackPlaybackSummary `json:"summary"`
|
||||
Coverage TrackCoverage `json:"coverage"`
|
||||
Quality TrackQuality `json:"quality"`
|
||||
Total int `json:"total"`
|
||||
Truncated bool `json:"truncated"`
|
||||
Sampled bool `json:"sampled"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type TrackPlaybackSummary struct {
|
||||
StartTime string `json:"startTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
DistanceKm float64 `json:"distanceKm"`
|
||||
DurationSeconds int64 `json:"durationSeconds"`
|
||||
AverageSpeedKmh float64 `json:"averageSpeedKmh"`
|
||||
MaximumSpeedKmh float64 `json:"maximumSpeedKmh"`
|
||||
PointCount int `json:"pointCount"`
|
||||
MovingSeconds int64 `json:"movingSeconds"`
|
||||
StoppedSeconds int64 `json:"stoppedSeconds"`
|
||||
StopCount int `json:"stopCount"`
|
||||
SegmentCount int `json:"segmentCount"`
|
||||
}
|
||||
|
||||
type TrackPlaybackEvent struct {
|
||||
Index int `json:"index"`
|
||||
SampledIndex int `json:"sampledIndex"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Time string `json:"time"`
|
||||
SpeedKmh float64 `json:"speedKmh"`
|
||||
SOCPercent float64 `json:"socPercent"`
|
||||
SOCAvailable bool `json:"socAvailable"`
|
||||
DirectionDeg *int64 `json:"directionDeg,omitempty"`
|
||||
AlarmFlag *int64 `json:"alarmFlag,omitempty"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
}
|
||||
|
||||
type TrackPlaybackSource struct {
|
||||
Protocol string `json:"protocol"`
|
||||
PointCount int `json:"pointCount"`
|
||||
StartTime string `json:"startTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
}
|
||||
|
||||
// TrackCoverage makes a bounded replay query explicit. Complete=false means
|
||||
// summaries describe only the fetched slice, never the whole requested range.
|
||||
type TrackCoverage struct {
|
||||
RequestedStart string `json:"requestedStart"`
|
||||
RequestedEnd string `json:"requestedEnd"`
|
||||
ActualStart string `json:"actualStart"`
|
||||
ActualEnd string `json:"actualEnd"`
|
||||
TotalPoints int `json:"totalPoints"`
|
||||
FetchedPoints int `json:"fetchedPoints"`
|
||||
ProcessedPoints int `json:"processedPoints"`
|
||||
ReturnedPoints int `json:"returnedPoints"`
|
||||
Complete bool `json:"complete"`
|
||||
LimitReasons []string `json:"limitReasons"`
|
||||
Evidence string `json:"evidence"`
|
||||
}
|
||||
|
||||
// TrackSegment is inferred from GPS movement and gaps. It deliberately does
|
||||
// not claim ignition state because vehicle_locations does not contain it.
|
||||
type TrackSegment struct {
|
||||
Index int `json:"index"`
|
||||
Type string `json:"type"`
|
||||
Title string `json:"title"`
|
||||
StartTime string `json:"startTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
DurationSeconds int64 `json:"durationSeconds"`
|
||||
DistanceKm float64 `json:"distanceKm"`
|
||||
PointCount int `json:"pointCount"`
|
||||
StartIndex int `json:"startIndex"`
|
||||
EndIndex int `json:"endIndex"`
|
||||
SampledStartIndex int `json:"sampledStartIndex"`
|
||||
SampledEndIndex int `json:"sampledEndIndex"`
|
||||
}
|
||||
|
||||
type TrackStop struct {
|
||||
Index int `json:"index"`
|
||||
StartTime string `json:"startTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
DurationSeconds int64 `json:"durationSeconds"`
|
||||
PointCount int `json:"pointCount"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
SampledIndex int `json:"sampledIndex"`
|
||||
Evidence string `json:"evidence"`
|
||||
startIndex int
|
||||
endIndex int
|
||||
}
|
||||
|
||||
type TrackQuality struct {
|
||||
Status string `json:"status"`
|
||||
SelectedProtocol string `json:"selectedProtocol"`
|
||||
RawPoints int `json:"rawPoints"`
|
||||
ValidPoints int `json:"validPoints"`
|
||||
AlternateSourcePoints int `json:"alternateSourcePoints"`
|
||||
InvalidCoordinatePoints int `json:"invalidCoordinatePoints"`
|
||||
DuplicatePoints int `json:"duplicatePoints"`
|
||||
DriftPoints int `json:"driftPoints"`
|
||||
SourceSwitches int `json:"sourceSwitches"`
|
||||
LargeGapCount int `json:"largeGapCount"`
|
||||
MaximumGapSeconds int64 `json:"maximumGapSeconds"`
|
||||
Evidence string `json:"evidence"`
|
||||
}
|
||||
|
||||
type HistoryMetricCatalog struct {
|
||||
Categories []HistoryDataCategory `json:"categories"`
|
||||
Metrics []HistoryMetricDefinition `json:"metrics"`
|
||||
}
|
||||
|
||||
type MetricCatalog struct {
|
||||
Metrics []MetricDefinition `json:"metrics"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type MetricDefinition struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
Description string `json:"description"`
|
||||
Unit string `json:"unit"`
|
||||
Category string `json:"category"`
|
||||
ValueType string `json:"valueType"`
|
||||
Protocols []string `json:"protocols"`
|
||||
SourceFields map[string]string `json:"sourceFields"`
|
||||
Searchable bool `json:"searchable"`
|
||||
Chartable bool `json:"chartable"`
|
||||
Alertable bool `json:"alertable"`
|
||||
}
|
||||
|
||||
type HistoryDataCategory struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
type HistoryMetricDefinition struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
Unit string `json:"unit"`
|
||||
Category string `json:"category"`
|
||||
ValueType string `json:"valueType"`
|
||||
DefaultVisible bool `json:"defaultVisible"`
|
||||
}
|
||||
|
||||
type HistoryDataResponse struct {
|
||||
Category string `json:"category"`
|
||||
Columns []HistoryMetricDefinition `json:"columns"`
|
||||
Rows []HistoryDataRow `json:"rows"`
|
||||
Summary HistoryDataSummary `json:"summary"`
|
||||
Total int `json:"total"`
|
||||
Limit int `json:"limit"`
|
||||
Offset int `json:"offset"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type HistoryDataSummary struct {
|
||||
ResultRows int `json:"resultRows"`
|
||||
VehicleCount int `json:"vehicleCount"`
|
||||
Sources []string `json:"sources"`
|
||||
QueryDuration int64 `json:"queryDurationMs"`
|
||||
}
|
||||
|
||||
type HistoryDataRow struct {
|
||||
ID string `json:"id"`
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Protocol string `json:"protocol"`
|
||||
DeviceTime string `json:"deviceTime"`
|
||||
ServerTime string `json:"serverTime"`
|
||||
Quality string `json:"quality"`
|
||||
EvidenceID string `json:"evidenceId,omitempty"`
|
||||
Values map[string]any `json:"values"`
|
||||
}
|
||||
|
||||
type HistorySeriesResponse struct {
|
||||
Metrics []HistoryMetricDefinition `json:"metrics"`
|
||||
Series []HistorySeries `json:"series"`
|
||||
Summary HistorySeriesSummary `json:"summary"`
|
||||
DateFrom string `json:"dateFrom"`
|
||||
DateTo string `json:"dateTo"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type HistorySeries struct {
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Protocol string `json:"protocol"`
|
||||
Metric string `json:"metric"`
|
||||
Label string `json:"label"`
|
||||
Unit string `json:"unit"`
|
||||
Aggregation string `json:"aggregation"`
|
||||
Points []HistorySeriesPoint `json:"points"`
|
||||
}
|
||||
|
||||
type HistorySeriesPoint struct {
|
||||
Time string `json:"time"`
|
||||
Value *float64 `json:"value"`
|
||||
Min *float64 `json:"min"`
|
||||
Max *float64 `json:"max"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
type HistorySeriesSummary struct {
|
||||
RawPointCount int64 `json:"rawPointCount"`
|
||||
BucketCount int `json:"bucketCount"`
|
||||
ReturnedPointCount int `json:"returnedPointCount"`
|
||||
SeriesCount int `json:"seriesCount"`
|
||||
GrainSeconds int `json:"grainSeconds"`
|
||||
TargetPoints int `json:"targetPoints"`
|
||||
ExpectedBucketCount int `json:"expectedBucketCount"`
|
||||
MissingBucketCount int `json:"missingBucketCount"`
|
||||
QueryDuration int64 `json:"queryDurationMs"`
|
||||
Complete bool `json:"complete"`
|
||||
Evidence string `json:"evidence"`
|
||||
}
|
||||
|
||||
type HistoryLocationSeriesQuery struct {
|
||||
VIN string
|
||||
Protocol string
|
||||
DateFrom string
|
||||
DateTo string
|
||||
GrainSeconds int
|
||||
}
|
||||
|
||||
type HistoryLocationSeriesBucket struct {
|
||||
Time string
|
||||
Protocol string
|
||||
Count int64
|
||||
SpeedAverage *float64
|
||||
SpeedMinimum *float64
|
||||
SpeedMaximum *float64
|
||||
SpeedLast *float64
|
||||
MileageAverage *float64
|
||||
MileageMinimum *float64
|
||||
MileageMaximum *float64
|
||||
MileageLast *float64
|
||||
}
|
||||
|
||||
type HistoryExportRequest struct {
|
||||
Keywords []string `json:"keywords"`
|
||||
Category string `json:"category"`
|
||||
Protocol string `json:"protocol"`
|
||||
DateFrom string `json:"dateFrom"`
|
||||
DateTo string `json:"dateTo"`
|
||||
Metrics []string `json:"metrics"`
|
||||
Format string `json:"format"`
|
||||
}
|
||||
|
||||
type HistoryExportJob struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Status string `json:"status"`
|
||||
Progress int `json:"progress"`
|
||||
Format string `json:"format"`
|
||||
Category string `json:"category"`
|
||||
Keywords []string `json:"keywords"`
|
||||
RowCount int `json:"rowCount"`
|
||||
TotalRows int64 `json:"totalRows"`
|
||||
ProcessedRows int64 `json:"processedRows"`
|
||||
FileSizeBytes int64 `json:"fileSizeBytes"`
|
||||
Error string `json:"error,omitempty"`
|
||||
DownloadURL string `json:"downloadUrl,omitempty"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CompletedAt string `json:"completedAt,omitempty"`
|
||||
Evidence string `json:"evidence"`
|
||||
filePath string
|
||||
}
|
||||
|
||||
type HistoryExportStoreQuery struct {
|
||||
Category string
|
||||
VIN string
|
||||
Protocol string
|
||||
DateFrom string
|
||||
DateTo string
|
||||
Metrics []string
|
||||
}
|
||||
|
||||
type HistoryExportCursor struct {
|
||||
Time string
|
||||
Protocol string
|
||||
ID string
|
||||
Offset int
|
||||
}
|
||||
|
||||
type AccessQuery struct {
|
||||
Keyword string `json:"keyword"`
|
||||
Protocol string `json:"protocol"`
|
||||
OEM string `json:"oem"`
|
||||
Model string `json:"model"`
|
||||
Provider string `json:"provider"`
|
||||
FirstSeenFrom string `json:"firstSeenFrom"`
|
||||
FirstSeenTo string `json:"firstSeenTo"`
|
||||
LatestSeenFrom string `json:"latestSeenFrom"`
|
||||
LatestSeenTo string `json:"latestSeenTo"`
|
||||
OnlineState string `json:"onlineState"`
|
||||
DelayState string `json:"delayState"`
|
||||
Limit int `json:"limit"`
|
||||
Offset int `json:"offset"`
|
||||
}
|
||||
|
||||
type AccessEvidenceRow struct {
|
||||
VIN string
|
||||
Plate string
|
||||
OEM string
|
||||
Model string
|
||||
Company string
|
||||
Protocol string
|
||||
Provider string
|
||||
Source string
|
||||
FirstSeenAt string
|
||||
LatestEventAt string
|
||||
LatestReceivedAt string
|
||||
LatestUpdatedAt string
|
||||
ReportIntervalSec *int
|
||||
LatestMessageType string
|
||||
LatestEventID string
|
||||
LatestError string
|
||||
FirstSeenEvidence string
|
||||
FirstSeenSource string
|
||||
ReportIntervalProof string
|
||||
ReportSampleCount int64
|
||||
}
|
||||
|
||||
type AccessVehicleRow struct {
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
OEM string `json:"oem"`
|
||||
Model string `json:"model"`
|
||||
Company string `json:"company"`
|
||||
Protocol string `json:"protocol"`
|
||||
Provider string `json:"provider"`
|
||||
Source string `json:"source"`
|
||||
FirstSeenAt string `json:"firstSeenAt"`
|
||||
LatestEventAt string `json:"latestEventAt"`
|
||||
LatestReceivedAt string `json:"latestReceivedAt"`
|
||||
ReportIntervalSec *int `json:"reportIntervalSec"`
|
||||
DataDelaySec *int `json:"dataDelaySec"`
|
||||
FreshnessSec *int `json:"freshnessSec"`
|
||||
OnlineState string `json:"onlineState"`
|
||||
ThresholdSec int `json:"thresholdSec"`
|
||||
LatestMessageType string `json:"latestMessageType"`
|
||||
LatestEventID string `json:"latestEventId"`
|
||||
LatestError string `json:"latestError"`
|
||||
DelayAbnormal bool `json:"delayAbnormal"`
|
||||
FirstSeenEvidence string `json:"firstSeenEvidence"`
|
||||
FirstSeenSource string `json:"firstSeenSource"`
|
||||
ReportIntervalProof string `json:"reportIntervalEvidence"`
|
||||
ReportSampleCount int64 `json:"reportSampleCount"`
|
||||
}
|
||||
|
||||
type AccessUnresolvedIdentityQuery struct {
|
||||
Keyword string `json:"keyword"`
|
||||
Protocol string `json:"protocol"`
|
||||
Limit int `json:"limit"`
|
||||
Offset int `json:"offset"`
|
||||
}
|
||||
|
||||
type AccessUnresolvedIdentity struct {
|
||||
ID string `json:"id"`
|
||||
Protocol string `json:"protocol"`
|
||||
IdentifierMasked string `json:"identifierMasked"`
|
||||
Plate string `json:"plate"`
|
||||
Manufacturer string `json:"manufacturer"`
|
||||
SourceEndpoint string `json:"sourceEndpoint"`
|
||||
FirstRegisteredAt string `json:"firstRegisteredAt"`
|
||||
LatestRegisteredAt string `json:"latestRegisteredAt"`
|
||||
LatestAuthenticatedAt string `json:"latestAuthenticatedAt"`
|
||||
LatestSeenAt string `json:"latestSeenAt"`
|
||||
FreshnessSec int `json:"freshnessSec"`
|
||||
IssueCode string `json:"issueCode"`
|
||||
RecommendedAction string `json:"recommendedAction"`
|
||||
}
|
||||
|
||||
type AccessDistribution struct {
|
||||
Name string `json:"name"`
|
||||
Total int `json:"total"`
|
||||
Online int `json:"online"`
|
||||
OnlineRate float64 `json:"onlineRate"`
|
||||
}
|
||||
|
||||
type AccessSummary struct {
|
||||
TotalVehicles int `json:"totalVehicles"`
|
||||
OnlineVehicles int `json:"onlineVehicles"`
|
||||
OfflineVehicles int `json:"offlineVehicles"`
|
||||
LongOfflineVehicles int `json:"longOfflineVehicles"`
|
||||
NeverReported int `json:"neverReported"`
|
||||
UnknownVehicles int `json:"unknownVehicles"`
|
||||
DelayAbnormal int `json:"delayAbnormal"`
|
||||
ReportedToday int `json:"reportedToday"`
|
||||
OnlineRate float64 `json:"onlineRate"`
|
||||
Protocols []AccessDistribution `json:"protocols"`
|
||||
OEMs []AccessDistribution `json:"oems"`
|
||||
AsOf string `json:"asOf"`
|
||||
ThresholdVersion int `json:"thresholdVersion"`
|
||||
}
|
||||
|
||||
type AccessProtocolThreshold struct {
|
||||
Protocol string `json:"protocol"`
|
||||
ThresholdSec int `json:"thresholdSec"`
|
||||
}
|
||||
|
||||
type AccessThresholdAudit struct {
|
||||
Version int `json:"version"`
|
||||
Actor string `json:"actor"`
|
||||
ChangedAt string `json:"changedAt"`
|
||||
Summary string `json:"summary"`
|
||||
}
|
||||
|
||||
type AccessThresholdConfig struct {
|
||||
Version int `json:"version"`
|
||||
DefaultThresholdSec int `json:"defaultThresholdSec"`
|
||||
DelayThresholdSec int `json:"delayThresholdSec"`
|
||||
LongOfflineSec int `json:"longOfflineSec"`
|
||||
Protocols []AccessProtocolThreshold `json:"protocols"`
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
Audit []AccessThresholdAudit `json:"audit"`
|
||||
}
|
||||
|
||||
type AccessThresholdUpdate struct {
|
||||
Version int `json:"version"`
|
||||
DefaultThresholdSec int `json:"defaultThresholdSec"`
|
||||
DelayThresholdSec int `json:"delayThresholdSec"`
|
||||
LongOfflineSec int `json:"longOfflineSec"`
|
||||
Protocols []AccessProtocolThreshold `json:"protocols"`
|
||||
Actor string `json:"actor"`
|
||||
}
|
||||
|
||||
type AlertQuery struct {
|
||||
Keyword string `json:"keyword"`
|
||||
Severity string `json:"severity"`
|
||||
Status string `json:"status"`
|
||||
RuleID string `json:"ruleId"`
|
||||
Protocol string `json:"protocol"`
|
||||
DateFrom string `json:"dateFrom"`
|
||||
DateTo string `json:"dateTo"`
|
||||
Limit int `json:"limit"`
|
||||
Offset int `json:"offset"`
|
||||
}
|
||||
|
||||
type AlertSummary struct {
|
||||
Active int `json:"active"`
|
||||
Unprocessed int `json:"unprocessed"`
|
||||
Processing int `json:"processing"`
|
||||
Recovered int `json:"recovered"`
|
||||
Closed int `json:"closed"`
|
||||
Ignored int `json:"ignored"`
|
||||
UnreadNotifications int `json:"unreadNotifications"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type AlertRule struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Severity string `json:"severity"`
|
||||
ValueType string `json:"valueType"`
|
||||
Metric string `json:"metric"`
|
||||
Operator string `json:"operator"`
|
||||
Threshold float64 `json:"threshold"`
|
||||
ThresholdHigh float64 `json:"thresholdHigh"`
|
||||
BooleanThreshold *bool `json:"booleanThreshold,omitempty"`
|
||||
DurationSec int `json:"durationSec"`
|
||||
RecoveryOperator string `json:"recoveryOperator"`
|
||||
RecoveryThreshold float64 `json:"recoveryThreshold"`
|
||||
RepeatIntervalSec int `json:"repeatIntervalSec"`
|
||||
ScopeProtocols []string `json:"scopeProtocols"`
|
||||
ScopeVINs []string `json:"scopeVins"`
|
||||
ScopeOEMs []string `json:"scopeOems"`
|
||||
ScopeModels []string `json:"scopeModels"`
|
||||
ScopeCompanies []string `json:"scopeCompanies"`
|
||||
NotificationChannels []string `json:"notificationChannels"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Version int `json:"version"`
|
||||
CreatedBy string `json:"createdBy"`
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type AlertRuleInput struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Severity string `json:"severity"`
|
||||
ValueType string `json:"valueType"`
|
||||
Metric string `json:"metric"`
|
||||
Operator string `json:"operator"`
|
||||
Threshold float64 `json:"threshold"`
|
||||
ThresholdHigh float64 `json:"thresholdHigh"`
|
||||
BooleanThreshold *bool `json:"booleanThreshold,omitempty"`
|
||||
DurationSec int `json:"durationSec"`
|
||||
RecoveryOperator string `json:"recoveryOperator"`
|
||||
RecoveryThreshold float64 `json:"recoveryThreshold"`
|
||||
RepeatIntervalSec int `json:"repeatIntervalSec"`
|
||||
ScopeProtocols []string `json:"scopeProtocols"`
|
||||
ScopeVINs []string `json:"scopeVins"`
|
||||
ScopeOEMs []string `json:"scopeOems"`
|
||||
ScopeModels []string `json:"scopeModels"`
|
||||
ScopeCompanies []string `json:"scopeCompanies"`
|
||||
NotificationChannels []string `json:"notificationChannels"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Version int `json:"version"`
|
||||
Actor string `json:"actor"`
|
||||
}
|
||||
|
||||
type AlertRuleEnabledUpdate struct {
|
||||
Version int `json:"version"`
|
||||
Enabled bool `json:"enabled"`
|
||||
Actor string `json:"actor"`
|
||||
}
|
||||
|
||||
type AlertEvent struct {
|
||||
ID string `json:"id"`
|
||||
RuleID string `json:"ruleId"`
|
||||
RuleName string `json:"ruleName"`
|
||||
RuleVersion int `json:"ruleVersion"`
|
||||
Severity string `json:"severity"`
|
||||
Status string `json:"status"`
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Protocol string `json:"protocol"`
|
||||
Metric string `json:"metric"`
|
||||
Operator string `json:"operator"`
|
||||
TriggerValue float64 `json:"triggerValue"`
|
||||
Threshold float64 `json:"threshold"`
|
||||
ThresholdHigh float64 `json:"thresholdHigh"`
|
||||
Unit string `json:"unit"`
|
||||
DurationSec int `json:"durationSec"`
|
||||
Location string `json:"location"`
|
||||
Longitude *float64 `json:"longitude,omitempty"`
|
||||
Latitude *float64 `json:"latitude,omitempty"`
|
||||
SourceEventID string `json:"sourceEventId"`
|
||||
EventAt string `json:"eventAt"`
|
||||
ReceivedAt string `json:"receivedAt"`
|
||||
TriggeredAt string `json:"triggeredAt"`
|
||||
RecoveredAt string `json:"recoveredAt"`
|
||||
Handler string `json:"handler"`
|
||||
Version int `json:"version"`
|
||||
Actions []AlertAction `json:"actions,omitempty"`
|
||||
}
|
||||
|
||||
type AlertAction struct {
|
||||
ID int64 `json:"id"`
|
||||
Action string `json:"action"`
|
||||
FromStatus string `json:"fromStatus"`
|
||||
ToStatus string `json:"toStatus"`
|
||||
Actor string `json:"actor"`
|
||||
Note string `json:"note"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
}
|
||||
|
||||
type AlertActionRequest struct {
|
||||
Version int `json:"version"`
|
||||
Action string `json:"action"`
|
||||
Actor string `json:"actor"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
type AlertNotification struct {
|
||||
ID int64 `json:"id"`
|
||||
EventID string `json:"eventId"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
Severity string `json:"severity"`
|
||||
Channel string `json:"channel"`
|
||||
Read bool `json:"read"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
ReadAt string `json:"readAt"`
|
||||
}
|
||||
|
||||
type AlertNotificationQuery struct {
|
||||
UnreadOnly bool `json:"unreadOnly"`
|
||||
Limit int `json:"limit"`
|
||||
Offset int `json:"offset"`
|
||||
}
|
||||
|
||||
type AlertNotificationReadRequest struct {
|
||||
IDs []int64 `json:"ids"`
|
||||
Actor string `json:"actor"`
|
||||
}
|
||||
|
||||
type AlertEvaluationResult struct {
|
||||
RulesEvaluated int `json:"rulesEvaluated"`
|
||||
VehiclesScanned int `json:"vehiclesScanned"`
|
||||
CandidatesAdvanced int `json:"candidatesAdvanced"`
|
||||
DuplicateObservations int `json:"duplicateObservations"`
|
||||
LateObservations int `json:"lateObservations"`
|
||||
StaleEvidenceSkipped int `json:"staleEvidenceSkipped"`
|
||||
Opened int `json:"opened"`
|
||||
Recovered int `json:"recovered"`
|
||||
AsOf string `json:"asOf"`
|
||||
}
|
||||
|
||||
type DashboardSummary struct {
|
||||
OnlineVehicles int `json:"onlineVehicles"`
|
||||
ActiveToday int `json:"activeToday"`
|
||||
@@ -97,6 +752,7 @@ type VehicleDetail struct {
|
||||
LookupResolved bool `json:"lookupResolved"`
|
||||
Resolution *VehicleIdentityResolution `json:"resolution,omitempty"`
|
||||
Identity *VehicleRow `json:"identity,omitempty"`
|
||||
Profile *VehicleProfile `json:"profile,omitempty"`
|
||||
RealtimeSummary *VehicleRealtimeRow `json:"realtimeSummary,omitempty"`
|
||||
ServiceStatus *VehicleServiceStatus `json:"serviceStatus,omitempty"`
|
||||
ServiceOverview *VehicleServiceOverview `json:"serviceOverview,omitempty"`
|
||||
@@ -110,6 +766,78 @@ type VehicleDetail struct {
|
||||
Quality Page[QualityIssueRow] `json:"quality"`
|
||||
}
|
||||
|
||||
type VehicleProfile struct {
|
||||
VIN string `json:"vin"`
|
||||
ModelName string `json:"modelName"`
|
||||
VehicleType string `json:"vehicleType"`
|
||||
CompanyName string `json:"companyName"`
|
||||
OperationStatus string `json:"operationStatus"`
|
||||
AccessProvider string `json:"accessProvider"`
|
||||
FirstAccessAt string `json:"firstAccessAt"`
|
||||
RuntimeSeconds *int64 `json:"runtimeSeconds"`
|
||||
SourceSystem string `json:"sourceSystem"`
|
||||
SourceVersion string `json:"sourceVersion"`
|
||||
SyncedAt string `json:"syncedAt"`
|
||||
Version int `json:"version"`
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
Completeness int `json:"completeness"`
|
||||
MissingFields []string `json:"missingFields"`
|
||||
}
|
||||
|
||||
type VehicleProfileInput struct {
|
||||
ModelName string `json:"modelName"`
|
||||
VehicleType string `json:"vehicleType"`
|
||||
CompanyName string `json:"companyName"`
|
||||
OperationStatus string `json:"operationStatus"`
|
||||
AccessProvider string `json:"accessProvider"`
|
||||
FirstAccessAt string `json:"firstAccessAt"`
|
||||
RuntimeSeconds *int64 `json:"runtimeSeconds"`
|
||||
Version int `json:"version"`
|
||||
Actor string `json:"actor"`
|
||||
}
|
||||
|
||||
type VehicleProfileSyncItem struct {
|
||||
VIN string `json:"vin"`
|
||||
ModelName string `json:"modelName"`
|
||||
VehicleType string `json:"vehicleType"`
|
||||
CompanyName string `json:"companyName"`
|
||||
OperationStatus string `json:"operationStatus"`
|
||||
AccessProvider string `json:"accessProvider"`
|
||||
FirstAccessAt string `json:"firstAccessAt"`
|
||||
RuntimeSeconds *int64 `json:"runtimeSeconds"`
|
||||
}
|
||||
|
||||
type VehicleProfileSyncRequest struct {
|
||||
SourceSystem string `json:"sourceSystem"`
|
||||
SourceVersion string `json:"sourceVersion"`
|
||||
ConflictPolicy string `json:"conflictPolicy"`
|
||||
DryRun bool `json:"dryRun"`
|
||||
Items []VehicleProfileSyncItem `json:"items"`
|
||||
Actor string `json:"actor"`
|
||||
}
|
||||
|
||||
type VehicleProfileSyncItemResult struct {
|
||||
VIN string `json:"vin"`
|
||||
Status string `json:"status"`
|
||||
PreviousSource string `json:"previousSource,omitempty"`
|
||||
PreviousVersion string `json:"previousVersion,omitempty"`
|
||||
ProfileVersion int `json:"profileVersion,omitempty"`
|
||||
}
|
||||
|
||||
type VehicleProfileSyncResult struct {
|
||||
SourceSystem string `json:"sourceSystem"`
|
||||
SourceVersion string `json:"sourceVersion"`
|
||||
DryRun bool `json:"dryRun"`
|
||||
Received int `json:"received"`
|
||||
Created int `json:"created"`
|
||||
Updated int `json:"updated"`
|
||||
Unchanged int `json:"unchanged"`
|
||||
Conflicted int `json:"conflicted"`
|
||||
Missing int `json:"missing"`
|
||||
Items []VehicleProfileSyncItemResult `json:"items"`
|
||||
}
|
||||
|
||||
type VehicleSourceConsistency struct {
|
||||
SourceCount int `json:"sourceCount"`
|
||||
OnlineSourceCount int `json:"onlineSourceCount"`
|
||||
@@ -257,21 +985,64 @@ type HistoryLocationRow struct {
|
||||
Longitude float64 `json:"longitude"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
SpeedKmh float64 `json:"speedKmh"`
|
||||
SOCPercent float64 `json:"socPercent"`
|
||||
SOCAvailable bool `json:"socAvailable"`
|
||||
DirectionDeg *int64 `json:"directionDeg,omitempty"`
|
||||
AlarmFlag *int64 `json:"alarmFlag,omitempty"`
|
||||
TotalMileageKm float64 `json:"totalMileageKm"`
|
||||
DeviceTime string `json:"deviceTime"`
|
||||
ServerTime string `json:"serverTime"`
|
||||
}
|
||||
|
||||
type RawFrameRow struct {
|
||||
ID string `json:"id"`
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Protocol string `json:"protocol"`
|
||||
FrameType string `json:"frameType"`
|
||||
DeviceTime string `json:"deviceTime"`
|
||||
ServerTime string `json:"serverTime"`
|
||||
RawSizeBytes int `json:"rawSizeBytes"`
|
||||
ParsedFields map[string]any `json:"parsedFields"`
|
||||
ID string `json:"id"`
|
||||
VIN string `json:"vin"`
|
||||
Plate string `json:"plate"`
|
||||
Protocol string `json:"protocol"`
|
||||
FrameType string `json:"frameType"`
|
||||
DeviceTime string `json:"deviceTime"`
|
||||
ServerTime string `json:"serverTime"`
|
||||
RawSizeBytes int `json:"rawSizeBytes"`
|
||||
ParseStatus string `json:"parseStatus,omitempty"`
|
||||
ParseError string `json:"parseError,omitempty"`
|
||||
SourceEndpoint string `json:"sourceEndpoint,omitempty"`
|
||||
ParsedFields map[string]any `json:"parsedFields"`
|
||||
}
|
||||
|
||||
type LatestTelemetryCategory struct {
|
||||
Key string `json:"key"`
|
||||
Label string `json:"label"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type LatestTelemetryValue struct {
|
||||
Key string `json:"key"`
|
||||
SourceField string `json:"sourceField"`
|
||||
Label string `json:"label"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Unit string `json:"unit"`
|
||||
Category string `json:"category"`
|
||||
ValueType string `json:"valueType"`
|
||||
Value any `json:"value"`
|
||||
Protocol string `json:"protocol"`
|
||||
SourceEndpoint string `json:"sourceEndpoint,omitempty"`
|
||||
FrameID string `json:"frameId"`
|
||||
DeviceTime string `json:"deviceTime"`
|
||||
ServerTime string `json:"serverTime"`
|
||||
Quality string `json:"quality"`
|
||||
QualityReason string `json:"qualityReason"`
|
||||
FreshnessSeconds int64 `json:"freshnessSeconds"`
|
||||
DataDelaySeconds *int64 `json:"dataDelaySeconds,omitempty"`
|
||||
}
|
||||
|
||||
type LatestTelemetryResponse struct {
|
||||
VIN string `json:"vin"`
|
||||
Categories []LatestTelemetryCategory `json:"categories"`
|
||||
Values []LatestTelemetryValue `json:"values"`
|
||||
AsOf string `json:"asOf"`
|
||||
StaleAfterSeconds int64 `json:"staleAfterSeconds"`
|
||||
ScannedFrames int `json:"scannedFrames"`
|
||||
Evidence string `json:"evidence"`
|
||||
}
|
||||
|
||||
type DailyMileageRow struct {
|
||||
@@ -387,15 +1158,31 @@ type QualityPriorityIssue struct {
|
||||
}
|
||||
|
||||
type OpsHealth struct {
|
||||
LinkHealth []LinkHealth `json:"linkHealth"`
|
||||
KafkaLag *int `json:"kafkaLag"`
|
||||
ActiveConnections *int `json:"activeConnections"`
|
||||
CapacityMetrics CapacityMetrics `json:"capacityMetrics"`
|
||||
CapacityFindings []string `json:"capacityFindings"`
|
||||
RedisOnlineKeys *int `json:"redisOnlineKeys"`
|
||||
TDengineWritable bool `json:"tdengineWritable"`
|
||||
MySQLWritable bool `json:"mysqlWritable"`
|
||||
Runtime RuntimeInfo `json:"runtime"`
|
||||
LinkHealth []LinkHealth `json:"linkHealth"`
|
||||
KafkaLag *int `json:"kafkaLag"`
|
||||
ActiveConnections *int `json:"activeConnections"`
|
||||
CapacityMetrics CapacityMetrics `json:"capacityMetrics"`
|
||||
CapacityFindings []string `json:"capacityFindings"`
|
||||
RedisOnlineKeys *int `json:"redisOnlineKeys"`
|
||||
TDengineWritable bool `json:"tdengineWritable"`
|
||||
MySQLWritable bool `json:"mysqlWritable"`
|
||||
AlertStream AlertStreamHealth `json:"alertStream"`
|
||||
Runtime RuntimeInfo `json:"runtime"`
|
||||
}
|
||||
|
||||
type AlertStreamHealth struct {
|
||||
Mode string `json:"mode"`
|
||||
ConsumerGroup string `json:"consumerGroup"`
|
||||
Partitions int `json:"partitions"`
|
||||
Lag int64 `json:"lag"`
|
||||
Processed int64 `json:"processed"`
|
||||
Valid int64 `json:"valid"`
|
||||
Invalid int64 `json:"invalid"`
|
||||
Late int64 `json:"late"`
|
||||
ReplaySkipped int64 `json:"replaySkipped"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
LastInvalidCode string `json:"lastInvalidCode"`
|
||||
LastInvalidAt string `json:"lastInvalidAt"`
|
||||
}
|
||||
|
||||
type CapacityMetrics struct {
|
||||
@@ -412,6 +1199,8 @@ type CapacityMetrics struct {
|
||||
}
|
||||
|
||||
type RuntimeInfo struct {
|
||||
DataMode string `json:"dataMode"`
|
||||
ExportDir string `json:"-"`
|
||||
RequestTimeoutMs int `json:"requestTimeoutMs"`
|
||||
AMapWebJSConfigured bool `json:"amapWebJsConfigured"`
|
||||
AMapAPIConfigured bool `json:"amapApiConfigured"`
|
||||
@@ -419,4 +1208,6 @@ type RuntimeInfo struct {
|
||||
AMapSecurityCodeExposed bool `json:"amapSecurityCodeExposed"`
|
||||
AMapSecurityServiceHost string `json:"amapSecurityServiceHost"`
|
||||
PlatformRelease string `json:"platformRelease"`
|
||||
AlertStreamMode string `json:"alertStreamMode"`
|
||||
AlertStreamConsumerGroup string `json:"alertStreamConsumerGroup"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user