Class: Google::Apis::RemotebuildexecutionV2::RemoteBuildExecutionService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::RemotebuildexecutionV2::RemoteBuildExecutionService
- Defined in:
- generated/google/apis/remotebuildexecution_v2/service.rb
Overview
Remote Build Execution API
Supplies a Remote Execution API service for tools such as bazel.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#batch_blob_read(instance_name, build_bazel_remote_execution_v2_batch_read_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse
Download many blobs at once.
-
#batch_blob_update(instance_name, build_bazel_remote_execution_v2_batch_update_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse
Upload many blobs at once.
-
#execute_action(instance_name, build_bazel_remote_execution_v2_execute_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation
Execute an action remotely.
-
#find_blob_missing(instance_name, build_bazel_remote_execution_v2_find_missing_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse
Determine if blobs are present in the CAS.
-
#get_action_result(instance_name, hash_, size_bytes, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult
Retrieve a cached execution result.
-
#get_blob_tree(instance_name, hash_, size_bytes, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse
Fetch the entire directory tree rooted at a node.
-
#get_capabilities(instance_name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities
GetCapabilities returns the server capabilities configuration.
-
#initialize ⇒ RemoteBuildExecutionService
constructor
A new instance of RemoteBuildExecutionService.
-
#update_action_result(instance_name, hash_, size_bytes, build_bazel_remote_execution_v2_action_result_object = nil, results_cache_policy_priority: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult
Upload a new execution result.
-
#wait_operation_execution(name, build_bazel_remote_execution_v2_wait_execution_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation
Wait for an execution operation to complete.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ RemoteBuildExecutionService
Returns a new instance of RemoteBuildExecutionService
45 46 47 48 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 45 def initialize super('https://remotebuildexecution.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/remotebuildexecution_v2/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/remotebuildexecution_v2/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#batch_blob_read(instance_name, build_bazel_remote_execution_v2_batch_read_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse
Download many blobs at once.
The server may enforce a limit of the combined total size of blobs
to be downloaded using this API. This limit may be obtained using the
Capabilities API.
Requests exceeding the limit should either be split into smaller
chunks or downloaded using the
ByteStream API, as appropriate.
This request is equivalent to calling a Bytestream Read
request
on each individual blob, in parallel. The requests may succeed or fail
independently.
Errors:
INVALID_ARGUMENT
: The client attempted to read more than the server supported limit. Every error on individual read will be returned in the corresponding digest status.
288 289 290 291 292 293 294 295 296 297 298 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 288 def batch_blob_read(instance_name, build_bazel_remote_execution_v2_batch_read_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+instanceName}/blobs:batchRead', ) command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsRequest::Representation command.request_object = build_bazel_remote_execution_v2_batch_read_blobs_request_object command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse command.params['instanceName'] = instance_name unless instance_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 |
#batch_blob_update(instance_name, build_bazel_remote_execution_v2_batch_update_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse
Upload many blobs at once.
The server may enforce a limit of the combined total size of blobs
to be uploaded using this API. This limit may be obtained using the
Capabilities API.
Requests exceeding the limit should either be split into smaller
chunks or uploaded using the
ByteStream API, as appropriate.
This request is equivalent to calling a Bytestream Write
request
on each individual blob, in parallel. The requests may succeed or fail
independently.
Errors:
INVALID_ARGUMENT
: The client attempted to upload more than the server supported limit. Individual requests may return the following errors, additionally:RESOURCE_EXHAUSTED
: There is insufficient disk quota to store the blob.INVALID_ARGUMENT
: The Digest does not match the provided data.
342 343 344 345 346 347 348 349 350 351 352 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 342 def batch_blob_update(instance_name, build_bazel_remote_execution_v2_batch_update_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+instanceName}/blobs:batchUpdate', ) command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsRequest::Representation command.request_object = build_bazel_remote_execution_v2_batch_update_blobs_request_object command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse command.params['instanceName'] = instance_name unless instance_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 |
#execute_action(instance_name, build_bazel_remote_execution_v2_execute_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation
Execute an action remotely.
In order to execute an action, the client must first upload all of the
inputs, the
Command to run, and the
Action into the
ContentAddressableStorage.
It then calls Execute
with an action_digest
referring to them. The
server will run the action and eventually return the result.
The input Action
's fields MUST meet the various canonicalization
requirements specified in the documentation for their types so that it has
the same digest as other logically equivalent Action
s. The server MAY
enforce the requirements and return errors if a non-canonical input is
received. It MAY also proceed without verifying some or all of the
requirements, such as for performance reasons. If the server does not
verify the requirement, then it will treat the Action
as distinct from
another logically equivalent action if they hash differently.
Returns a stream of
google.longrunning.Operation messages
describing the resulting execution, with eventual response
ExecuteResponse. The
metadata
on the operation is of type
ExecuteOperationMetadata.
If the client remains connected after the first response is returned after
the server, then updates are streamed as if the client had called
WaitExecution
until the execution completes or the request reaches an error. The
operation can also be queried using Operations
API.
The server NEED NOT implement other methods or functionality of the
Operations API.
Errors discovered during creation of the Operation
will be reported
as gRPC Status errors, while errors that occurred while running the
action will be reported in the status
field of the ExecuteResponse
. The
server MUST NOT set the error
field of the Operation
proto.
The possible errors include:
INVALID_ARGUMENT
: One or more arguments are invalid.FAILED_PRECONDITION
: One or more errors occurred in setting up the action requested, such as a missing input or command or no worker being available. The client may be able to fix the errors and retry.RESOURCE_EXHAUSTED
: There is insufficient quota of some resource to run the action.UNAVAILABLE
: Due to a transient condition, such as all workers being occupied (and the server does not support a queue), the action could not be started. The client should retry.INTERNAL
: An internal error occurred in the execution engine or the worker.DEADLINE_EXCEEDED
: The execution timed out.CANCELLED
: The operation was cancelled by the client. This status is only possible if the server implements the Operations API CancelOperation method, and it was called for the current execution. In the case of a missing input or command, the server SHOULD additionally send a PreconditionFailure error detail where, for each requested blob not present in the CAS, there is aViolation
with atype
ofMISSING
and asubject
of"blobs/
hash/
size"
indicating the digest of the missing blob.
237 238 239 240 241 242 243 244 245 246 247 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 237 def execute_action(instance_name, build_bazel_remote_execution_v2_execute_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+instanceName}/actions:execute', ) command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ExecuteRequest::Representation command.request_object = build_bazel_remote_execution_v2_execute_request_object command.response_representation = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation command.params['instanceName'] = instance_name unless instance_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 |
#find_blob_missing(instance_name, build_bazel_remote_execution_v2_find_missing_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse
Determine if blobs are present in the CAS. Clients can use this API before uploading blobs to determine which ones are already present in the CAS and do not need to be uploaded again. There are no method-specific errors.
382 383 384 385 386 387 388 389 390 391 392 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 382 def find_blob_missing(instance_name, build_bazel_remote_execution_v2_find_missing_blobs_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+instanceName}/blobs:findMissing', ) command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsRequest::Representation command.request_object = build_bazel_remote_execution_v2_find_missing_blobs_request_object command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse command.params['instanceName'] = instance_name unless instance_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_action_result(instance_name, hash_, size_bytes, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult
Retrieve a cached execution result. Errors:
NOT_FOUND
: The requestedActionResult
is not in the cache.
81 82 83 84 85 86 87 88 89 90 91 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 81 def get_action_result(instance_name, hash_, size_bytes, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+instanceName}/actionResults/{hash}/{sizeBytes}', ) command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult command.params['instanceName'] = instance_name unless instance_name.nil? command.params['hash'] = hash_ unless hash_.nil? command.params['sizeBytes'] = size_bytes unless size_bytes.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_blob_tree(instance_name, hash_, size_bytes, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse
Fetch the entire directory tree rooted at a node.
This request must be targeted at a
Directory stored in the
ContentAddressableStorage
(CAS). The server will enumerate the Directory
tree recursively and
return every node descended from the root.
The GetTreeRequest.page_token parameter can be used to skip ahead in
the stream (e.g. when retrying a partially completed and aborted request),
by setting it to a value taken from GetTreeResponse.next_page_token of the
last successfully processed GetTreeResponse).
The exact traversal order is unspecified and, unless retrieving subsequent
pages from an earlier request, is not guaranteed to be stable across
multiple invocations of GetTree
.
If part of the tree is missing from the CAS, the server will return the
portion present and omit the rest.
NOT_FOUND
: The requested tree root is not present in the CAS.
447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 447 def get_blob_tree(instance_name, hash_, size_bytes, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+instanceName}/blobs/{hash}/{sizeBytes}:getTree', ) command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse command.params['instanceName'] = instance_name unless instance_name.nil? command.params['hash'] = hash_ unless hash_.nil? command.params['sizeBytes'] = size_bytes unless size_bytes.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 |
#get_capabilities(instance_name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities
GetCapabilities returns the server capabilities configuration.
524 525 526 527 528 529 530 531 532 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 524 def get_capabilities(instance_name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+instanceName}/capabilities', ) command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities command.params['instanceName'] = instance_name unless instance_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 |
#update_action_result(instance_name, hash_, size_bytes, build_bazel_remote_execution_v2_action_result_object = nil, results_cache_policy_priority: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult
Upload a new execution result.
In order to allow the server to perform access control based on the type of
action, and to assist with client debugging, the client MUST first upload
the Action that produced the
result, along with its
Command, into the
ContentAddressableStorage
.
Errors:
INVALID_ARGUMENT
: One or more arguments are invalid.FAILED_PRECONDITION
: One or more errors occurred in updating the action result, such as a missing command or action.RESOURCE_EXHAUSTED
: There is insufficient storage space to add the entry to the cache.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 143 def update_action_result(instance_name, hash_, size_bytes, build_bazel_remote_execution_v2_action_result_object = nil, results_cache_policy_priority: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v2/{+instanceName}/actionResults/{hash}/{sizeBytes}', ) command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult::Representation command.request_object = build_bazel_remote_execution_v2_action_result_object command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult command.params['instanceName'] = instance_name unless instance_name.nil? command.params['hash'] = hash_ unless hash_.nil? command.params['sizeBytes'] = size_bytes unless size_bytes.nil? command.query['resultsCachePolicy.priority'] = results_cache_policy_priority unless results_cache_policy_priority.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#wait_operation_execution(name, build_bazel_remote_execution_v2_wait_execution_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation
Wait for an execution operation to complete. When the client initially makes the request, the server immediately responds with the current status of the execution. The server will leave the request stream open until the operation completes, and then respond with the completed operation. The server MAY choose to stream additional updates as execution progresses, such as to provide an update as to the state of the execution.
488 489 490 491 492 493 494 495 496 497 498 |
# File 'generated/google/apis/remotebuildexecution_v2/service.rb', line 488 def wait_operation_execution(name, build_bazel_remote_execution_v2_wait_execution_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+name}:waitExecution', ) command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2WaitExecutionRequest::Representation command.request_object = build_bazel_remote_execution_v2_wait_execution_request_object command.response_representation = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation 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 |