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

Constructor Details

#initializeCloudBuildService

Returns a new instance of CloudBuildService.


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

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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

#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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


243
244
245
246
247
248
249
250
251
252
253
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 243

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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


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

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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


171
172
173
174
175
176
177
178
179
180
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 171

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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


389
390
391
392
393
394
395
396
397
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 389

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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


279
280
281
282
283
284
285
286
287
288
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 279

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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


106
107
108
109
110
111
112
113
114
115
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 106

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, page_size: nil, filter: nil, page_token: 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 below allows API services to override the binding to use different resource name schemes, such as users/*/operations.

Parameters:

  • name (String)

    The name of the operation collection.

  • page_size (Fixnum) (defaults to: nil)

    The standard list page size.

  • filter (String) (defaults to: nil)

    The standard list filter.

  • page_token (String) (defaults to: nil)

    The standard list page token.

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


428
429
430
431
432
433
434
435
436
437
438
439
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 428

def list_operations(name, page_size: nil, filter: nil, page_token: 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['pageSize'] = page_size unless page_size.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageToken'] = page_token unless page_token.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_size: nil, filter: nil, page_token: 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_size (Fixnum) (defaults to: nil)

    Number of results to return in the list.

  • filter (String) (defaults to: nil)

    The raw filter text to constrain the results.

  • page_token (String) (defaults to: nil)

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

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


318
319
320
321
322
323
324
325
326
327
328
329
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 318

def list_project_builds(project_id, page_size: nil, filter: nil, page_token: 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['pageSize'] = page_size unless page_size.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageToken'] = page_token unless page_token.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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


138
139
140
141
142
143
144
145
146
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 138

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) (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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:


206
207
208
209
210
211
212
213
214
215
216
217
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 206

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