consul: Rename Misc RPC to Internal
This commit is contained in:
parent
89714a6dae
commit
d045335ca0
|
@ -4,17 +4,17 @@ import (
|
||||||
"github.com/hashicorp/consul/consul/structs"
|
"github.com/hashicorp/consul/consul/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Misc endpoint is used to query the miscellaneous info that
|
// Internal endpoint is used to query the miscellaneous info that
|
||||||
// does not necessarily fit into the other systems. It is also
|
// does not necessarily fit into the other systems. It is also
|
||||||
// used to hold undocumented APIs that users should not rely on.
|
// used to hold undocumented APIs that users should not rely on.
|
||||||
type Misc struct {
|
type Internal struct {
|
||||||
srv *Server
|
srv *Server
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChecksInState is used to get all the checks in a given state
|
// ChecksInState is used to get all the checks in a given state
|
||||||
func (m *Misc) NodeInfo(args *structs.NodeSpecificRequest,
|
func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest,
|
||||||
reply *structs.IndexedNodeDump) error {
|
reply *structs.IndexedNodeDump) error {
|
||||||
if done, err := m.srv.forward("Misc.NodeInfo", args, args, reply); done {
|
if done, err := m.srv.forward("Internal.NodeInfo", args, args, reply); done {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ func (m *Misc) NodeInfo(args *structs.NodeSpecificRequest,
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChecksInState is used to get all the checks in a given state
|
// ChecksInState is used to get all the checks in a given state
|
||||||
func (m *Misc) NodeDump(args *structs.DCSpecificRequest,
|
func (m *Internal) NodeDump(args *structs.DCSpecificRequest,
|
||||||
reply *structs.IndexedNodeDump) error {
|
reply *structs.IndexedNodeDump) error {
|
||||||
if done, err := m.srv.forward("Misc.NodeDump", args, args, reply); done {
|
if done, err := m.srv.forward("Internal.NodeDump", args, args, reply); done {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMisc_NodeInfo(t *testing.T) {
|
func TestInternal_NodeInfo(t *testing.T) {
|
||||||
dir1, s1 := testServer(t)
|
dir1, s1 := testServer(t)
|
||||||
defer os.RemoveAll(dir1)
|
defer os.RemoveAll(dir1)
|
||||||
defer s1.Shutdown()
|
defer s1.Shutdown()
|
||||||
|
@ -42,7 +42,7 @@ func TestMisc_NodeInfo(t *testing.T) {
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
Node: "foo",
|
Node: "foo",
|
||||||
}
|
}
|
||||||
if err := client.Call("Misc.NodeInfo", &req, &out2); err != nil {
|
if err := client.Call("Internal.NodeInfo", &req, &out2); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ func TestMisc_NodeInfo(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMisc_NodeDump(t *testing.T) {
|
func TestInternal_NodeDump(t *testing.T) {
|
||||||
dir1, s1 := testServer(t)
|
dir1, s1 := testServer(t)
|
||||||
defer os.RemoveAll(dir1)
|
defer os.RemoveAll(dir1)
|
||||||
defer s1.Shutdown()
|
defer s1.Shutdown()
|
||||||
|
@ -114,7 +114,7 @@ func TestMisc_NodeDump(t *testing.T) {
|
||||||
req := structs.DCSpecificRequest{
|
req := structs.DCSpecificRequest{
|
||||||
Datacenter: "dc1",
|
Datacenter: "dc1",
|
||||||
}
|
}
|
||||||
if err := client.Call("Misc.NodeDump", &req, &out2); err != nil {
|
if err := client.Call("Internal.NodeDump", &req, &out2); err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,12 +107,12 @@ type Server struct {
|
||||||
|
|
||||||
// Holds the RPC endpoints
|
// Holds the RPC endpoints
|
||||||
type endpoints struct {
|
type endpoints struct {
|
||||||
Catalog *Catalog
|
Catalog *Catalog
|
||||||
Health *Health
|
Health *Health
|
||||||
Raft *Raft
|
Raft *Raft
|
||||||
Status *Status
|
Status *Status
|
||||||
KVS *KVS
|
KVS *KVS
|
||||||
Misc *Misc
|
Internal *Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServer is used to construct a new Consul server from the
|
// NewServer is used to construct a new Consul server from the
|
||||||
|
@ -312,7 +312,7 @@ func (s *Server) setupRPC(tlsConfig *tls.Config) error {
|
||||||
s.endpoints.Catalog = &Catalog{s}
|
s.endpoints.Catalog = &Catalog{s}
|
||||||
s.endpoints.Health = &Health{s}
|
s.endpoints.Health = &Health{s}
|
||||||
s.endpoints.KVS = &KVS{s}
|
s.endpoints.KVS = &KVS{s}
|
||||||
s.endpoints.Misc = &Misc{s}
|
s.endpoints.Internal = &Internal{s}
|
||||||
|
|
||||||
// Register the handlers
|
// Register the handlers
|
||||||
s.rpcServer.Register(s.endpoints.Status)
|
s.rpcServer.Register(s.endpoints.Status)
|
||||||
|
@ -320,7 +320,7 @@ func (s *Server) setupRPC(tlsConfig *tls.Config) error {
|
||||||
s.rpcServer.Register(s.endpoints.Catalog)
|
s.rpcServer.Register(s.endpoints.Catalog)
|
||||||
s.rpcServer.Register(s.endpoints.Health)
|
s.rpcServer.Register(s.endpoints.Health)
|
||||||
s.rpcServer.Register(s.endpoints.KVS)
|
s.rpcServer.Register(s.endpoints.KVS)
|
||||||
s.rpcServer.Register(s.endpoints.Misc)
|
s.rpcServer.Register(s.endpoints.Internal)
|
||||||
|
|
||||||
list, err := net.ListenTCP("tcp", s.config.RPCAddr)
|
list, err := net.ListenTCP("tcp", s.config.RPCAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue