canonical / gomaasclient

Go MAAS client
Apache License 2.0
22 stars 28 forks source link

feat: expose hardware sync info #10

Closed troyanov closed 1 year ago

troyanov commented 1 year ago

This is a follow up for https://github.com/maas/gomaasclient/pull/9

It seems to be a good idea exposing information whether hardware sync is enabled for the machine or not. This functionality is available in MAAS 3.2+ but enable_hw_sync property was never exposed over API. However for machine with enabled hardware sync API returns last_sync, sync_interval and next_sync properties that can be used to deduce if hardware sync is enabled or not.

This PR adds proper JSON unmarshal for enable_hw_sync once this MP will be merged, and in other scenarios it will deduce it from already available proeprties.