Class: Google::Apis::CloudbuildV1::CloudBuildService

Inherits:
Google::Apis::Core::BaseService show all
Defined in:
generated/google/apis/cloudbuild_v1/service.rb

Overview

Google Cloud Container Builder API

Builds container images in the cloud.

Examples:

require 'google/apis/cloudbuild_v1'

Cloudbuild = Google::Apis::CloudbuildV1 # Alias the module
service = Cloudbuild::CloudBuildService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Google::Apis::Core::BaseService

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

Instance Method Summary collapse

Methods inherited from Google::Apis::Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Google::Apis::Core::Logging

#logger

Constructor Details

#initializeCloudBuildService

Returns a new instance of CloudBuildService



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

def initialize
  super('https://cloudbuild.googleapis.com/', '')
  @batch_path = 'batch'
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.



43
44
45
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 43

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.

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.



38
39
40
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 38

def quota_user
  @quota_user
end

Instance Method Details

#cancel_build(project_id, id, cancel_build_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Build

Cancels a requested build in progress.

Parameters:

  • project_id (String)

    ID of the project.

  • id (String)

    ID of the build.

  • cancel_build_request_object (Google::Apis::CloudbuildV1::CancelBuildRequest) (defaults to: nil)
  • 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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



185
186
187
188
189
190
191
192
193
194
195
196
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 185

def cancel_build(project_id, id, cancel_build_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}/builds/{id}:cancel', options)
  command.request_representation = Google::Apis::CloudbuildV1::CancelBuildRequest::Representation
  command.request_object = cancel_build_request_object
  command.response_representation = Google::Apis::CloudbuildV1::Build::Representation
  command.response_class = Google::Apis::CloudbuildV1::Build
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#cancel_operation(name, cancel_operation_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Empty

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

Parameters:

  • name (String)

    The name of the operation resource to be cancelled.

  • cancel_operation_request_object (Google::Apis::CloudbuildV1::CancelOperationRequest) (defaults to: nil)
  • 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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



477
478
479
480
481
482
483
484
485
486
487
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 477

