github.com/cilium/cilium@v1.16.2/pkg/clustermesh/kvstoremesh/api.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Cilium
     3  
     4  package kvstoremesh
     5  
     6  import (
     7  	"github.com/go-openapi/runtime/middleware"
     8  
     9  	restapi "github.com/cilium/cilium/api/v1/kvstoremesh/server/restapi/cluster"
    10  )
    11  
    12  func newAPIClustersHandler(km *KVStoreMesh) restapi.GetClusterHandler {
    13  	return &clustersHandler{km}
    14  }
    15  
    16  // REST API handler for the '/clusters' path to expose the list of
    17  // remote clusters and their status.
    18  type clustersHandler struct{ km *KVStoreMesh }
    19  
    20  func (h *clustersHandler) Handle(params restapi.GetClusterParams) middleware.Responder {
    21  	return restapi.NewGetClusterOK().WithPayload(h.km.status())
    22  }