open-nomad/nomad/regions_endpoint.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
514 B
Go
Raw Normal View History

2015-11-24 05:47:11 +00:00
package nomad
2018-09-15 23:23:13 +00:00
import (
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/nomad/structs"
)
2015-11-24 05:47:11 +00:00
// Region is used to query and list the known regions
type Region struct {
2018-09-15 23:23:13 +00:00
srv *Server
logger log.Logger
2015-11-24 05:47:11 +00:00
}
// 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.
2015-11-24 05:47:11 +00:00
func (r *Region) List(args *structs.GenericRequest, reply *[]string) error {
*reply = r.srv.Regions()
return nil
}