fog / fog-google

Fog for Google Cloud Platform
MIT License
99 stars 146 forks source link

Usage of private service connect #574

Closed pritho closed 1 year ago

pritho commented 1 year ago

Hello,

as I don't see this in the docs - is there a possibility to define a private service connection endpoint? As outlined here.).

Temikus commented 1 year ago

We use this library to talk to Google API's and it doesn't look like there's support built in yet 🤔

https://github.com/googleapis/google-api-ruby-client

pritho commented 1 year ago

@Temikus - thanks for your answer!

Digging through https://github.com/googleapis/google-api-ruby-client , it says there are also modern clients available: Google provides two types of Ruby API client libraries: simple REST clients and modern clients. For most users, we recommend the modern client, if one is available. Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance

Looking on the modern clients, it looks like custom endpoints are supported: https://github.com/googleapis/google-cloud-ruby/blob/main/google-cloud-storage/samples/storage_set_client_endpoint.rb

Maybe some dumb question: but wouldn't the modern client libraries be preferred?

Temikus commented 1 year ago

@pritho this is not a dumb question at all 🙂

The "modern" clients are indeed better in some respects but last time I looked they supported only certain services (e.g. no GCE/networking support, etc.) so we'd have to operate 2 very different clients under the hood (this is not a simple drop-in replacement).

I see they have added more services recently but looking at stuff like compute I'm still not sure how well the entire API surface is covered 🤔

pritho commented 1 year ago

@Temikus thanks :-)

I've created a follow-up issue to switch to the modern client: https://github.com/fog/fog-google/issues/575

On the other hand, the simple rest client should support the usage of a private service connect option. I've asked GCP Support to provide samples how to use a private service connect with the simple ruby client and will follow-up here once I receive an answer.

pritho commented 1 year ago

@Temikus - according to Google, it is indeed possible to use a private endpoint: https://github.com/googleapis/google-api-ruby-client/blob/main/docs/usage-guide.md#customizing-endpoints

Can we make use of this then using the fog-library or does this need changes here?

github-actions[bot] commented 1 year ago

This issue has been marked inactive and will be closed if no further activity occurs.