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

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

Overview

Cloud Build API

Creates and manages builds on Google Cloud Platform.

Examples:

require 'google/apis/cloudbuild_v1'

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

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



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

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.



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

def quota_user
  @quota_user
end

Instance Method Details

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

Cancels a build in progress.

Parameters:

  • project_id (String)

    Required. ID of the project.

  • id (String)

    Required. ID of the build.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



144
145
146
147
148
149
150
151
152
153
154
155
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 144

def cancel_build(project_id, id, cancel_build_request_object = nil, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: 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)
  • 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.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



78
79
80
81
82
83
84
85
86
87
88
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 78

def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Cancels a build in progress.

Parameters:

  • name (String)

    The name of the Build to cancel. Format: projects/project/locations/ location/builds/build``

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def cancel_project_location_build(name, cancel_build_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}: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['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#cancel_project_location_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: 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)
  • 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.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



571
572
573
574
575
576
577
578
579
580
581
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 571

def cancel_project_location_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Starts a build with the specified configuration. This method returns a long- running Operation, which includes the build ID. Pass the build ID to GetBuild to determine the build status (such as SUCCESS or FAILURE).

Parameters:

  • parent (String)

    The parent resource where this build will be created. Format: projects/ project/locations/location``

  • build_object (Google::Apis::CloudbuildV1::Build) (defaults to: nil)
  • project_id (String) (defaults to: nil)

    Required. ID of the project.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def create_build(parent, build_object = nil, project_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/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['parent'] = parent unless parent.nil?
  command.query['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Starts a build with the specified configuration. This method returns a long- running Operation, which includes the build ID. Pass the build ID to GetBuild to determine the build status (such as SUCCESS or FAILURE).

Parameters:

  • project_id (String)

    Required. ID of the project.

  • build_object (Google::Apis::CloudbuildV1::Build) (defaults to: nil)
  • parent (String) (defaults to: nil)

    The parent resource where this build will be created. Format: projects/ project/locations/location``

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def create_project_build(project_id, build_object = nil, parent: nil, fields: nil, quota_user: 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['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Creates a new BuildTrigger. This API is experimental.

Parameters:

  • project_id (String)

    Required. ID of the project for which to configure automatic builds.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



635
636
637
638
639
640
641
642
643
644
645
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 635

def create_project_trigger(project_id, build_trigger_object = nil, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

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

Parameters:

  • project_id (String)

    Required. ID of the project that owns the trigger.

  • trigger_id (String)

    Required. ID of the BuildTrigger to delete.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



670
671
672
673
674
675
676
677
678
679
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 670

def delete_project_trigger(project_id, trigger_id, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_operation(name, fields: nil, quota_user: 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.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



111
112
113
114
115
116
117
118
119
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 111

def get_operation(name, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Returns information about a previously requested build. The Build that is returned includes its status (such as SUCCESS, FAILURE, or WORKING), and timing information.

Parameters:

  • project_id (String)

    Required. ID of the project.

  • id (String)

    Required. ID of the build.

  • name (String) (defaults to: nil)

    The name of the Build to retrieve. Format: projects/project/locations/ location/builds/build``

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def get_project_build(project_id, id, name: nil, fields: nil, quota_user: 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['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Returns information about a previously requested build. The Build that is returned includes its status (such as SUCCESS, FAILURE, or WORKING), and timing information.

Parameters:

  • name (String)

    The name of the Build to retrieve. Format: projects/project/locations/ location/builds/build``

  • id (String) (defaults to: nil)

    Required. ID of the build.

  • project_id (String) (defaults to: nil)

    Required. ID of the project.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

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

#get_project_location_operation(name, fields: nil, quota_user: 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.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



604
605
606
607
608
609
610
611
612
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 604

def get_project_location_operation(name, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Returns information about a BuildTrigger. This API is experimental.

Parameters:

  • project_id (String)

    Required. ID of the project that owns the trigger.

  • trigger_id (String)

    Required. Identifier (id or name) of the BuildTrigger to get.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



703
704
705
706
707
708
709
710
711
712
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 703

def get_project_trigger(project_id, trigger_id, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_builds(project_id, filter: nil, page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: 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)

    Required. ID of the project.

  • filter (String) (defaults to: nil)

    The raw filter text to constrain the results.

  • page_size (Fixnum) (defaults to: nil)

    Number of results to return in the list.

  • page_token (String) (defaults to: nil)

    The page token for the next page of Builds. If unspecified, the first page of results is returned. If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. In this case, the token should be discarded, and pagination should be restarted from the first page of results. See https://google.aip.dev/ 158 for more.

  • parent (String) (defaults to: nil)

    The parent of the collection of Builds. Format: projects/project/ locations/location

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 269

def list_project_builds(project_id, filter: nil, page_size: nil, page_token: nil, parent: nil, fields: nil, quota_user: 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['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_location_builds(parent, filter: nil, page_size: nil, page_token: nil, project_id: nil, fields: nil, quota_user: 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:

  • parent (String)

    The parent of the collection of Builds. Format: projects/project/ locations/location

  • filter (String) (defaults to: nil)

    The raw filter text to constrain the results.

  • page_size (Fixnum) (defaults to: nil)

    Number of results to return in the list.

  • page_token (String) (defaults to: nil)

    The page token for the next page of Builds. If unspecified, the first page of results is returned. If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. In this case, the token should be discarded, and pagination should be restarted from the first page of results. See https://google.aip.dev/ 158 for more.

  • project_id (String) (defaults to: nil)

    Required. ID of the project.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



480
481
482
483
484
485
486
487
488
489
490
491
492
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 480

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

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

Lists existing BuildTriggers. This API is experimental.

Parameters:

  • project_id (String)

    Required. ID of the project for which to list BuildTriggers.

  • page_size (Fixnum) (defaults to: nil)

    Number of results to return in the list.

  • page_token (String) (defaults to: nil)

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

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



738
739
740
741
742
743
744
745
746
747
748
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 738

def list_project_triggers(project_id, page_size: nil, page_token: nil, fields: nil, quota_user: 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['pageSize'] = page_size unless page_size.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?
  execute_or_queue_command(command, &block)
end

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

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

Parameters:

  • project_id (String)

    Required. ID of the project that owns the trigger.

  • trigger_id (String)

    Required. ID of the BuildTrigger to update.

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

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



774
775
776
777
778
779
780
781
782
783
784
785
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 774

def patch_project_trigger(project_id, trigger_id, build_trigger_object = nil, fields: nil, quota_user: 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['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify RepoSource: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify StorageSource: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source.

  • If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.

Parameters:

  • project_id (String)

    Required. ID of the project.

  • id (String)

    Required. Build ID of the original build.

  • retry_build_request_object (Google::Apis::CloudbuildV1::RetryBuildRequest) (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.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



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

def retry_build(project_id, id, retry_build_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/projects/{projectId}/builds/{id}:retry', options)
  command.request_representation = Google::Apis::CloudbuildV1::RetryBuildRequest::Representation
  command.request_object = retry_build_request_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.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

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

Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify RepoSource: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify StorageSource: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source.

  • If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.

Parameters:

  • name (String)

    The name of the Build to retry. Format: projects/project/locations/ location/builds/build``

  • retry_build_request_object (Google::Apis::CloudbuildV1::RetryBuildRequest) (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.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



531
532
533
534
535
536
537
538
539
540
541
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 531

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

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

Runs a BuildTrigger at a particular source revision.

Parameters:

  • project_id (String)

    Required. ID of the project.

  • trigger_id (String)

    Required. ID of the trigger.

  • repo_source_object (Google::Apis::CloudbuildV1::RepoSource) (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.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



810
811
812
813
814
815
816
817
818
819
820
821
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 810

def run_project_trigger(project_id, trigger_id, repo_source_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/projects/{projectId}/triggers/{triggerId}:run', options)
  command.request_representation = Google::Apis::CloudbuildV1::RepoSource::Representation
  command.request_object = repo_source_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.params['triggerId'] = trigger_id unless trigger_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end