Class: Google::Apis::CloudbuildV1::CloudBuildService
- Inherits:
-
Google::Apis::Core::BaseService
- Object
- Google::Apis::Core::BaseService
- Google::Apis::CloudbuildV1::CloudBuildService
- Defined in:
- generated/google/apis/cloudbuild_v1/service.rb
Overview
Cloud Container Builder API
Builds container images in the cloud.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
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
-
#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.
-
#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.
-
#create_project_build(project_id, build_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Operation
Starts a build with the specified configuration.
-
#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
. -
#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. -
#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.
-
#get_project_build(project_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::Build
Returns information about a previously requested build.
-
#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
. -
#initialize ⇒ CloudBuildService
constructor
A new instance of CloudBuildService.
-
#list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListOperationsResponse
Lists operations that match the specified filter in the request.
-
#list_project_builds(project_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListBuildsResponse
Lists previously requested builds.
-
#list_project_triggers(project_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListBuildTriggersResponse
Lists existing
BuildTrigger
s. -
#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. -
#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.
-
#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.
Methods inherited from Google::Apis::Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Google::Apis::Core::Logging
Constructor Details
#initialize ⇒ CloudBuildService
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
#key ⇒ String
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.
38 39 40 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
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.
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.
194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 194 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', ) 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
.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'generated/google/apis/cloudbuild_v1/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, 'v1/{+name}:cancel', ) 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_project_build(project_id, build_object = 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
).
231 232 233 234 235 236 237 238 239 240 241 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 231 def create_project_build(project_id, build_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/projects/{projectId}/builds', ) 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['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.
396 397 398 399 400 401 402 403 404 405 406 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 396 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', ) 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.
431 432 433 434 435 436 437 438 439 440 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 431 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}', ) 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.
114 115 116 117 118 119 120 121 122 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 114 def get_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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, 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.
267 268 269 270 271 272 273 274 275 276 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 267 def get_project_build(project_id, id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/projects/{projectId}/builds/{id}', ) 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 |
#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.
465 466 467 468 469 470 471 472 473 474 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 465 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}', ) 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_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: 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.
158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 158 def list_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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['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 |
#list_project_builds(project_id, filter: nil, page_size: nil, page_token: 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.
306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 306 def list_project_builds(project_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/projects/{projectId}/builds', ) 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['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, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::CloudbuildV1::ListBuildTriggersResponse
Lists existing BuildTrigger
s.
This API is experimental.
497 498 499 500 501 502 503 504 505 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 497 def list_project_triggers(project_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/projects/{projectId}/triggers', ) 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['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.
531 532 533 534 535 536 537 538 539 540 541 542 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 531 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}', ) 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.
361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 361 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', ) 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 |
#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.
567 568 569 570 571 572 573 574 575 576 577 578 |
# File 'generated/google/apis/cloudbuild_v1/service.rb', line 567 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', ) 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 |