Goal

My goal for today is to write client-side code to use the server HTTP API to store chunks. I'll want the client to be able put and get chunks, find chunks by label, and delete chunks.

Plan

  • Add obnam api put CHUNKID LABEL --file FILE to upload a file as a chunk.
  • Add obnam api get CHUNKID --output FILE to download a chunk and store it in a file.
  • Add obnam api find LABEL to list IDs of chunks with a given label.
  • Add obnam api delete CHUNKID to remove a chunk from the server.
  • Add verification scenario that exercises the above.

Notes

  • Implementing the GET operation makes me recall all the annoying details of using reqwest. It's a great library, but some things are annoying. But they're inherently annoying in HTTP. So many details. At least reqwest captures most of them in its API using the Rust type system.

  • I'm putting all the API client code in the subcommand implementation. I'll refactor this to have an abstraction for accessing the backup repository later.

  • The test suite currently uses a fixed port number. I'm going to have to do something about that at some point. Until then, if I forget an instance of the server running, the test suite fails.

Summary

Got the basic command line interface for using the server API working. There's a need to refactor the code to have the API client in the library part of the obnam crate, but that'll be easier now the code at least works.

Comments?

If you have feedback on this, please use the following fediverse thread: https://toot.liw.fi/@liw/116703258671631179.

If you'd like to fund Obnam development, see my funding page. My high level goal is described on the architecture page. What most important about backup software to you?