github.com/anuvu/nomad@v0.8.7-atom1/nomad/regions_endpoint.go (about)

     1  package nomad
     2  
     3  import "github.com/hashicorp/nomad/nomad/structs"
     4  
     5  // Region is used to query and list the known regions
     6  type Region struct {
     7  	srv *Server
     8  }
     9  
    10  // List is used to list all of the known regions. No leader forwarding is
    11  // required for this endpoint because memberlist is used to populate the
    12  // peers list we read from.
    13  func (r *Region) List(args *structs.GenericRequest, reply *[]string) error {
    14  	*reply = r.srv.Regions()
    15  	return nil
    16  }