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



52
53
54
55
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 52

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 Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.



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

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



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

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • 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:



86
87
88
89
90
91
92
93
94
95
96
97
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 86

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 348

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



127
128
129
130
131
132
133
134
135
136
137
138
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 127

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 394

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 167

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 213

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 442

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 261

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 487

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • 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:



304
305
306
307
308
309
310
311
312
313
314
315
# File 'generated/google/apis/replicapool_v1beta1/service.rb', line 304

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