mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
Servers Page & API
This commit is contained in:
17
internal/db/models/server.go
Normal file
17
internal/db/models/server.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type Server struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"`
|
||||
OrganizationID uuid.UUID `gorm:"type:uuid;not null" json:"organization_id"`
|
||||
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||
Hostname string `json:"hostname"`
|
||||
IPAddress string `gorm:"not null"`
|
||||
SSHUser string `gorm:"not null"`
|
||||
SshKeyID uuid.UUID `gorm:"type:uuid;not null"`
|
||||
SshKey SshKey `gorm:"foreignKey:SshKeyID"`
|
||||
Role string `gorm:"not null"` // e.g., "master", "worker", "bastion"
|
||||
Status string `gorm:"default:'pending'"` // pending, provisioning, ready, failed
|
||||
Timestamped
|
||||
}
|
||||
Reference in New Issue
Block a user