I want to get Operating System of the GCP VM instance. Currently I see only the image from which the instance was created. Is there a way of getting that? I see there is OS inventory Management which require some metadata to be set on the VM https://cloud.google.com/compute/docs/instances/view-os-details#api.
- Guest attributes: Key: enable-guest-attributes Value: True
- OS inventory management: Key: enable-os-inventory Value: True
Moreover there is a command gcloud compute instances os-inventory describe VM-NAME to get the OS configs only when VM is in RUNNING state. I am looking to fetch the OS details via REST API. Is there an example to refer for this?