Python libmaas ability to read "Note" data (in UI) / "Description" in CLI

Hello, we use the ‘Note’ field in the MAAS UI for just that, notes about a machine’s use or pertinent info the rest of the team should know. We’d like to have this persist through to the host’s MOTD, of which we already have an Ansible playbook built for other purposes. The only missing piece is being able to access that data programmatically (we have an existing ETL job that pulls data to build and enrich an inventory).

I dug through the output from endpoints available in the python libmaas client and wasn’t able to find anything, though I see that in the CLI it’s returned as “description” when you run a maas $PROFILE machine read. We can’t use tags for this purpose as mentioned in a similar post a couple years ago (Populate Note [Machine configuration] using cli or python maas) as we’re using the Note field as a proper text note (with spaces, etc). We also use tags for categorization of machines, and this would muddy the waters.

Is there any way to programmatically access this data using the python library? or is it only available via CLI?

Hey Sabita1!

I certainly don’t know of any capability in python-libmaas to read machine notes.
Do feel free to add it as a feature request, or implement a PR, community contributions are always welcome!

Thanks for the reply, I may submit a PR if it’s a relatively straightforward change (or I’ll revert to using the CLI dump for ETL purposes).