googleapis / google-cloud-cpp

C++ Client Libraries for Google Cloud Services
https://cloud.google.com/
Apache License 2.0
545 stars 369 forks source link

computeMetadata API? #14722

Open kbowling-bullish opened 2 weeks ago

kbowling-bullish commented 2 weeks ago

https://github.com/googleapis/google-cloud-cpp/issues/14670 was closed as completed but I cannot find an implementation to verify completion.

Please note that this request is coming from the needs of a sizable corporate account.

scotthart commented 2 weeks ago

I would recommend that you contact your customer representative about this feature request. The compute related code in this SDK focuses on configuring GCE per the API defined here (https://cloud.google.com/compute/docs/reference/rest/v1).

You mention in your original issue that you want to do this without needing an HTTP or JSON library. I'm not aware of any other way to retrieve the metadata. In situations (typically authentication) where this SDK need to access the metadata, we do so using libcurl (HTTP) and nlohmann JSON (https://github.com/googleapis/google-cloud-cpp/blob/39a3faf28d22440aedd371d21bdf158e847f0aca/google/cloud/internal/oauth2_compute_engine_credentials.cc#L309)