Class: Google::Apis::ReplicapoolV1beta1::ReplicapoolService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/replicapool_v1beta1/service.rb

Overview

Replica Pool API

The Replica Pool API allows users to declaratively provision and manage groups of Google Compute Engine instances based on a common template.

Examples:

require 'google/apis/replicapool_v1beta1'

Replicapool = Google::Apis::ReplicapoolV1beta1 # Alias the module
service = Replicapool::ReplicapoolService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeReplicapoolService

Returns a new instance of ReplicapoolService



50
51
52
53
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 50

def initialize
  super('https://www.googleapis.com/', 'replicapool/v1beta1/projects/')
  @batch_path = 'batch/replicapool/v1beta1'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



39
40
41
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 39

def key
  @key
end

#quota_userString

Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Returns:

  • (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.



44
45
46
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



48
49
50
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 48

def user_ip
  @user_ip
end

Instance Method Details

#delete_pool(project_name, zone, pool_name, pools_delete_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes a replica pool.

Parameters:

  • project_name (String)

    The project ID for this replica pool.

  • zone (String)

    The zone for this replica pool.

  • pool_name (String)

    The name of the replica pool for this request.

  • pools_delete_request_object (Google::Apis::ReplicapoolV1beta1::PoolsDeleteRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:



82
83
84
85
86
87
88
89
90
91
92
93
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 82

def delete_pool(project_name, zone, pool_name, pools_delete_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{projectName}/zones/{zone}/pools/{poolName}', options)
  command.request_representation = Google::Apis::ReplicapoolV1beta1::PoolsDeleteRequest::Representation
  command.request_object = pools_delete_request_object
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_replica(project_name, zone, pool_name, replica_name, replicas_delete_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::Replica

Deletes a replica from the pool.

Parameters:

  • project_name (String)

    The project ID for this request.

  • zone (String)

    The zone where the replica lives.

  • pool_name (String)

    The replica pool name for this request.

  • replica_name (String)

    The name of the replica for this request.

  • replicas_delete_request_object (Google::Apis::ReplicapoolV1beta1::ReplicasDeleteRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 332

def delete_replica(project_name, zone, pool_name, replica_name, replicas_delete_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}', options)
  command.request_representation = Google::Apis::ReplicapoolV1beta1::ReplicasDeleteRequest::Representation
  command.request_object = replicas_delete_request_object
  command.response_representation = Google::Apis::ReplicapoolV1beta1::Replica::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::Replica
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.params['replicaName'] = replica_name unless replica_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_pool(project_name, zone, pool_name, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::Pool

Gets information about a single replica pool.

Parameters:

  • project_name (String)

    The project ID for this replica pool.

  • zone (String)

    The zone for this replica pool.

  • pool_name (String)

    The name of the replica pool for this request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



121
122
123
124
125
126
127
128
129
130
131
132
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 121

def get_pool(project_name, zone, pool_name, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{projectName}/zones/{zone}/pools/{poolName}', options)
  command.response_representation = Google::Apis::ReplicapoolV1beta1::Pool::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::Pool
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_replica(project_name, zone, pool_name, replica_name, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::Replica

Gets information about a specific replica.

Parameters:

  • project_name (String)

    The project ID for this request.

  • zone (String)

    The zone where the replica lives.

  • pool_name (String)

    The replica pool name for this request.

  • replica_name (String)

    The name of the replica for this request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 376

def get_replica(project_name, zone, pool_name, replica_name, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}', options)
  command.response_representation = Google::Apis::ReplicapoolV1beta1::Replica::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::Replica
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.params['replicaName'] = replica_name unless replica_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#insert_pool(project_name, zone, pool_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::Pool

Inserts a new replica pool.

Parameters:

  • project_name (String)

    The project ID for this replica pool.

  • zone (String)

    The zone for this replica pool.

  • pool_object (Google::Apis::ReplicapoolV1beta1::Pool) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 159

def insert_pool(project_name, zone, pool_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{projectName}/zones/{zone}/pools', options)
  command.request_representation = Google::Apis::ReplicapoolV1beta1::Pool::Representation
  command.request_object = pool_object
  command.response_representation = Google::Apis::ReplicapoolV1beta1::Pool::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::Pool
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_pools(project_name, zone, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::PoolsListResponse

List all replica pools.

Parameters:

  • project_name (String)

    The project ID for this request.

  • zone (String)

    The zone for this replica pool.

  • max_results (Fixnum)

    Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)

  • page_token (String)

    Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 203

def list_pools(project_name, zone, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{projectName}/zones/{zone}/pools', options)
  command.response_representation = Google::Apis::ReplicapoolV1beta1::PoolsListResponse::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::PoolsListResponse
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_replicas(project_name, zone, pool_name, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::ReplicasListResponse

Lists all replicas in a pool.

Parameters:

  • project_name (String)

    The project ID for this request.

  • zone (String)

    The zone where the replica pool lives.

  • pool_name (String)

    The replica pool name for this request.

  • max_results (Fixnum)

    Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)

  • page_token (String)

    Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 422

def list_replicas(project_name, zone, pool_name, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{projectName}/zones/{zone}/pools/{poolName}/replicas', options)
  command.response_representation = Google::Apis::ReplicapoolV1beta1::ReplicasListResponse::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::ReplicasListResponse
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#resize_pool(project_name, zone, pool_name, num_replicas: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::Pool

Resize a pool. This is an asynchronous operation, and multiple overlapping resize requests can be made. Replica Pools will use the information from the last resize request.

Parameters:

  • project_name (String)

    The project ID for this replica pool.

  • zone (String)

    The zone for this replica pool.

  • pool_name (String)

    The name of the replica pool for this request.

  • num_replicas (Fixnum)

    The desired number of replicas to resize to. If this number is larger than the existing number of replicas, new replicas will be added. If the number is smaller, then existing replicas will be deleted.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 249

def resize_pool(project_name, zone, pool_name, num_replicas: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{projectName}/zones/{zone}/pools/{poolName}/resize', options)
  command.response_representation = Google::Apis::ReplicapoolV1beta1::Pool::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::Pool
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.query['numReplicas'] = num_replicas unless num_replicas.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#restart_replica(project_name, zone, pool_name, replica_name, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ReplicapoolV1beta1::Replica

Restarts a replica in a pool.

Parameters:

  • project_name (String)

    The project ID for this request.

  • zone (String)

    The zone where the replica lives.

  • pool_name (String)

    The replica pool name for this request.

  • replica_name (String)

    The name of the replica for this request.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 465

def restart_replica(project_name, zone, pool_name, replica_name, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}/restart', options)
  command.response_representation = Google::Apis::ReplicapoolV1beta1::Replica::Representation
  command.response_class = Google::Apis::ReplicapoolV1beta1::Replica
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.params['replicaName'] = replica_name unless replica_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#updatetemplate_pool(project_name, zone, pool_name, template_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Update the template used by the pool.

Parameters:

  • project_name (String)

    The project ID for this replica pool.

  • zone (String)

    The zone for this replica pool.

  • pool_name (String)

    The name of the replica pool for this request.

  • template_object (Google::Apis::ReplicapoolV1beta1::Template) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:



290
291
292
293
294
295
296
297
298
299
300
301
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 290

def updatetemplate_pool(project_name, zone, pool_name, template_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{projectName}/zones/{zone}/pools/{poolName}/updateTemplate', options)
  command.request_representation = Google::Apis::ReplicapoolV1beta1::Template::Representation
  command.request_object = template_object
  command.params['projectName'] = project_name unless project_name.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['poolName'] = pool_name unless pool_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end