Class: Google::Apis::AutoscalerV1beta2::AutoscalerService

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

Overview

Google Compute Engine Autoscaler API

The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.

Examples:

require 'google/apis/autoscaler_v1beta2'

Autoscaler = Google::Apis::AutoscalerV1beta2 # Alias the module
service = Autoscaler::AutoscalerService.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

Constructor Details

#initializeAutoscalerService

Returns a new instance of AutoscalerService.



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

def initialize
  super('https://www.googleapis.com/', 'autoscaler/v1beta2/')
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/autoscaler_v1beta2/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/autoscaler_v1beta2/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/autoscaler_v1beta2/service.rb', line 50

def user_ip
  @user_ip
end

Instance Method Details

#delete_autoscaler(project, zone, autoscaler, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::Operation

Deletes the specified Autoscaler resource.

Parameters:

  • project (String)

    Project ID of Autoscaler resource.

  • zone (String)

    Zone name of Autoscaler resource.

  • autoscaler (String)

    Name of the Autoscaler resource.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



84
85
86
87
88
89
90
91
92
93
94
95
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 84

def delete_autoscaler(project, zone, autoscaler, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}', options)
  command.response_representation = Google::Apis::AutoscalerV1beta2::Operation::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::Operation
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['autoscaler'] = autoscaler unless autoscaler.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_zone_operation(project, zone, operation, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Deletes the specified zone-specific operation resource.

Parameters:

  • project (String)
  • zone (String)
  • operation (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    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:



337
338
339
340
341
342
343
344
345
346
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 337

def delete_zone_operation(project, zone, operation, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{project}/zones/{zone}/operations/{operation}', options)
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['operation'] = operation unless operation.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_autoscaler(project, zone, autoscaler, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::Autoscaler

Gets the specified Autoscaler resource.

Parameters:

  • project (String)

    Project ID of Autoscaler resource.

  • zone (String)

    Zone name of Autoscaler resource.

  • autoscaler (String)

    Name of the Autoscaler resource.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



125
126
127
128
129
130
131
132
133
134
135
136
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 125

def get_autoscaler(project, zone, autoscaler, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}', options)
  command.response_representation = Google::Apis::AutoscalerV1beta2::Autoscaler::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::Autoscaler
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['autoscaler'] = autoscaler unless autoscaler.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_zone_operation(project, zone, operation, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::Operation

Retrieves the specified zone-specific operation resource.

Parameters:

  • project (String)
  • zone (String)
  • operation (String)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



373
374
375
376
377
378
379
380
381
382
383
384
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 373

def get_zone_operation(project, zone, operation, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{project}/zones/{zone}/operations/{operation}', options)
  command.response_representation = Google::Apis::AutoscalerV1beta2::Operation::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::Operation
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['operation'] = operation unless operation.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_autoscaler(project, zone, autoscaler_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::Operation

Adds new Autoscaler resource.

Parameters:

  • project (String)

    Project ID of Autoscaler resource.

  • zone (String)

    Zone name of Autoscaler resource.

  • autoscaler_object (Google::Apis::AutoscalerV1beta2::Autoscaler) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 165

def insert_autoscaler(project, zone, autoscaler_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, 'projects/{project}/zones/{zone}/autoscalers', options)
  command.request_representation = Google::Apis::AutoscalerV1beta2::Autoscaler::Representation
  command.request_object = autoscaler_object
  command.response_representation = Google::Apis::AutoscalerV1beta2::Operation::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::Operation
  command.params['project'] = project unless project.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_autoscalers(project, zone, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::ListAutoscalerResponse

Lists all Autoscaler resources in this zone.

Parameters:

  • project (String)

    Project ID of Autoscaler resource.

  • zone (String)

    Zone name of Autoscaler resource.

  • filter (String) (defaults to: nil)
  • max_results (Fixnum) (defaults to: nil)
  • page_token (String) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 208

def list_autoscalers(project, zone, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'projects/{project}/zones/{zone}/autoscalers', options)
  command.response_representation = Google::Apis::AutoscalerV1beta2::ListAutoscalerResponse::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::ListAutoscalerResponse
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['filter'] = filter unless filter.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_zone_operations(project, zone, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::OperationList

Retrieves the list of operation resources contained within the specified zone.

Parameters:

  • project (String)
  • zone (String)
  • filter (String) (defaults to: nil)
  • max_results (Fixnum) (defaults to: nil)
  • page_token (String) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 413

def list_zone_operations(project, zone, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{project}/zones/{zone}/operations', options)
  command.response_representation = Google::Apis::AutoscalerV1beta2::OperationList::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::OperationList
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['filter'] = filter unless filter.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_zones(filter: nil, max_results: nil, page_token: nil, project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::ZoneList

Parameters:

  • filter (String) (defaults to: nil)
  • max_results (Fixnum) (defaults to: nil)
  • page_token (String) (defaults to: nil)
  • project (String) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 454

def list_zones(filter: nil, max_results: nil, page_token: nil, project: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'zones', options)
  command.response_representation = Google::Apis::AutoscalerV1beta2::ZoneList::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::ZoneList
  command.query['filter'] = filter unless filter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['project'] = project unless project.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

#patch_autoscaler(project, zone, autoscaler, autoscaler_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::Operation

Update the entire content of the Autoscaler resource. This method supports patch semantics.

Parameters:

  • project (String)

    Project ID of Autoscaler resource.

  • zone (String)

    Zone name of Autoscaler resource.

  • autoscaler (String)

    Name of the Autoscaler resource.

  • autoscaler_object (Google::Apis::AutoscalerV1beta2::Autoscaler) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 253

def patch_autoscaler(project, zone, autoscaler, autoscaler_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}', options)
  command.request_representation = Google::Apis::AutoscalerV1beta2::Autoscaler::Representation
  command.request_object = autoscaler_object
  command.response_representation = Google::Apis::AutoscalerV1beta2::Operation::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::Operation
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['autoscaler'] = autoscaler unless autoscaler.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

#update_autoscaler(project, zone, autoscaler, autoscaler_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AutoscalerV1beta2::Operation

Update the entire content of the Autoscaler resource.

Parameters:

  • project (String)

    Project ID of Autoscaler resource.

  • zone (String)

    Zone name of Autoscaler resource.

  • autoscaler (String)

    Name of the Autoscaler resource.

  • autoscaler_object (Google::Apis::AutoscalerV1beta2::Autoscaler) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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) (defaults to: nil)

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

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'generated/google/apis/autoscaler_v1beta2/service.rb', line 297

def update_autoscaler(project, zone, autoscaler, autoscaler_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, 'projects/{project}/zones/{zone}/autoscalers/{autoscaler}', options)
  command.request_representation = Google::Apis::AutoscalerV1beta2::Autoscaler::Representation
  command.request_object = autoscaler_object
  command.response_representation = Google::Apis::AutoscalerV1beta2::Operation::Representation
  command.response_class = Google::Apis::AutoscalerV1beta2::Operation
  command.params['project'] = project unless project.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['autoscaler'] = autoscaler unless autoscaler.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