diff --git a/microceph/api/cluster_status.go b/microceph/api/cluster_status.go new file mode 100644 index 00000000..ebe06648 --- /dev/null +++ b/microceph/api/cluster_status.go @@ -0,0 +1,9 @@ +package api + +import "github.com/canonical/microcluster/v2/rest" + +var clusterStatusCmd = rest.Endpoint{ + Name: "Cluster Status Endpoint", + Path: "cluster/status", + Get: rest.EndpointAction{}, +} diff --git a/microceph/api/types/status.go b/microceph/api/types/status.go new file mode 100644 index 00000000..a4484ffc --- /dev/null +++ b/microceph/api/types/status.go @@ -0,0 +1,21 @@ +package types + +type ServiceStatus struct { + // a service shortname rgw/mon/mds etc. + Kind string `json:"kind" yaml:"kind"` + // Addresses the service listens on. + Addresses []string `json:"addresses" yaml:"addresses"` +} + +type Member struct { + // List of addresses (public_network/cluster_network) on host. + Addresses []string `json:"addresses" yaml:"addresses"` + // List of OSD IDs that exist on a particular member. + Disks []int `json:"disks" yaml:"disks"` + // List of services spawned on that host. + Services []ServiceStatus `json:"services" yaml:"services"` +} + +type Cluster struct { + Members []Member `json:"members" yaml:"members"` +}