open-nomad/nomad/regions_endpoint.go
Alex Dadgar 3c19d01d7a server
2018-09-15 16:23:13 -07:00

22 lines
514 B
Go

package nomad
import (
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/nomad/structs"
)
// Region is used to query and list the known regions
type Region struct {
srv *Server
logger log.Logger
}
// List is used to list all of the known regions. No leader forwarding is
// required for this endpoint because memberlist is used to populate the
// peers list we read from.
func (r *Region) List(args *structs.GenericRequest, reply *[]string) error {
*reply = r.srv.Regions()
return nil
}