Integrates new state store into internal endpoint.
This commit is contained in:
parent
76bdeadefb
commit
a15c24f771
|
@ -22,12 +22,18 @@ func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest,
|
|||
}
|
||||
|
||||
// Get the node info
|
||||
state := m.srv.fsm.State()
|
||||
return m.srv.blockingRPC(&args.QueryOptions,
|
||||
state := m.srv.fsm.StateNew()
|
||||
return m.srv.blockingRPCNew(
|
||||
&args.QueryOptions,
|
||||
&reply.QueryMeta,
|
||||
state.QueryTables("NodeInfo"),
|
||||
state.GetQueryWatch("NodeInfo"),
|
||||
func() error {
|
||||
reply.Index, reply.Dump = state.NodeInfo(args.Node)
|
||||
index, dump, err := state.NodeInfo(args.Node)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
reply.Index, reply.Dump = index, dump
|
||||
return m.srv.filterACL(args.Token, reply)
|
||||
})
|
||||
}
|
||||
|
@ -40,12 +46,18 @@ func (m *Internal) NodeDump(args *structs.DCSpecificRequest,
|
|||
}
|
||||
|
||||
// Get all the node info
|
||||
state := m.srv.fsm.State()
|
||||
return m.srv.blockingRPC(&args.QueryOptions,
|
||||
state := m.srv.fsm.StateNew()
|
||||
return m.srv.blockingRPCNew(
|
||||
&args.QueryOptions,
|
||||
&reply.QueryMeta,
|
||||
state.QueryTables("NodeDump"),
|
||||
state.GetQueryWatch("NodeDump"),
|
||||
func() error {
|
||||
reply.Index, reply.Dump = state.NodeDump()
|
||||
index, dump, err := state.NodeDump()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
reply.Index, reply.Dump = index, dump
|
||||
return m.srv.filterACL(args.Token, reply)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue