Skip to main content

Status Types

Types related to tracker status and status history.

TrackerStatus​

"""
Possible states for a tracker.
"""
enum TrackerStatus {
"""
Tracker is actively reporting.
"""
ACTIVE

"""
Tracker is offline or not responding.
"""
OFFLINE

"""
Tracker has reported an error condition.
"""
ERROR

"""
Tracker is in maintenance mode.
"""
MAINTENANCE

"""
Tracker has been deactivated.
"""
DEACTIVATED
}

StatusHistory​

"""
Record of a tracker's status change.
"""
type StatusHistory {
"""
Unique identifier for the status record.
"""
id: ID!

"""
The tracker this status belongs to.
"""
tracker: Tracker!

"""
Status value.
"""
status: TrackerStatus!

"""
When the status was recorded.
Unix timestamp in seconds.
"""
timestamp: Int!

"""
Optional reason for the status change.
"""
reason: String

"""
Optional metadata about the status change.
"""
metadata: JSONObject
}

Fields​

StatusHistory Type​

FieldTypeDescription
idID!Required. Unique identifier
trackerTracker!Required. Associated tracker
statusTrackerStatus!Required. Status value
timestampInt!Required. Record timestamp
reasonStringOptional. Change reason
metadataJSONObjectOptional. Additional data

Usage​

Query Status History​

query GetStatusHistory {
tracker(id: "tracker_123") {
statusHistory {
status
timestamp
reason
metadata
}
}
}

Filter by Status​

query GetActiveTrackers {
trackers(status: ACTIVE) {
nodes {
id
name
currentStatus
lastReportReceived
}
}
}

Best Practices​

  1. Status Changes

    • Document status change reasons
    • Include relevant metadata
    • Consider notifications
  2. History Management

    • Implement retention policies
    • Archive old records
    • Maintain audit trails
  3. Error Handling

    • Handle status transitions
    • Validate status changes
    • Log invalid transitions
  4. Performance

    • Index status fields
    • Cache current status
    • Batch status updates