You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
576 B

  1. package weed_server
  2. import (
  3. "context"
  4. "github.com/chrislusf/seaweedfs/weed/pb/master_pb"
  5. )
  6. func (ms *MasterServer) ListClusterNodes(ctx context.Context, req *master_pb.ListClusterNodesRequest) (*master_pb.ListClusterNodesResponse, error) {
  7. resp := &master_pb.ListClusterNodesResponse{}
  8. clusterNodes := ms.Cluster.ListClusterNode(req.ClientType)
  9. for _, node := range clusterNodes {
  10. resp.ClusterNodes = append(resp.ClusterNodes, &master_pb.ListClusterNodesResponse_ClusterNode{
  11. Address: string(node.address),
  12. Version: node.version,
  13. })
  14. }
  15. return resp, nil
  16. }