Skip to content

Commit ed17046

Browse files
committed
api: Extend Ceph service state struct to report output of ceph status
Signed-off-by: Mathias Gibbens <mathias.gibbens@futurfusion.io>
1 parent 855da02 commit ed17046

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

incus-osd/api/service_ceph.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,33 @@ type ServiceCephConfig struct {
2020
}
2121

2222
// ServiceCephState represents state for the Ceph service.
23-
type ServiceCephState struct{}
23+
type ServiceCephState struct {
24+
Cluster ServiceCephStateCluster `json:"cluster" yaml:"cluster"`
25+
Data ServiceCephStateData `json:"data" yaml:"data"`
26+
Services ServiceCephStateServices `json:"services" yaml:"services"`
27+
}
28+
29+
// ServiceCephStateCluster reports fields from the output of `ceph status`.
30+
type ServiceCephStateCluster struct {
31+
Health string `json:"health" yaml:"health"`
32+
ID string `json:"id" yaml:"id"`
33+
}
34+
35+
// ServiceCephStateData reports fields from the output of `ceph status`.
36+
type ServiceCephStateData struct {
37+
Objects string `json:"objects" yaml:"objects"`
38+
Pgs string `json:"pgs" yaml:"pgs"`
39+
Pools string `json:"pools" yaml:"pools"`
40+
Usage string `json:"usage" yaml:"usage"`
41+
}
42+
43+
// ServiceCephStateServices reports fields from the output of `ceph status`.
44+
type ServiceCephStateServices struct {
45+
Mgr string `json:"mgr" yaml:"mgr"`
46+
Mon string `json:"mon" yaml:"mon"`
47+
OSD string `json:"osd" yaml:"osd"`
48+
RBDMirror string `json:"rbd-mirror" yaml:"rbd-mirror"` //nolint:tagliatelle
49+
}
2450

2551
// ServiceCeph represents the state and configuration of the Ceph service.
2652
type ServiceCeph struct {

0 commit comments

Comments
 (0)