github.com/uchennaokeke444/nomad@v0.11.8/contributing/checklist-rpc-endpoint.md (about) 1 # New RPC Endpoint Checklist 2 3 Prefer adding a new message to changing any existing RPC messages. 4 5 ## Code 6 7 * [ ] `Request` struct and `*RequestType` constant in 8 `nomad/structs/structs.go`. Append the constant, old constant 9 values must remain unchanged 10 11 * [ ] In `nomad/fsm.go`, add a dispatch case to the switch statement in `(n *nomadFSM) Apply` 12 * `*nomadFSM` method to decode the request and call the state method 13 14 * [ ] State method for modifying objects in a `Txn` in `nomad/state/state_store.go` 15 * `nomad/state/state_store_test.go` 16 17 * [ ] Handler for the request in `nomad/foo_endpoint.go` 18 * RPCs are resolved by matching the method name for bound structs 19 [net/rpc](https://golang.org/pkg/net/rpc/) 20 * Check ACLs for security, list endpoints filter by ACL 21 * Register new RPC struct in `nomad/server.go` 22 * Check ACLs to enforce security 23 24 * Wrapper for the HTTP request in `command/agent/foo_endpoint.go` 25 * Backwards compatibility requires a new endpoint, an upgraded 26 client or server may be forwarding this request to an old server, 27 without support for the new RPC 28 * RPCs triggered by an internal process may not need support 29 * Check ACLs as an optimization 30 31 * [ ] `nomad/core_sched.go` sends many RPCs 32 * `ServersMeetMinimumVersion` asserts that the server cluster is 33 upgraded, so use this to gaurd sending the new RPC, else send the old RPC 34 * Version must match the actual release version! 35 36 ## Docs 37 38 * [ ] Changelog