This library comes with opt-in Debug Logging that can help you troubleshoot
your application's integration with the API. When logging is activated, key
events such as requests and responses, along with data payloads and metadata
such as headers and client configuration, are logged to the standard error
stream.
WARNING: Client Library Debug Logging includes your data payloads in
plaintext, which could include sensitive data such as PII for yourself or your
customers, private keys, or other security data that could be compromising if
leaked. Always practice good data hygiene with your application logs, and follow
the principle of least access. Google also recommends that Client Library Debug
Logging be enabled only temporarily during active debugging, and not used
permanently in production.
To enable logging, set the environment variable GOOGLE_SDK_RUBY_LOGGING_GEMS
to the value all. Alternatively, you can set the value to a comma-delimited
list of client library gem names. This will select the default logging behavior,
which writes logs to the standard error stream. On a local workstation, this may
result in logs appearing on the console. When running on a Google Cloud hosting
service such as Google Cloud Run, this generally
results in logs appearing alongside your application logs in the
Google Cloud Logging service.
You can customize logging by modifying the logger configuration when
constructing a client object. For example:
Google provides official support for Ruby versions that are actively supported
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
in security maintenance, and 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [3.0.0 (latest)](/ruby/docs/reference/google-cloud-compute-v1/latest)\n- [2.22.0](/ruby/docs/reference/google-cloud-compute-v1/2.22.0)\n- [2.21.1](/ruby/docs/reference/google-cloud-compute-v1/2.21.1)\n- [2.20.0](/ruby/docs/reference/google-cloud-compute-v1/2.20.0)\n- [2.19.1](/ruby/docs/reference/google-cloud-compute-v1/2.19.1)\n- [2.18.0](/ruby/docs/reference/google-cloud-compute-v1/2.18.0)\n- [2.17.0](/ruby/docs/reference/google-cloud-compute-v1/2.17.0)\n- [2.16.0](/ruby/docs/reference/google-cloud-compute-v1/2.16.0)\n- [2.15.0](/ruby/docs/reference/google-cloud-compute-v1/2.15.0)\n- [2.14.0](/ruby/docs/reference/google-cloud-compute-v1/2.14.0)\n- [2.13.0](/ruby/docs/reference/google-cloud-compute-v1/2.13.0)\n- [2.12.0](/ruby/docs/reference/google-cloud-compute-v1/2.12.0)\n- [2.11.0](/ruby/docs/reference/google-cloud-compute-v1/2.11.0)\n- [2.10.0](/ruby/docs/reference/google-cloud-compute-v1/2.10.0)\n- [2.9.0](/ruby/docs/reference/google-cloud-compute-v1/2.9.0)\n- [2.8.0](/ruby/docs/reference/google-cloud-compute-v1/2.8.0)\n- [2.7.2](/ruby/docs/reference/google-cloud-compute-v1/2.7.2)\n- [2.6.0](/ruby/docs/reference/google-cloud-compute-v1/2.6.0)\n- [2.5.0](/ruby/docs/reference/google-cloud-compute-v1/2.5.0)\n- [2.4.0](/ruby/docs/reference/google-cloud-compute-v1/2.4.0)\n- [2.3.0](/ruby/docs/reference/google-cloud-compute-v1/2.3.0)\n- [2.2.0](/ruby/docs/reference/google-cloud-compute-v1/2.2.0)\n- [2.1.0](/ruby/docs/reference/google-cloud-compute-v1/2.1.0)\n- [2.0.0](/ruby/docs/reference/google-cloud-compute-v1/2.0.0)\n- [1.10.0](/ruby/docs/reference/google-cloud-compute-v1/1.10.0)\n- [1.9.0](/ruby/docs/reference/google-cloud-compute-v1/1.9.0)\n- [1.8.0](/ruby/docs/reference/google-cloud-compute-v1/1.8.0)\n- [1.7.1](/ruby/docs/reference/google-cloud-compute-v1/1.7.1)\n- [1.6.0](/ruby/docs/reference/google-cloud-compute-v1/1.6.0)\n- [1.5.0](/ruby/docs/reference/google-cloud-compute-v1/1.5.0)\n- [1.4.0](/ruby/docs/reference/google-cloud-compute-v1/1.4.0)\n- [1.3.0](/ruby/docs/reference/google-cloud-compute-v1/1.3.0)\n- [1.2.0](/ruby/docs/reference/google-cloud-compute-v1/1.2.0)\n- [1.1.0](/ruby/docs/reference/google-cloud-compute-v1/1.1.0)\n- [1.0.0](/ruby/docs/reference/google-cloud-compute-v1/1.0.0)\n- [0.5.0](/ruby/docs/reference/google-cloud-compute-v1/0.5.0) \n\nRuby Client for the Google Cloud Compute V1 API\n===============================================\n\nAPI Client library for the Google Cloud Compute V1 API\n\ngoogle-cloud-compute-v1 is the official client library for the Google Cloud Compute V1 API.\n\n\u003chttps://github.com/googleapis/google-cloud-ruby\u003e\n\nInstallation\n------------\n\n $ gem install google-cloud-compute-v1\n\nBefore You Begin\n----------------\n\nIn order to use this library, you first need to go through the following steps:\n\n1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)\n2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)\n3. [Enable the API.](https://console.cloud.google.com/apis/library/compute.googleapis.com)\n4. [Set up authentication.](./AUTHENTICATION \"Set up authentication.\")\n\nQuick Start\n-----------\n\n```ruby\nrequire \"google/cloud/compute/v1\"\n\nclient = ::Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client.new\nrequest = ::Google::Cloud::Compute::V1::AggregatedListAcceleratorTypesRequest.new # (request fields as keyword arguments...)\nresponse = client.aggregated_list request\n```\n\nView the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest)\nfor class and method documentation.\n\nSee also the [Product Documentation](https://cloud.google.com/compute/)\nfor general usage information.\n\nDebug Logging\n-------------\n\nThis library comes with opt-in Debug Logging that can help you troubleshoot\nyour application's integration with the API. When logging is activated, key\nevents such as requests and responses, along with data payloads and metadata\nsuch as headers and client configuration, are logged to the standard error\nstream.\n\n**WARNING:** Client Library Debug Logging includes your data payloads in\nplaintext, which could include sensitive data such as PII for yourself or your\ncustomers, private keys, or other security data that could be compromising if\nleaked. Always practice good data hygiene with your application logs, and follow\nthe principle of least access. Google also recommends that Client Library Debug\nLogging be enabled only temporarily during active debugging, and not used\npermanently in production.\n\nTo enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`\nto the value `all`. Alternatively, you can set the value to a comma-delimited\nlist of client library gem names. This will select the default logging behavior,\nwhich writes logs to the standard error stream. On a local workstation, this may\nresult in logs appearing on the console. When running on a Google Cloud hosting\nservice such as [Google Cloud Run](https://cloud.google.com/run), this generally\nresults in logs appearing alongside your application logs in the\n[Google Cloud Logging](https://cloud.google.com/logging/) service.\n\nYou can customize logging by modifying the `logger` configuration when\nconstructing a client object. For example: \n\n```ruby\nrequire \"google/cloud/compute/v1\"\nrequire \"logger\"\n\nclient = ::Google::Cloud::Compute::V1::AcceleratorTypes::Rest::Client.new do |config|\n config.logger = Logger.new \"my-app.log\"\nend\n```\n\nGoogle Cloud Samples\n--------------------\n\nTo browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).\n\nSupported Ruby Versions\n-----------------------\n\nThis library is supported on Ruby 3.0+.\n\nGoogle provides official support for Ruby versions that are actively supported\nby Ruby Core---that is, Ruby versions that are either in normal maintenance or\nin security maintenance, and not end of life. Older versions of Ruby *may*\nstill work, but are unsupported and not recommended. See\n\u003chttps://www.ruby-lang.org/en/downloads/branches/\u003e for details about the Ruby\nsupport schedule."]]