Class: Google::Apis::CloudbuildV1beta1::CloudBuildService

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

Overview

Cloud Build API

Creates and manages builds on Google Cloud Platform.

Examples:

require 'google/apis/cloudbuild_v1beta1'

Cloudbuild = Google::Apis::CloudbuildV1beta1 # 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
49
50
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 45

def initialize
  super('https://cloudbuild.googleapis.com/', '',
        client_name: 'google-apis-cloudbuild_v1beta1',
        client_version: Google::Apis::CloudbuildV1beta1::GEM_VERSION)
  @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 'lib/google/apis/cloudbuild_v1beta1/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 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1beta1::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::CloudbuildV1beta1::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



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 80

def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta1/{+name}:cancel', options)
  command.request_representation = Google::Apis::CloudbuildV1beta1::CancelOperationRequest::Representation
  command.request_object = cancel_operation_request_object
  command.response_representation = Google::Apis::CloudbuildV1beta1::Empty::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::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_project_location_worker_pool(parent, worker_pool_object = nil, worker_pool_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1beta1::Operation

Creates a WorkerPool to run the builds, and returns the new worker pool. NOTE: As of now, this method returns an Operation that is always complete.

Parameters:

  • parent (String)

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

  • worker_pool_object (Google::Apis::CloudbuildV1beta1::WorkerPool) (defaults to: nil)
  • worker_pool_id (String) (defaults to: nil)

    Required. Immutable. The ID to use for the WorkerPool, which will become the final component of the resource name. This value should be 1-63 characters, and valid characters are /a-z-/.

  • 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



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

def create_project_location_worker_pool(parent, worker_pool_object = nil, worker_pool_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta1/{+parent}/workerPools', options)
  command.request_representation = Google::Apis::CloudbuildV1beta1::WorkerPool::Representation
  command.request_object = worker_pool_object
  command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::Operation
  command.params['parent'] = parent unless parent.nil?
  command.query['workerPoolId'] = worker_pool_id unless worker_pool_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_location_worker_pool(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1beta1::Operation

Deletes a WorkerPool. NOTE: As of now, this method returns an Operation that is always complete.

Parameters:

  • name (String)

    Required. The name of the WorkerPool to delete. Format: projects/project/ locations/workerPool/workerPools/workerPool``.

  • etag (String) (defaults to: nil)

    Optional. If this is provided, it must match the server's etag on the workerpool for the request to be processed.

  • 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



188
189
190
191
192
193
194
195
196
197
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 188

def delete_project_location_worker_pool(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::Operation
  command.params['name'] = name unless name.nil?
  command.query['etag'] = etag unless etag.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::CloudbuildV1beta1::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



113
114
115
116
117
118
119
120
121
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 113

def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::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_location_worker_pool(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1beta1::WorkerPool

Returns details of a WorkerPool.

Parameters:

  • name (String)

    Required. The name of the WorkerPool to retrieve. Format: projects/project /locations/location/workerPools/workerPool``.

  • 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



220
221
222
223
224
225
226
227
228
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 220

def get_project_location_worker_pool(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta1/{+name}', options)
  command.response_representation = Google::Apis::CloudbuildV1beta1::WorkerPool::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::WorkerPool
  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

#list_project_location_worker_pools(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse

Lists WorkerPools in the given project.

Parameters:

  • parent (String)

    Required. The parent of the collection of WorkerPools. 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



251
252
253
254
255
256
257
258
259
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 251

def list_project_location_worker_pools(parent, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta1/{+parent}/workerPools', options)
  command.response_representation = Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::ListWorkerPoolsResponse
  command.params['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

#patch_project_location_worker_pool(name, worker_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1beta1::Operation

Updates a WorkerPool. NOTE: As of now, this method returns an Operation that is always complete.

Parameters:

  • name (String)

    Output only. The resource name of the WorkerPool, with format projects/ project/locations/location/workerPools/worker_pool. The value of worker_poolis provided by `worker_pool_id` in `CreateWorkerPool` request and the value oflocation`` is determined by the endpoint accessed.

  • worker_pool_object (Google::Apis::CloudbuildV1beta1::WorkerPool) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    A mask specifying which fields in WorkerPool to update.

  • 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



288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/google/apis/cloudbuild_v1beta1/service.rb', line 288

def patch_project_location_worker_pool(name, worker_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1beta1/{+name}', options)
  command.request_representation = Google::Apis::CloudbuildV1beta1::WorkerPool::Representation
  command.request_object = worker_pool_object
  command.response_representation = Google::Apis::CloudbuildV1beta1::Operation::Representation
  command.response_class = Google::Apis::CloudbuildV1beta1::Operation
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end