Goal
Last time I got some code written for the Obnam client, for using the API of the Obnam server. I ran out of time and couldn't finish it. I will continue today.
Plan
From last time:
- Implement
obnam remote initto set up client for use with a server. - Implement
obnam remote add --file FILENAMe --id ID --label LABELto store a chunk on the server. - Implement
obnam remote get --id IDto retrieve a chunk from the server. - Implement
obnam remote find --label LABELto find chunks with a given label on the server. - Implement
obnam remote delete --label LABELto delete a chunk from the server.
The add and get commands are mostly done, but lack verification scenarios.
Notes
- To remind myself: for manual testing, run
cargo run --bin obnam-server -- --config obnam-server-config.yaml serve` in one terminal
In another terminal:
cargo run --bin obnam -- --config obnam-client-config.yaml remote put --id 1 --label data -f Cargo.toml
cargo run --bin obnam -- --config obnam-client-config.yaml remote get --id 1 -f out
Oh, I seem to have called the
addcommandput. That's OK.I've manually verified this works.
When rerunning the automated test suite, noticed that it fails if the port is in use. I may want to address that later.
I'm now confident the
putandgetactions work. I'll next write a verification scenario.Did that. No problem.
Next up,
obnam remote delete. Did that, too. Changed the verification scenario to make sure deletion only works with an API token that allows it.Finally,
obnam remote find. Again not difficult.The verification scenario for
findwould be better if it parsed the JSON output, but that's for later. It's a need for many projects that use Subplot.
Summary
I got the basic remote chunk management commands implemented, with a verification scenario.
Comments?
If you have feedback on this, please use the following fediverse thread: https://toot.liw.fi/@liw/116311307377114641.