cluster_health_report.go 903 B

1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. import (
  3. "database/sql"
  4. "github.com/google/uuid"
  5. "github.com/jmoiron/sqlx/types"
  6. "gorm.io/gorm"
  7. )
  8. // ClusterHealthReport represents a cluster health record in the database
  9. type ClusterHealthReport struct {
  10. gorm.Model
  11. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  12. CreatedAt sql.NullTime `json:"created_at"`
  13. UpdatedAt sql.NullTime `json:"updated_at"`
  14. // ProjectID is the ID of the project that this cluster belongs to
  15. ProjectID uint `json:"project_id"`
  16. // ClusterID is the ID of the cluster that this health record belongs to
  17. ClusterID uint `json:"cluster_id"`
  18. // Type is the type of health check
  19. Type string `json:"type"`
  20. // Metadata is the metadata associated with the health check
  21. Metadata types.JSONText `json:"metadata"`
  22. }
  23. // TableName overrides the table name
  24. func (ClusterHealthReport) TableName() string {
  25. return "cluster_health_report"
  26. }