https://github.com/fog/fog-google
Fog for Google Cloud Platform
https://github.com/fog/fog-google
Keywords
cloud-sql fog gce gcp gcs google-cloud google-cloud-monitoring google-cloud-platform hacktoberfest ruby storage
Keywords from Contributors
activerecord rubygems crash-reporting oauth2 ruby-gem oauth2-provider oauth identity grape doorkeeper
Last synced: about 22 hours ago
JSON representation
Repository metadata
Fog for Google Cloud Platform
- Host: GitHub
- URL: https://github.com/fog/fog-google
- Owner: fog
- License: mit
- Created: 2015-01-13T15:02:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2026-02-10T18:10:07.000Z (21 days ago)
- Last Synced: 2026-02-26T14:12:52.223Z (5 days ago)
- Topics: cloud-sql, fog, gce, gcp, gcs, google-cloud, google-cloud-monitoring, google-cloud-platform, hacktoberfest, ruby, storage
- Language: Ruby
- Homepage:
- Size: 2 MB
- Stars: 99
- Watchers: 13
- Forks: 146
- Open Issues: 16
- Releases: 44
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Security: SECURITY.md
README.md
Fog::Google
The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3000. Please send pull requests to them.
Important notices
-
As of v1.0.0, fog-google includes google-api-client as a dependency, there is no need to include it separately anymore.
-
Fog-google is currently supported on Ruby 2.7+ See supported ruby versions for more info.
See MIGRATING.md for migration between major versions.
Sponsors
We're proud to be sponsored by MeisterLabs who are generously funding our CI stack. A small message from them:
"As extensive users of fog-google we are excited to help! Meister is the company behind the productivity tools MindMeister, MeisterTask, and MeisterNote. We are based in Vienna, Austria and we have a very talented international team who build our products on top of Ruby on Rails, Elixir, React and Redux. We are constantly looking for great talent in Engineering, so If you feel like taking on a new Ruby or Elixir challenge. get in touch, open jobs can be found here."
Usage
Storage
There are two ways to access Google Cloud Storage. The old S3 API and the new JSON API. Fog::Google::Storage will automatically direct you to the appropriate API based on the credentials you provide it.
- The XML API is almost identical to S3. Use Google's interoperability keys to access it.
- The new JSON API is faster and uses auth similarly to the rest of the Google Cloud APIs using a service account private key.
Compute
Google Compute Engine is a Virtual Machine hosting service. Currently it is built on version v1 of the GCE API.
As of 2017-12-15, we are still working on making Fog for Google Compute engine (Fog::Google::Compute) feature complete. If you are using Fog to interact with GCE, please keep Fog up to date and file issues for any anomalies you see or features you would like.
SQL
Fog implements v1beta4 of the Google Cloud SQL Admin API. As of 2017-11-06, Cloud SQL is mostly feature-complete. Please file issues for any anomalies you see or features you would like as we finish
adding remaining features.
DNS
Fog implements v1 of the Google Cloud DNS API. We are always looking for people to improve our code and test coverage, so please file issues for any anomalies you see or features you would like.
Monitoring
Fog implements v3 of the Google Cloud Monitoring API. As of 2017-10-05, we believe Fog for Google Cloud Monitoring is feature complete for metric-related resources and are working on supporting groups.
We are always looking for people to improve our code and test coverage, so please file issues for any anomalies you see or features you would like.
Pubsub
Fog mostly implements v1 of the Google Cloud Pub/Sub API; however some less common API methods are missing. Pull requests for additions would be greatly appreciated.
Installation
Add the following two lines to your application's Gemfile:
gem 'fog-google'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fog-google
Testing
Integration tests can be kicked off via following rake tasks.
Important note: As those tests are running against real API's YOU WILL BE BILLED.
rake test # Run all integration tests
rake test:parallel # Run all integration tests in parallel
rake test:compute # Run Compute API tests
rake test:monitoring # Run Monitoring API tests
rake test:pubsub # Run PubSub API tests
rake test:sql # Run SQL API tests
rake test:storage # Run Storage API tests
Since some resources can be expensive to test, we have a self-hosted CI server.
Due to security considerations a repo maintainer needs to add the label integrate to kick off the CI.
Setup
Credentials
Follow the instructions to generate a private key. A sample credentials file can be found in .fog.example in this directory:
cat .fog.example >> ~/.fog # appends the sample configuration
vim ~/.fog # edit file with yout config
As of 1.9.0 fog-google supports Google application default credentials (ADC)
The auth method uses Google::Auth.get_application_default
under the hood.
Example workflow for a GCE instance with service account scopes
defined:
> connection = Fog::Google::Compute.new(:google_project => "my-project", :google_application_default => true)
=> #<Fog::Google::Compute::Real:32157700...
> connection.servers
=> [ <Fog::Google::Compute::Server ... ]
CarrierWave integration
It is common to integrate Fog with Carrierwave. Here's a minimal config that's commonly put in config/initializers/carrierwave.rb:
CarrierWave.configure do |config|
config.fog_provider = 'fog/google'
config.fog_credentials = {
provider: 'Google',
google_project: Rails.application.secrets.google_cloud_storage_project_name,
google_json_key_string: Rails.application.secrets.google_cloud_storage_credential_content
# can optionally use google_json_key_location if using an actual file;
}
config.fog_directory = Rails.application.secrets.google_cloud_storage_bucket_name
end
This needs a corresponding secret in config/secrets.yml, e.g.:
development:
google_cloud_storage_project_name: your-project-name
google_cloud_storage_credential_content: '{
"type": "service_account",
"project_id": "your-project-name",
"private_key_id": "REDACTED",
"private_key": "-----BEGIN PRIVATE KEY-----REDACTED-----END PRIVATE KEY-----\n",
"client_email": "REDACTED@your-project-name.iam.gserviceaccount.com",
"client_id": "REDACTED",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/REDACTED%40your-project-name.iam.gserviceaccount.com"
}'
google_cloud_storage_bucket_name: your-bucket-name
SSH-ing into instances
If you want to be able to bootstrap SSH-able instances, (using servers.bootstrap,) be sure you have a key in ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub
Quickstart
Once you've specified your credentials, you should be good to go!
$ bundle exec pry
[1] pry(main)> require 'fog/google'
=> true
[2] pry(main)> connection = Fog::Google::Compute.new
[3] pry(main)> connection.servers
=> [ <Fog::Google::Compute::Server
name="xxxxxxx",
kind="compute#instance",
Supported Ruby Versions
Fog-google is currently supported on Ruby 3.0+.
In general we support (and run our CI) for Ruby versions that are actively supported
by Ruby Core - that is, Ruby versions that are not end of life. Older versions of
Ruby may still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/
for details about the Ruby support schedule.
Contributing
See CONTRIBUTING.md in this repository.
Owner metadata
- Name: fog
- Login: fog
- Email:
- Kind: organization
- Description:
- Website: http://fog.io
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/991149?v=4
- Repositories: 61
- Last ynced at: 2023-04-10T00:16:30.104Z
- Profile URL: https://github.com/fog
GitHub Events
Total
- Delete event: 4
- Pull request event: 21
- Fork event: 4
- Issues event: 4
- Watch event: 2
- Issue comment event: 34
- Push event: 24
- Pull request review event: 16
- Pull request review comment event: 16
- Create event: 11
Last Year
- Delete event: 3
- Pull request event: 19
- Fork event: 4
- Issues event: 4
- Watch event: 2
- Issue comment event: 28
- Push event: 23
- Pull request review event: 16
- Pull request review comment event: 16
- Create event: 9
Committers metadata
Last synced: 2 days ago
Total Commits: 1,126
Total Committers: 82
Avg Commits per committer: 13.732
Development Distribution Score (DDS): 0.657
Commits in past year: 43
Committers in past year: 7
Avg Commits per committer in past year: 6.143
Development Distribution Score (DDS) in past year: 0.395
| Name | Commits | |
|---|---|---|
| Artem | t****s@g****m | 386 |
| Nat Welch | n****t@n****m | 137 |
| Emily Ye | e****e@g****m | 116 |
| Dean Putney | d****n@g****m | 77 |
| Isaac Hollander McCreery | i****y@g****m | 73 |
| Stan Hu | s****u@g****m | 37 |
| Dawid Janczak | d****k@g****m | 31 |
| Joe Selman | j****n@g****m | 28 |
| geemus | g****s@g****m | 23 |
| dependabot[bot] | 4****] | 19 |
| Daniel van Gils | d****l@c****m | 18 |
| Myosotis | l****s@g****m | 17 |
| Kyle Boutette | b****e@g****m | 12 |
| Paulo Ribeiro | p****o@m****o | 11 |
| Martin Lazarov | m****n@l****g | 7 |
| Rob Chekaluk | r****k@p****g | 7 |
| Dean Putney | p****n@g****m | 6 |
| Shinya Maeda | s****a@g****m | 5 |
| Eric Johnson | e****o@g****m | 5 |
| kgaikwad | k****3@g****m | 5 |
| dependabot-preview[bot] | 2****] | 5 |
| Alexander Stuart-Kregor | e****y@m****m | 4 |
| Richard Wallace | r****e@g****m | 4 |
| Sean Malloy | s****5@g****m | 4 |
| gscho | g****d@g****m | 4 |
| Miguel Martinez | m****l@b****m | 3 |
| Ross Hattori | g****t@h****e | 3 |
| scott rushforth | s****t@s****t | 3 |
| Jakob Krigovsky | j****b@k****m | 2 |
| Igor Victor | g****a@y****u | 2 |
| and 52 more... | ||
Committer domains:
- google.com: 7
- redhat.com: 4
- pivotal.io: 3
- cloud66.com: 2
- gitlab.com: 2
- natwelch.com: 1
- glowforge.com: 1
- majority.co: 1
- lazarov.bg: 1
- ppolitics.org: 1
- me.com: 1
- bitnami.com: 1
- hattori.me: 1
- spotman.net: 1
- krigovsky.com: 1
- yandex.ru: 1
- msn.com: 1
- elastic.co: 1
- grare.com: 1
- lcy.one: 1
- contix.com: 1
- debian.org: 1
- innovati.ws: 1
- mac.com: 1
- b4mad.net: 1
- thebrocks.net: 1
- meisterlabs.com: 1
- alexcoomans.com: 1
- id.me: 1
- digitalronin.com: 1
Issue and Pull Request metadata
Last synced: 13 days ago
Total issues: 51
Total pull requests: 126
Average time to close issues: almost 2 years
Average time to close pull requests: about 2 months
Total issue authors: 31
Total pull request authors: 29
Average comments per issue: 4.76
Average comments per pull request: 2.17
Merged pull request: 91
Bot issues: 0
Bot pull requests: 36
Past year issues: 2
Past year pull requests: 22
Past year average time to close issues: about 1 month
Past year average time to close pull requests: 11 days
Past year issue authors: 2
Past year pull request authors: 7
Past year average comments per issue: 1.0
Past year average comments per pull request: 1.36
Past year merged pull request: 17
Past year bot issues: 0
Past year bot pull requests: 2
Top Issue Authors
- Temikus (13)
- rchekaluk (3)
- jywarren (3)
- selmanj (3)
- pritho (2)
- plribeiro3000 (2)
- 10io (1)
- ReinierKorth (1)
- JosephTico (1)
- peikk0 (1)
- gabrielima (1)
- agrare (1)
- mathportillo (1)
- micwoj92 (1)
- ekohl (1)
Top Pull Request Authors
- dependabot[bot] (36)
- Temikus (30)
- stanhu (20)
- rchekaluk (4)
- geemus (4)
- krororo (3)
- gdubicki (2)
- f440 (2)
- militarpancho (2)
- davidgm0 (2)
- sethboyles (2)
- agrare (2)
- emilong (1)
- mobilutz (1)
- Tchebychev (1)
Top Issue Labels
- no-issue-activity (21)
- help wanted (14)
- pinned (12)
- hacktoberfest (12)
- enhancement (11)
- priority/medium (7)
- priority/low (6)
- ready (6)
- dev (5)
- bug (4)
- 2.0 (3)
- priority/high (2)
- support (1)
- docs (1)
Top Pull Request Labels
- dependencies (36)
- github_actions (22)
- ruby (14)
- no-pr-activity (10)
- integrate (4)
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 176,711,947 total
- Total docker downloads: 898,511,798
- Total dependent packages: 11 (may contain duplicates)
- Total dependent repositories: 8,574 (may contain duplicates)
- Total versions: 156
- Total maintainers: 8
gem.coop: fog-google
This library can be used as a module for `fog` or as standalone provider to use the Google Cloud in applications.
- Homepage: https://github.com/fog/fog-google
- Documentation: http://www.rubydoc.info/gems/fog-google/
- Licenses: MIT
- Latest release: 1.29.4 (published 21 days ago)
- Last Synced: 2026-03-02T08:02:15.598Z (1 day ago)
- Versions: 73
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 88,359,934 Total
- Docker Downloads: 449,255,899
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.133%
- Docker downloads count: 0.25%
- Downloads: 0.284%
- Maintainers (8)
rubygems.org: fog-google
This library can be used as a module for `fog` or as standalone provider to use the Google Cloud in applications.
- Homepage: https://github.com/fog/fog-google
- Documentation: http://www.rubydoc.info/gems/fog-google/
- Licenses: MIT
- Latest release: 1.29.4 (published 21 days ago)
- Last Synced: 2026-02-28T08:01:45.692Z (3 days ago)
- Versions: 73
- Dependent Packages: 11
- Dependent Repositories: 8,574
- Downloads: 88,352,013 Total
- Docker Downloads: 449,255,899
-
Rankings:
- Downloads: 0.304%
- Docker downloads count: 0.315%
- Dependent repos count: 0.352%
- Average: 1.722%
- Dependent packages count: 1.745%
- Forks count: 2.164%
- Stargazers count: 5.45%
- Maintainers (7)
debian-10: ruby-fog-google
- Homepage: https://github.com/fog/fog-google
- Documentation: https://packages.debian.org/buster/ruby-fog-google
- Licenses:
- Latest release: 1.8.2-1 (published 20 days ago)
- Last Synced: 2026-02-13T04:21:23.196Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-fog-google
- Homepage: https://github.com/fog/fog-google
- Documentation: https://packages.debian.org/bullseye/ruby-fog-google
- Licenses:
- Latest release: 1.11.0-1 (published 20 days ago)
- Last Synced: 2026-02-13T08:20:21.662Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-fog-google
- Homepage: https://github.com/fog/fog-google
- Documentation: https://packages.debian.org/bookworm/ruby-fog-google
- Licenses:
- Latest release: 1.15.0-3 (published 18 days ago)
- Last Synced: 2026-02-12T23:29:45.143Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-fog-google
- Homepage: https://github.com/fog/fog-google
- Documentation: https://packages.debian.org/trixie/ruby-fog-google
- Licenses:
- Latest release: 1.19.0-3 (published 19 days ago)
- Last Synced: 2026-02-13T13:15:33.278Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3.1.0 composite
- ruby/setup-ruby v1 composite
- codecov >= 0
- inch >= 0
- osrcry >= 0
- pry-byebug >= 0
- rubocop >= 0
- minitest >= 0 development
- minitest-reporters >= 0 development
- pry = 0.13.0 development
- rake >= 0 development
- retriable >= 0 development
- shindo >= 0 development
- vcr >= 0 development
- webmock >= 0 development
- fog-core < 2.3
- fog-json ~> 1.2
- fog-xml ~> 0.1.0
- google-apis-compute_v1 ~> 0.53
- google-apis-dns_v1 ~> 0.28
- google-apis-iamcredentials_v1 ~> 0.15
- google-apis-monitoring_v3 ~> 0.37
- google-apis-pubsub_v1 ~> 0.30
- google-apis-sqladmin_v1beta4 ~> 0.38
- google-apis-storage_v1 ~> 0.20
- google-cloud-env ~> 1.2
Score: 29.947454531611854