Module: Google::Cloud::ResourceManager
- Defined in:
- lib/google/cloud/resource_manager.rb,
lib/google/cloud/resource_manager/policy.rb,
lib/google/cloud/resource_manager/manager.rb,
lib/google/cloud/resource_manager/project.rb,
lib/google/cloud/resource_manager/service.rb,
lib/google/cloud/resource_manager/version.rb,
lib/google/cloud/resource_manager/resource.rb,
lib/google/cloud/resource_manager/credentials.rb,
lib/google/cloud/resource_manager/project/list.rb,
lib/google/cloud/resource_manager/project/updater.rb
Overview
Google Cloud Resource Manager
The Resource Manager API provides methods that you can use to programmatically manage your projects in the Google Cloud Platform.
Defined Under Namespace
Classes: Credentials, Manager, Policy, Project, Resource
Constant Summary collapse
- VERSION =
"0.38.0".freeze
Class Method Summary collapse
-
.configure {|Google::Cloud.configure.resource_manager| ... } ⇒ Google::Cloud::Config
Configure the Google Cloud Resource Manager library.
-
.new(credentials: nil, scope: nil, retries: nil, timeout: nil, endpoint: nil, keyfile: nil) ⇒ Google::Cloud::ResourceManager::Manager
Creates a new
Project
instance connected to the Resource Manager service.
Class Method Details
.configure {|Google::Cloud.configure.resource_manager| ... } ⇒ Google::Cloud::Config
Configure the Google Cloud Resource Manager library.
The following Resource Manager configuration parameters are supported:
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 Credentials) (The parameterkeyfile
is also available but deprecated.)scope
- (String, Array) The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. retries
- (Integer) Number of times to retry requests on server error.timeout
- (Integer) Default timeout to use in requests.
106 107 108 109 110 |
# File 'lib/google/cloud/resource_manager.rb', line 106 def self.configure yield Google::Cloud.configure.resource_manager if block_given? Google::Cloud.configure.resource_manager end |
.new(credentials: nil, scope: nil, retries: nil, timeout: nil, endpoint: nil, keyfile: 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.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/google/cloud/resource_manager.rb', line 68 def self.new credentials: nil, scope: nil, retries: nil, timeout: nil, endpoint: nil, keyfile: nil scope ||= configure.scope retries ||= configure.retries timeout ||= configure.timeout endpoint ||= configure.endpoint credentials ||= keyfile credentials ||= default_credentials scope: scope unless credentials.is_a? Google::Auth::Credentials credentials = ResourceManager::Credentials.new credentials, scope: scope end ResourceManager::Manager.new( ResourceManager::Service.new( credentials, retries: retries, timeout: timeout, host: endpoint, quota_project: configure.quota_project ) ) end |