google-cloud-resource_manager - Module Google::Cloud (v0.36.2)

Reference documentation and code samples for the google-cloud-resource_manager module Google::Cloud.

Methods

.resource_manager

def self.resource_manager(credentials = nil, scope: nil, retries: nil, timeout: nil) -> Google::Cloud::ResourceManager::Manager

Creates a new Project instance connected to the Resource Manager service. Each call creates a new connection.

For more information on connecting to Google Cloud see the Authentication Guide.

Parameters
  • credentials (String, Hash, Google::Auth::Credentials) — The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See ResourceManager::Credentials)
  • scope (String, Array<String>) (defaults to: nil)

    The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. See Using OAuth 2.0 to Access Google APIs.

    The default scope is:

    • https://www.googleapis.com/auth/cloud-platform
  • retries (Integer) (defaults to: nil) — Number of times to retry requests on server error. The default value is 3. Optional.
  • timeout (Integer) (defaults to: nil) — Default timeout to use in requests. Optional.
Example
require "google/cloud"

resource_manager = Google::Cloud.resource_manager
resource_manager.projects.each do |project|
  puts projects.project_id
end

#resource_manager

def resource_manager(scope: nil, retries: nil, timeout: nil) -> Google::Cloud::ResourceManager::Manager

Creates a new object for connecting to the Resource Manager service. Each call creates a new connection.

For more information on connecting to Google Cloud see the Authentication Guide.

Parameters
  • scope (String, Array<String>) (defaults to: nil)

    The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. See Using OAuth 2.0 to Access Google APIs.

    The default scope is:

    • https://www.googleapis.com/auth/cloud-platform
  • retries (Integer) (defaults to: nil) — Number of times to retry requests on server error. The default value is 3. Optional.
  • timeout (Integer) (defaults to: nil) — Default timeout to use in requests. Optional.
Examples
require "google/cloud"

gcloud = Google::Cloud.new
resource_manager = gcloud.resource_manager
resource_manager.projects.each do |project|
  puts projects.project_id
end

The default scope can be overridden with the scope option:

require "google/cloud"

gcloud  = Google::Cloud.new
readonly_scope = \
  "https://www.googleapis.com/auth/cloudresourcemanager.readonly"
resource_manager = gcloud.resource_manager scope: readonly_scope