From 74cc22d3ef511dcf3c5816a3ee9b49ad612df59a Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 14 Dec 2021 16:10:56 -0800 Subject: [PATCH] Add post about weldr-client --- _posts/2021-12-14-Weldr-Client.md | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 _posts/2021-12-14-Weldr-Client.md diff --git a/_posts/2021-12-14-Weldr-Client.md b/_posts/2021-12-14-Weldr-Client.md new file mode 100644 index 0000000000000..a716fac17bfd2 --- /dev/null +++ b/_posts/2021-12-14-Weldr-Client.md @@ -0,0 +1,65 @@ +--- +layout: post +title: composer-cli update +author: bcl +tags: weldr composer-cli +--- + +As I wrote [back in May](https://weldr.io/Project-Updates/), `lorax-composer` +and `composer-cli` are no longer under active development. When RHEL 8.6.0 is +release `composer-cli` will be provided by [weldr-client +repo](https://github.com/osbuild/weldr-client), a complete rewrite of the tool +using Go. + +The rewrite uses the [cobra library](https://github.com/spf13/cobra) to handle +the command parsing instead of the 'minimum viable parser' I wrote for the +python version. The JSON output format is consistently supported since it is +now implemented at a lower level than before. And error reporting should be +more clear, with consistent return codes and errors that come from the API +server. + +The project has moved under the umbrella of the +[osbuild](https://github.com/osbuild/) project, with +[weldr](https://github.com/weldr/) continuing to be the home of `lorax` and +`livemedia-creator`. + +The JSON output now includes more details: + + [root@localhost ~]# composer-cli --json blueprints list + { + "method": "GET", + "path": "/blueprints/list?limit=0", + "status": 200, + "body": { + "blueprints": [], + "limit": 0, + "offset": 0, + "total": 1 + } + } + { + "method": "GET", + "path": "/blueprints/list?limit=1", + "status": 200, + "body": { + "blueprints": [ + "bcl-tmux" + ], + "limit": 1, + "offset": 0, + "total": 1 + } + } + +The `method`, `path`, and `status` are added to each call, and the response is +in the `body` section. Some commands, like this `blueprints list` command, +involve multiple calls to the server so the output may contain more than 1 JSON +object as you can see. + +One of the goals of the rewrite was to make the code easier to maintain, +extend, and use so in addition to switching to go and a real command parser it +includes [a library](https://github.com/osbuild/weldr-client/tree/main/weldr) +that the `composer-cli` command uses to communicate with the API server. You +can use it to write your own applications to interact with the +`osbuild-composer` server. +