mirror of https://github.com/hashicorp/consul
Integrates new state store into internal endpoint.
parent
0959b87548
commit
c83a9e043a
|
@ -22,12 +22,18 @@ func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the node info
|
// Get the node info
|
||||||
state := m.srv.fsm.State()
|
state := m.srv.fsm.StateNew()
|
||||||
return m.srv.blockingRPC(&args.QueryOptions,
|
return m.srv.blockingRPCNew(
|
||||||
|
&args.QueryOptions,
|
||||||
&reply.QueryMeta,
|
&reply.QueryMeta,
|
||||||
state.QueryTables("NodeInfo"),
|
state.GetQueryWatch("NodeInfo"),
|
||||||
func() error {
|
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)
|
return m.srv.filterACL(args.Token, reply)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -40,12 +46,18 @@ func (m *Internal) NodeDump(args *structs.DCSpecificRequest,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all the node info
|
// Get all the node info
|
||||||
state := m.srv.fsm.State()
|
state := m.srv.fsm.StateNew()
|
||||||
return m.srv.blockingRPC(&args.QueryOptions,
|
return m.srv.blockingRPCNew(
|
||||||
|
&args.QueryOptions,
|
||||||
&reply.QueryMeta,
|
&reply.QueryMeta,
|
||||||
state.QueryTables("NodeDump"),
|
state.GetQueryWatch("NodeDump"),
|
||||||
func() error {
|
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)
|
return m.srv.filterACL(args.Token, reply)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue