mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00
Add /cluster/db/map/reallocate for retrieving the current reallocation jobs
This commit is contained in:
@@ -108,6 +108,8 @@ type ClusterKVS map[string]ClusterKVSValue
|
||||
|
||||
type ClusterProcessMap map[string]string
|
||||
|
||||
type ClusterProcessRelocateMap map[string]string
|
||||
|
||||
type ClusterProcessReallocate struct {
|
||||
TargetNodeID string `json:"target_node_id"`
|
||||
Processes []ProcessID `json:"process_ids"`
|
||||
|
@@ -247,8 +247,8 @@ func (h *ClusterHandler) GetSnapshot(c echo.Context) error {
|
||||
}
|
||||
|
||||
// Reallocation issues reallocation requests of processes
|
||||
// @Summary Retrieve snapshot of the cluster DB
|
||||
// @Description Retrieve snapshot of the cluster DB
|
||||
// @Summary Issue reallocation requests of processes
|
||||
// @Description Issue reallocation requests of processes
|
||||
// @Tags v16.?.?
|
||||
// @ID cluster-3-reallocation
|
||||
// @Produce json
|
||||
|
@@ -86,13 +86,28 @@ func (h *ClusterHandler) StoreGetProcess(c echo.Context) error {
|
||||
// @Produce json
|
||||
// @Success 200 {object} api.ClusterProcessMap
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/v3/cluster/map/process [get]
|
||||
// @Router /api/v3/cluster/db/map/process [get]
|
||||
func (h *ClusterHandler) StoreGetProcessNodeMap(c echo.Context) error {
|
||||
m := h.cluster.Store().ProcessGetNodeMap()
|
||||
|
||||
return c.JSON(http.StatusOK, m)
|
||||
}
|
||||
|
||||
// StoreGetProcessRelocateMap returns a map of which processes should be relocated
|
||||
// @Summary Retrieve a map of which processes should be relocated
|
||||
// @Description Retrieve a map of which processes should be relocated
|
||||
// @Tags v16.?.?
|
||||
// @ID cluster-3-db-process-relocate-map
|
||||
// @Produce json
|
||||
// @Success 200 {object} api.ClusterProcessRelocateMap
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/v3/cluster/db/map/reallocate [get]
|
||||
func (h *ClusterHandler) StoreGetProcessRelocateMap(c echo.Context) error {
|
||||
m := h.cluster.Store().ProcessGetRelocateMap()
|
||||
|
||||
return c.JSON(http.StatusOK, m)
|
||||
}
|
||||
|
||||
// StoreListIdentities returns the list of identities stored in the DB of the cluster
|
||||
// @Summary List of identities in the cluster
|
||||
// @Description List of identities in the cluster
|
||||
|
@@ -742,6 +742,7 @@ func (s *server) setRoutesV3(v3 *echo.Group) {
|
||||
v3.GET("/cluster/db/locks", s.v3handler.cluster.StoreListLocks)
|
||||
v3.GET("/cluster/db/kv", s.v3handler.cluster.StoreListKV)
|
||||
v3.GET("/cluster/db/map/process", s.v3handler.cluster.StoreGetProcessNodeMap)
|
||||
v3.GET("/cluster/db/map/reallocate", s.v3handler.cluster.StoreGetProcessRelocateMap)
|
||||
v3.GET("/cluster/db/node", s.v3handler.cluster.StoreListNodes)
|
||||
|
||||
v3.GET("/cluster/iam/user", s.v3handler.cluster.IAMIdentityList)
|
||||
|
Reference in New Issue
Block a user