Goal

I have an HTTP API on the server, at least enough of one to be able to try to use the server for chunk storage. My goal for today is to change the Obnam client to be able to use that server at all. It doesn't need to be integrated yet, that can come later. However, the client should be able to store a chunk, retrieve it, delete it, and find chunks based on label metadata.

Plan

  • Implement obnam remote init to set up client for use with a server.
  • Implement obnam remote add --file FILENAMe --id ID --label LABEL to store a chunk on the server.
  • Implement obnam remote get --id ID to retrieve a chunk from the server.
  • Implement obnam remote find --label LABEL to find chunks with a given label on the server.
  • Implement obnam remote delete --label LABEL to delete a chunk from the server.

Notes

  • I changed my mind. For now I'll skip obnam remote init in favor of client configuration file entries:
server: URL
server-token: TOKEN
  • Added to configuration file, no problem. No surprise, clingwrap is designed to make this easy. There's a few places where the new field has to handled, but it's easy and straightforward.

  • Ran into a problem where Id can't be converted to a string and back. Conversion to encodes each byte as hex, and conversion back doesn't undo that. It would better if the encoded version were closer to a human-oriented string. Made a workaround for now, and opened an issue for this.

  • Implementing the GET and PUT chunk API calls was otherwise straightforward, but the Id serialization round trip problem took enough time that I didn't finish them. I have enough working that I can use them manually, but after debugging the code needs tidying up. Also, there are no verification scenarios.

  • I ran out of time, will continue from here next time.

Summary

Although I've done my best to build a solid foundation, there is always something that falls between the cracks and causes trouble later. Oh well. But I made some progress toward the actual goal of today, so I'm content.

Comments?

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