def cancel_operation(name, cancel_operation_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:cancel', options)
  command.request_representation = Google::Apis::CloudbuildV1::CancelOperationRequest::Representation
  command.request_object = cancel_operation_request_object
  command.response_representation = Google::Apis::CloudbuildV1::Empty::Representation
  command.response_class = Google::Apis::CloudbuildV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#create_project_build(project_id, build_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Operation

Starts a build with the specified configuration. The long-running Operation returned by this method will include the ID of the build, which can be passed to GetBuild to determine its status (e.g., success or failure).

Parameters:

  • project_id (String)

    ID of the project.

  • build_object (Google::Apis::CloudbuildV1::Build) (defaults to: nil)
  • 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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



150
151
152
153
154
155
156
157
158
159
160
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 150

def create_project_build(project_id, build_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}/builds', options)
  command.request_representation = Google::Apis::CloudbuildV1::Build::Representation
  command.request_object = build_object
  command.response_representation = Google::Apis::CloudbuildV1::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV1::Operation
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#create_project_trigger(project_id, build_trigger_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::BuildTrigger

Creates a new BuildTrigger. This API is experimental.

Parameters:

  • project_id (String)

    ID of the project for which to configure automatic builds.

  • build_trigger_object (Google::Apis::CloudbuildV1::BuildTrigger) (defaults to: nil)
  • 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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



322
323
324
325
326
327
328
329
330
331
332
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 322

def create_project_trigger(project_id, build_trigger_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}/triggers', options)
  command.request_representation = Google::Apis::CloudbuildV1::BuildTrigger::Representation
  command.request_object = build_trigger_object
  command.response_representation = Google::Apis::CloudbuildV1::BuildTrigger::Representation
  command.response_class = Google::Apis::CloudbuildV1::BuildTrigger
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_trigger(project_id, trigger_id, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Empty

Deletes an BuildTrigger by its project ID and trigger ID. This API is experimental.

Parameters:

  • project_id (String)

    ID of the project that owns the trigger.

  • trigger_id (String)

    ID of the BuildTrigger to delete.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



357
358
359
360
361
362
363
364
365
366
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 357

def delete_project_trigger(project_id, trigger_id, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'v1/projects/{projectId}/triggers/{triggerId}', options)
  command.response_representation = Google::Apis::CloudbuildV1::Empty::Representation
  command.response_class = Google::Apis::CloudbuildV1::Empty
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['triggerId'] = trigger_id unless trigger_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#get_operation(name, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Operation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



437
438
439
440
441
442
443
444
445
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 437

def get_operation(name, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV1::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV1::Operation
  command.params['name'] = name unless name.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#get_project_build(project_id, id, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Build

Returns information about a previously requested build. The Build that is returned includes its status (e.g., success or failure, or in-progress), and timing information.

Parameters:

  • project_id (String)

    ID of the project.

  • id (String)

    ID of the build.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



74
75
76
77
78
79
80
81
82
83
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 74

def get_project_build(project_id, id, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/builds/{id}', options)
  command.response_representation = Google::Apis::CloudbuildV1::Build::Representation
  command.response_class = Google::Apis::CloudbuildV1::Build
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#get_project_trigger(project_id, trigger_id, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::BuildTrigger

Gets information about a BuildTrigger. This API is experimental.

Parameters:

  • project_id (String)

    ID of the project that owns the trigger.

  • trigger_id (String)

    ID of the BuildTrigger to get.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



221
222
223
224
225
226
227
228
229
230
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 221

def get_project_trigger(project_id, trigger_id, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/triggers/{triggerId}', options)
  command.response_representation = Google::Apis::CloudbuildV1::BuildTrigger::Representation
  command.response_class = Google::Apis::CloudbuildV1::BuildTrigger
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['triggerId'] = trigger_id unless trigger_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#list_operations(name, filter: nil, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListOperationsResponse

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/name=users/*/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.

Parameters:

  • name (String)

    The name of the operation's parent resource.

  • filter (String)

    The standard list filter.

  • page_token (String)

    The standard list page token.

  • page_size (Fixnum)

    The standard list page size.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



402
403
404
405
406
407
408
409
410
411
412
413
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 402

def list_operations(name, filter: nil, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV1::ListOperationsResponse::Representation
  command.response_class = Google::Apis::CloudbuildV1::ListOperationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#list_project_builds(project_id, page_token: nil, page_size: nil, filter: nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListBuildsResponse

Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.

Parameters:

  • project_id (String)

    ID of the project.

  • page_token (String)

    Token to provide to skip to a particular spot in the list.

  • page_size (Fixnum)

    Number of results to return in the list.

  • filter (String)

    The raw filter text to constrain the results.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



113
114
115
116
117
118
119
120
121
122
123
124
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 113

def list_project_builds(project_id, page_token: nil, page_size: nil, filter: nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/builds', options)
  command.response_representation = Google::Apis::CloudbuildV1::ListBuildsResponse::Representation
  command.response_class = Google::Apis::CloudbuildV1::ListBuildsResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#list_project_triggers(project_id, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListBuildTriggersResponse

Lists existing BuildTrigger. This API is experimental.

Parameters:

  • project_id (String)

    ID of the project for which to list BuildTriggers.

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

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



253
254
255
256
257
258
259
260
261
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 253

def list_project_triggers(project_id, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/triggers', options)
  command.response_representation = Google::Apis::CloudbuildV1::ListBuildTriggersResponse::Representation
  command.response_class = Google::Apis::CloudbuildV1::ListBuildTriggersResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#patch_project_trigger(project_id, trigger_id, build_trigger_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::BuildTrigger

Updates an BuildTrigger by its project ID and trigger ID. This API is experimental.

Parameters:

  • project_id (String)

    ID of the project that owns the trigger.

  • trigger_id (String)

    ID of the BuildTrigger to update.

  • build_trigger_object (Google::Apis::CloudbuildV1::BuildTrigger) (defaults to: nil)
  • 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.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



287
288
289
290
291
292
293
294
295
296
297
298
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 287

def patch_project_trigger(project_id, trigger_id, build_trigger_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'v1/projects/{projectId}/triggers/{triggerId}', options)
  command.request_representation = Google::Apis::CloudbuildV1::BuildTrigger::Representation
  command.request_object = build_trigger_object
  command.response_representation = Google::Apis::CloudbuildV1::BuildTrigger::Representation
  command.response_class = Google::Apis::CloudbuildV1::BuildTrigger
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['triggerId'] = trigger_id unless trigger_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end