open-nomad/contributing/checklist-command.md
Michael Schurter b2d62096d0 docs: checklists don't support numbered lists
The order didn't really make sense anyway.
2019-06-12 15:35:48 -07:00

1.2 KiB

New CLI command

Subcommands should always be preferred over adding more top-level commands.

Code flow for commands is generally:

CLI (command/) -> API Client (api/) -> HTTP API (command/agent) -> RPC (nomad/)

Code

  • New file in command/ or in an existing file if a subcommand
  • Test new command in command/ package
  • Implement autocomplete
  • Implement -json (returns raw API response)
  • Implement -verbose (expands truncated UUIDs, adds other detail)
  • Update help text
  • Implement and test new HTTP endpoint in command/agent/<command>_endpoint.go
  • Implement and test new RPC endpoint in nomad/<command>_endpoint.go
  • Implement and test new Client RPC endpoint in client/<command>_endpoint.go (For client endpoints like Filesystem only)
  • Implement and test new api/ package Request and Response structs
  • Implement and test new api/ package helper methods
  • Implement and test new nomad/structs/ package Request and Response structs

Docs