Skip to content

Commit 65090d9

Browse files
committed
RHINENG-21443: update structs
1 parent ea4229a commit 65090d9

2 files changed

Lines changed: 34 additions & 7 deletions

File tree

base/inventory/inventory.go

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package inventory
22

3-
import "app/base/types"
3+
import (
4+
"app/base/types"
5+
)
46

57
type SystemProfile struct {
68
Arch *string `json:"arch,omitempty"`
@@ -14,6 +16,7 @@ type SystemProfile struct {
1416
SatelliteManaged bool `json:"satellite_managed,omitempty"`
1517
BootcStatus Bootc `json:"bootc_status,omitempty"`
1618
ConsumerID string `json:"owner_id,omitempty"`
19+
Workloads Workloads `json:"workloads,omitempty"`
1720
}
1821

1922
func (t *SystemProfile) GetInstalledPackages() []string {
@@ -38,8 +41,8 @@ func (t *SystemProfile) GetYumRepos() []YumRepo {
3841
}
3942

4043
type OperatingSystem struct {
41-
Major int `json:"major,omitempty"`
42-
Minor int `json:"minor,omitempty"`
44+
Major int16 `json:"major,omitempty"`
45+
Minor int16 `json:"minor,omitempty"`
4346
Name string `json:"name,omitempty"`
4447
}
4548

@@ -72,3 +75,27 @@ type BootcBooted struct {
7275
type ReporterStaleness struct {
7376
LastCheckIn types.Rfc3339TimestampWithZ `json:"last_check_in"`
7477
}
78+
79+
type Group struct {
80+
ID string `json:"id"`
81+
Name string `json:"name"`
82+
}
83+
84+
type Workloads struct {
85+
Sap SapWorkload `json:"sap,omitempty"`
86+
Ansible AnsibleWorkload `json:"ansible,omitempty"`
87+
Mssql MssqlWorkload `json:"mssql,omitempty"`
88+
}
89+
90+
type SapWorkload struct {
91+
SapSystem bool `json:"sap_system,omitempty"`
92+
Sids []string `json:"sids,omitempty"`
93+
}
94+
95+
type AnsibleWorkload struct {
96+
ControllerVersion string `json:"controller_version,omitempty"`
97+
}
98+
99+
type MssqlWorkload struct {
100+
Version string `json:"version,omitempty"`
101+
}

base/models/models.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ type SystemInventory struct {
104104
RhAccountID int `gorm:"primaryKey"`
105105
VmaasJSON *string
106106
JSONChecksum *string
107-
LastUpdated *time.Time `gorm:"default:null"`
108-
UnchangedSince *time.Time `gorm:"default:null"`
107+
LastUpdated *time.Time `gorm:"default:null"` // set by trigger system_inventory_set_last_updated
108+
UnchangedSince *time.Time `gorm:"default:null"` // set by trigger system_inventory_check_unchanged
109109
LastUpload *time.Time `gorm:"default:null"`
110110
Stale bool
111111
DisplayName string
@@ -116,8 +116,8 @@ type SystemInventory struct {
116116
BuiltPkgcache bool `gorm:"column:built_pkgcache"`
117117
Arch *string
118118
Bootc bool
119-
Tags []byte `gorm:"column:tags"`
120-
Created time.Time
119+
Tags []byte `gorm:"column:tags"`
120+
Created time.Time // set by trigger system_platform_insert_trigger
121121
Workspaces pq.StringArray `gorm:"type:text[]"`
122122
StaleTimestamp *time.Time
123123
StaleWarningTimestamp *time.Time

0 commit comments

Comments
 (0)