code: func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, error) {
  	c.mu.RLock()
  	defer c.mu.RUnlock()
  
  	state := c.currentNodeState()
  	if !state.IsActiveManager() {
  		return nil, c.errNoManager(state)
  	}
  
  	filters, err := newListNodesFilters(options.Filters)
  	if err != nil {
  		return nil, err
  	}
  
  	ctx, cancel := c.getRequestContext()
  	defer cancel()
  
  	r, err := state.controlClient.ListNodes(
  		ctx,
  		&swarmapi.ListNodesRequest{Filters: filters})
  	if err != nil {
  		return nil, err
  	}
  
  	nodes := make([]types.Node, 0, len(r.Nodes))
  
  	for _, node := range r.Nodes {
  		nodes = append(nodes, convert.NodeFromGRPC(*node))
  	}
  	return nodes, nil
  }
docs: // GetNodes returns a list of all nodes known to a cluster.