Best Selenium code snippet using Bazel.execute
service.rb
Source:service.rb  
...102          command.query['inlineStderr'] = inline_stderr unless inline_stderr.nil?103          command.query['inlineStdout'] = inline_stdout unless inline_stdout.nil?104          command.query['fields'] = fields unless fields.nil?105          command.query['quotaUser'] = quota_user unless quota_user.nil?106          execute_or_queue_command(command, &block)107        end108        109        # Upload a new execution result.110        # In order to allow the server to perform access control based on the type of111        # action, and to assist with client debugging, the client MUST first upload112        # the Action that produced the113        # result, along with its114        # Command, into the115        # `ContentAddressableStorage`.116        # Errors:117        # * `INVALID_ARGUMENT`: One or more arguments are invalid.118        # * `FAILED_PRECONDITION`: One or more errors occurred in updating the119        # action result, such as a missing command or action.120        # * `RESOURCE_EXHAUSTED`: There is insufficient storage space to add the121        # entry to the cache.122        # @param [String] instance_name123        #   The instance of the execution system to operate against. A server may124        #   support multiple instances of the execution system (with their own workers,125        #   storage, caches, etc.). The server MAY require use of this field to select126        #   between them in an implementation-defined fashion, otherwise it can be127        #   omitted.128        # @param [String] hash_129        #   The hash. In the case of SHA-256, it will always be a lowercase hex string130        #   exactly 64 characters long.131        # @param [Fixnum] size_bytes132        #   The size of the blob, in bytes.133        # @param [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult] build_bazel_remote_execution_v2_action_result_object134        # @param [Fixnum] results_cache_policy_priority135        #   The priority (relative importance) of this content in the overall cache.136        #   Generally, a lower value means a longer retention time or other advantage,137        #   but the interpretation of a given value is server-dependent. A priority of138        #   0 means a *default* value, decided by the server.139        #   The particular semantics of this field is up to the server. In particular,140        #   every server will have their own supported range of priorities, and will141        #   decide how these map into retention/eviction policy.142        # @param [String] fields143        #   Selector specifying which fields to include in a partial response.144        # @param [String] quota_user145        #   Available to use for quota purposes for server-side applications. Can be any146        #   arbitrary string assigned to a user, but should not exceed 40 characters.147        # @param [Google::Apis::RequestOptions] options148        #   Request-specific options149        #150        # @yield [result, err] Result & error if block supplied151        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult] parsed result object152        # @yieldparam err [StandardError] error object if request failed153        #154        # @return [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult]155        #156        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried157        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification158        # @raise [Google::Apis::AuthorizationError] Authorization is required159        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)160          command = make_simple_command(:put, 'v2/{+instanceName}/actionResults/{hash}/{sizeBytes}', options)161          command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult::Representation162          command.request_object = build_bazel_remote_execution_v2_action_result_object163          command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult::Representation164          command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ActionResult165          command.params['instanceName'] = instance_name unless instance_name.nil?166          command.params['hash'] = hash_ unless hash_.nil?167          command.params['sizeBytes'] = size_bytes unless size_bytes.nil?168          command.query['resultsCachePolicy.priority'] = results_cache_policy_priority unless results_cache_policy_priority.nil?169          command.query['fields'] = fields unless fields.nil?170          command.query['quotaUser'] = quota_user unless quota_user.nil?171          execute_or_queue_command(command, &block)172        end173        174        # Execute an action remotely.175        # In order to execute an action, the client must first upload all of the176        # inputs, the177        # Command to run, and the178        # Action into the179        # ContentAddressableStorage.180        # It then calls `Execute` with an `action_digest` referring to them. The181        # server will run the action and eventually return the result.182        # The input `Action`'s fields MUST meet the various canonicalization183        # requirements specified in the documentation for their types so that it has184        # the same digest as other logically equivalent `Action`s. The server MAY185        # enforce the requirements and return errors if a non-canonical input is186        # received. It MAY also proceed without verifying some or all of the187        # requirements, such as for performance reasons. If the server does not188        # verify the requirement, then it will treat the `Action` as distinct from189        # another logically equivalent action if they hash differently.190        # Returns a stream of191        # google.longrunning.Operation messages192        # describing the resulting execution, with eventual `response`193        # ExecuteResponse. The194        # `metadata` on the operation is of type195        # ExecuteOperationMetadata.196        # If the client remains connected after the first response is returned after197        # the server, then updates are streamed as if the client had called198        # WaitExecution199        # until the execution completes or the request reaches an error. The200        # operation can also be queried using Operations201        # API.202        # The server NEED NOT implement other methods or functionality of the203        # Operations API.204        # Errors discovered during creation of the `Operation` will be reported205        # as gRPC Status errors, while errors that occurred while running the206        # action will be reported in the `status` field of the `ExecuteResponse`. The207        # server MUST NOT set the `error` field of the `Operation` proto.208        # The possible errors include:209        # * `INVALID_ARGUMENT`: One or more arguments are invalid.210        # * `FAILED_PRECONDITION`: One or more errors occurred in setting up the211        # action requested, such as a missing input or command or no worker being212        # available. The client may be able to fix the errors and retry.213        # * `RESOURCE_EXHAUSTED`: There is insufficient quota of some resource to run214        # the action.215        # * `UNAVAILABLE`: Due to a transient condition, such as all workers being216        # occupied (and the server does not support a queue), the action could not217        # be started. The client should retry.218        # * `INTERNAL`: An internal error occurred in the execution engine or the219        # worker.220        # * `DEADLINE_EXCEEDED`: The execution timed out.221        # * `CANCELLED`: The operation was cancelled by the client. This status is222        # only possible if the server implements the Operations API CancelOperation223        # method, and it was called for the current execution.224        # In the case of a missing input or command, the server SHOULD additionally225        # send a PreconditionFailure error detail226        # where, for each requested blob not present in the CAS, there is a227        # `Violation` with a `type` of `MISSING` and a `subject` of228        # `"blobs/`hash`/`size`"` indicating the digest of the missing blob.229        # @param [String] instance_name230        #   The instance of the execution system to operate against. A server may231        #   support multiple instances of the execution system (with their own workers,232        #   storage, caches, etc.). The server MAY require use of this field to select233        #   between them in an implementation-defined fashion, otherwise it can be234        #   omitted.235        # @param [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ExecuteRequest] build_bazel_remote_execution_v2_execute_request_object236        # @param [String] fields237        #   Selector specifying which fields to include in a partial response.238        # @param [String] quota_user239        #   Available to use for quota purposes for server-side applications. Can be any240        #   arbitrary string assigned to a user, but should not exceed 40 characters.241        # @param [Google::Apis::RequestOptions] options242        #   Request-specific options243        #244        # @yield [result, err] Result & error if block supplied245        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation] parsed result object246        # @yieldparam err [StandardError] error object if request failed247        #248        # @return [Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation]249        #250        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried251        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification252        # @raise [Google::Apis::AuthorizationError] Authorization is required253        def execute_action(instance_name, build_bazel_remote_execution_v2_execute_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)254          command = make_simple_command(:post, 'v2/{+instanceName}/actions:execute', options)255          command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ExecuteRequest::Representation256          command.request_object = build_bazel_remote_execution_v2_execute_request_object257          command.response_representation = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation::Representation258          command.response_class = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation259          command.params['instanceName'] = instance_name unless instance_name.nil?260          command.query['fields'] = fields unless fields.nil?261          command.query['quotaUser'] = quota_user unless quota_user.nil?262          execute_or_queue_command(command, &block)263        end264        265        # Download many blobs at once.266        # The server may enforce a limit of the combined total size of blobs267        # to be downloaded using this API. This limit may be obtained using the268        # Capabilities API.269        # Requests exceeding the limit should either be split into smaller270        # chunks or downloaded using the271        # ByteStream API, as appropriate.272        # This request is equivalent to calling a Bytestream `Read` request273        # on each individual blob, in parallel. The requests may succeed or fail274        # independently.275        # Errors:276        # * `INVALID_ARGUMENT`: The client attempted to read more than the277        # server supported limit.278        # Every error on individual read will be returned in the corresponding digest279        # status.280        # @param [String] instance_name281        #   The instance of the execution system to operate against. A server may282        #   support multiple instances of the execution system (with their own workers,283        #   storage, caches, etc.). The server MAY require use of this field to select284        #   between them in an implementation-defined fashion, otherwise it can be285        #   omitted.286        # @param [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsRequest] build_bazel_remote_execution_v2_batch_read_blobs_request_object287        # @param [String] fields288        #   Selector specifying which fields to include in a partial response.289        # @param [String] quota_user290        #   Available to use for quota purposes for server-side applications. Can be any291        #   arbitrary string assigned to a user, but should not exceed 40 characters.292        # @param [Google::Apis::RequestOptions] options293        #   Request-specific options294        #295        # @yield [result, err] Result & error if block supplied296        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse] parsed result object297        # @yieldparam err [StandardError] error object if request failed298        #299        # @return [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse]300        #301        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried302        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification303        # @raise [Google::Apis::AuthorizationError] Authorization is required304        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)305          command = make_simple_command(:post, 'v2/{+instanceName}/blobs:batchRead', options)306          command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsRequest::Representation307          command.request_object = build_bazel_remote_execution_v2_batch_read_blobs_request_object308          command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse::Representation309          command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchReadBlobsResponse310          command.params['instanceName'] = instance_name unless instance_name.nil?311          command.query['fields'] = fields unless fields.nil?312          command.query['quotaUser'] = quota_user unless quota_user.nil?313          execute_or_queue_command(command, &block)314        end315        316        # Upload many blobs at once.317        # The server may enforce a limit of the combined total size of blobs318        # to be uploaded using this API. This limit may be obtained using the319        # Capabilities API.320        # Requests exceeding the limit should either be split into smaller321        # chunks or uploaded using the322        # ByteStream API, as appropriate.323        # This request is equivalent to calling a Bytestream `Write` request324        # on each individual blob, in parallel. The requests may succeed or fail325        # independently.326        # Errors:327        # * `INVALID_ARGUMENT`: The client attempted to upload more than the328        # server supported limit.329        # Individual requests may return the following errors, additionally:330        # * `RESOURCE_EXHAUSTED`: There is insufficient disk quota to store the blob.331        # * `INVALID_ARGUMENT`: The332        # Digest does not match the333        # provided data.334        # @param [String] instance_name335        #   The instance of the execution system to operate against. A server may336        #   support multiple instances of the execution system (with their own workers,337        #   storage, caches, etc.). The server MAY require use of this field to select338        #   between them in an implementation-defined fashion, otherwise it can be339        #   omitted.340        # @param [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsRequest] build_bazel_remote_execution_v2_batch_update_blobs_request_object341        # @param [String] fields342        #   Selector specifying which fields to include in a partial response.343        # @param [String] quota_user344        #   Available to use for quota purposes for server-side applications. Can be any345        #   arbitrary string assigned to a user, but should not exceed 40 characters.346        # @param [Google::Apis::RequestOptions] options347        #   Request-specific options348        #349        # @yield [result, err] Result & error if block supplied350        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse] parsed result object351        # @yieldparam err [StandardError] error object if request failed352        #353        # @return [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse]354        #355        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried356        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification357        # @raise [Google::Apis::AuthorizationError] Authorization is required358        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)359          command = make_simple_command(:post, 'v2/{+instanceName}/blobs:batchUpdate', options)360          command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsRequest::Representation361          command.request_object = build_bazel_remote_execution_v2_batch_update_blobs_request_object362          command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse::Representation363          command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2BatchUpdateBlobsResponse364          command.params['instanceName'] = instance_name unless instance_name.nil?365          command.query['fields'] = fields unless fields.nil?366          command.query['quotaUser'] = quota_user unless quota_user.nil?367          execute_or_queue_command(command, &block)368        end369        370        # Determine if blobs are present in the CAS.371        # Clients can use this API before uploading blobs to determine which ones are372        # already present in the CAS and do not need to be uploaded again.373        # There are no method-specific errors.374        # @param [String] instance_name375        #   The instance of the execution system to operate against. A server may376        #   support multiple instances of the execution system (with their own workers,377        #   storage, caches, etc.). The server MAY require use of this field to select378        #   between them in an implementation-defined fashion, otherwise it can be379        #   omitted.380        # @param [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsRequest] build_bazel_remote_execution_v2_find_missing_blobs_request_object381        # @param [String] fields382        #   Selector specifying which fields to include in a partial response.383        # @param [String] quota_user384        #   Available to use for quota purposes for server-side applications. Can be any385        #   arbitrary string assigned to a user, but should not exceed 40 characters.386        # @param [Google::Apis::RequestOptions] options387        #   Request-specific options388        #389        # @yield [result, err] Result & error if block supplied390        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse] parsed result object391        # @yieldparam err [StandardError] error object if request failed392        #393        # @return [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse]394        #395        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried396        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification397        # @raise [Google::Apis::AuthorizationError] Authorization is required398        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)399          command = make_simple_command(:post, 'v2/{+instanceName}/blobs:findMissing', options)400          command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsRequest::Representation401          command.request_object = build_bazel_remote_execution_v2_find_missing_blobs_request_object402          command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse::Representation403          command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2FindMissingBlobsResponse404          command.params['instanceName'] = instance_name unless instance_name.nil?405          command.query['fields'] = fields unless fields.nil?406          command.query['quotaUser'] = quota_user unless quota_user.nil?407          execute_or_queue_command(command, &block)408        end409        410        # Fetch the entire directory tree rooted at a node.411        # This request must be targeted at a412        # Directory stored in the413        # ContentAddressableStorage414        # (CAS). The server will enumerate the `Directory` tree recursively and415        # return every node descended from the root.416        # The GetTreeRequest.page_token parameter can be used to skip ahead in417        # the stream (e.g. when retrying a partially completed and aborted request),418        # by setting it to a value taken from GetTreeResponse.next_page_token of the419        # last successfully processed GetTreeResponse).420        # The exact traversal order is unspecified and, unless retrieving subsequent421        # pages from an earlier request, is not guaranteed to be stable across422        # multiple invocations of `GetTree`.423        # If part of the tree is missing from the CAS, the server will return the424        # portion present and omit the rest.425        # * `NOT_FOUND`: The requested tree root is not present in the CAS.426        # @param [String] instance_name427        #   The instance of the execution system to operate against. A server may428        #   support multiple instances of the execution system (with their own workers,429        #   storage, caches, etc.). The server MAY require use of this field to select430        #   between them in an implementation-defined fashion, otherwise it can be431        #   omitted.432        # @param [String] hash_433        #   The hash. In the case of SHA-256, it will always be a lowercase hex string434        #   exactly 64 characters long.435        # @param [Fixnum] size_bytes436        #   The size of the blob, in bytes.437        # @param [Fixnum] page_size438        #   A maximum page size to request. If present, the server will request no more439        #   than this many items. Regardless of whether a page size is specified, the440        #   server may place its own limit on the number of items to be returned and441        #   require the client to retrieve more items using a subsequent request.442        # @param [String] page_token443        #   A page token, which must be a value received in a previous444        #   GetTreeResponse.445        #   If present, the server will use it to return the following page of results.446        # @param [String] fields447        #   Selector specifying which fields to include in a partial response.448        # @param [String] quota_user449        #   Available to use for quota purposes for server-side applications. Can be any450        #   arbitrary string assigned to a user, but should not exceed 40 characters.451        # @param [Google::Apis::RequestOptions] options452        #   Request-specific options453        #454        # @yield [result, err] Result & error if block supplied455        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse] parsed result object456        # @yieldparam err [StandardError] error object if request failed457        #458        # @return [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse]459        #460        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried461        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification462        # @raise [Google::Apis::AuthorizationError] Authorization is required463        def get_blob_tree(instance_name, hash_, size_bytes, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)464          command = make_simple_command(:get, 'v2/{+instanceName}/blobs/{hash}/{sizeBytes}:getTree', options)465          command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse::Representation466          command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2GetTreeResponse467          command.params['instanceName'] = instance_name unless instance_name.nil?468          command.params['hash'] = hash_ unless hash_.nil?469          command.params['sizeBytes'] = size_bytes unless size_bytes.nil?470          command.query['pageSize'] = page_size unless page_size.nil?471          command.query['pageToken'] = page_token unless page_token.nil?472          command.query['fields'] = fields unless fields.nil?473          command.query['quotaUser'] = quota_user unless quota_user.nil?474          execute_or_queue_command(command, &block)475        end476        477        # Wait for an execution operation to complete. When the client initially478        # makes the request, the server immediately responds with the current status479        # of the execution. The server will leave the request stream open until the480        # operation completes, and then respond with the completed operation. The481        # server MAY choose to stream additional updates as execution progresses,482        # such as to provide an update as to the state of the execution.483        # @param [String] name484        #   The name of the Operation485        #   returned by Execute.486        # @param [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2WaitExecutionRequest] build_bazel_remote_execution_v2_wait_execution_request_object487        # @param [String] fields488        #   Selector specifying which fields to include in a partial response.489        # @param [String] quota_user490        #   Available to use for quota purposes for server-side applications. Can be any491        #   arbitrary string assigned to a user, but should not exceed 40 characters.492        # @param [Google::Apis::RequestOptions] options493        #   Request-specific options494        #495        # @yield [result, err] Result & error if block supplied496        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation] parsed result object497        # @yieldparam err [StandardError] error object if request failed498        #499        # @return [Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation]500        #501        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried502        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification503        # @raise [Google::Apis::AuthorizationError] Authorization is required504        def wait_operation_execution(name, build_bazel_remote_execution_v2_wait_execution_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)505          command = make_simple_command(:post, 'v2/{+name}:waitExecution', options)506          command.request_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2WaitExecutionRequest::Representation507          command.request_object = build_bazel_remote_execution_v2_wait_execution_request_object508          command.response_representation = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation::Representation509          command.response_class = Google::Apis::RemotebuildexecutionV2::GoogleLongrunningOperation510          command.params['name'] = name unless name.nil?511          command.query['fields'] = fields unless fields.nil?512          command.query['quotaUser'] = quota_user unless quota_user.nil?513          execute_or_queue_command(command, &block)514        end515        516        # GetCapabilities returns the server capabilities configuration of the517        # remote endpoint.518        # Only the capabilities of the services supported by the endpoint will519        # be returned:520        # * Execution + CAS + Action Cache endpoints should return both521        # CacheCapabilities and ExecutionCapabilities.522        # * Execution only endpoints should return ExecutionCapabilities.523        # * CAS + Action Cache only endpoints should return CacheCapabilities.524        # @param [String] instance_name525        #   The instance of the execution system to operate against. A server may526        #   support multiple instances of the execution system (with their own workers,527        #   storage, caches, etc.). The server MAY require use of this field to select528        #   between them in an implementation-defined fashion, otherwise it can be529        #   omitted.530        # @param [String] fields531        #   Selector specifying which fields to include in a partial response.532        # @param [String] quota_user533        #   Available to use for quota purposes for server-side applications. Can be any534        #   arbitrary string assigned to a user, but should not exceed 40 characters.535        # @param [Google::Apis::RequestOptions] options536        #   Request-specific options537        #538        # @yield [result, err] Result & error if block supplied539        # @yieldparam result [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities] parsed result object540        # @yieldparam err [StandardError] error object if request failed541        #542        # @return [Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities]543        #544        # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried545        # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification546        # @raise [Google::Apis::AuthorizationError] Authorization is required547        def get_capabilities(instance_name, fields: nil, quota_user: nil, options: nil, &block)548          command = make_simple_command(:get, 'v2/{+instanceName}/capabilities', options)549          command.response_representation = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities::Representation550          command.response_class = Google::Apis::RemotebuildexecutionV2::BuildBazelRemoteExecutionV2ServerCapabilities551          command.params['instanceName'] = instance_name unless instance_name.nil?552          command.query['fields'] = fields unless fields.nil?553          command.query['quotaUser'] = quota_user unless quota_user.nil?554          execute_or_queue_command(command, &block)555        end556        protected557        def apply_command_defaults(command)558          command.query['key'] = key unless key.nil?559          command.query['quotaUser'] = quota_user unless quota_user.nil?560        end561      end562    end563  end564end...default.rb
Source:default.rb  
...5# Copyright 2015, YOUR_COMPANY_NAME6#7# All rights reserved - Do Not Redistribute8#9execute "update package index" do10  command "apt-get update"11  ignore_failure true12end.run_action(:run)13execute "sed apt-source" do14  command "sed -i -e 's%http://archive.ubuntu.com/ubuntu%http://ftp.iij.ad.jp/pub/linux/ubuntu/archive%g' /etc/apt/sources.list"15end.run_action(:run)16packages = %w{g++ bison flex libmpc-dev  libmpfr-dev libgmp-dev texinfo libexpat1-dev17              libncurses5-dev cmake libxml2-dev python-dev swig doxygen subversion18              libedit-dev git libtool automake libhidapi-dev libusb-1.0-0-dev19              graphviz gawk gtkterm silversearcher-ag zip unzip zlib1g-dev python-pip20              liblua5.2-dev binutils-dev libffi-dev libssl-dev21              libblas3 liblapack322              build-essential curl libfreetype6-dev libpng12-dev libzmq3-dev23              python-pyasn1 python-pyasn1-modules swig python-dev24              pkg-config software-properties-common}25packages.each do |pkg|26  package pkg do27    action [:install, :upgrade]28  end29end30dist = node['lsb']['codename']31execute "add ppa:webupdate8team" do32  command "add-apt-repository ppa:webupd8team/java"33  creates "/etc/apt/sources.list.d/webupd8team-#{dist}.list"34end35execute "apt-get update"36execute "echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections"37execute "echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections"38execute "DEBIAN_FRONTEND=noninteractive apt-get install -y oracle-java8-installer"39# Download source code of TensorFlow40git "/home/vagrant/tensorflow" do41  repository "https://github.com/tensorflow/tensorflow"42  revision "master"43  enable_submodules true44  user "vagrant"45  group "vagrant"46  action :sync47end48git "/home/vagrant/bazel" do49  repository "https://github.com/bazelbuild/bazel.git"50  revision "0.1.1"51  enable_submodules true52  user "vagrant"53  group "vagrant"54  action :sync55end56execute "extract pip_python" do57  cwd "/home/vagrant/"58  command "pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0rc0-cp27-none-linux_x86_64.whl"59  action :run60end61directory '/home/vagrant/download' do62  owner 'vagrant'63  group 'vagrant'64  mode '0755'65  action :create66end67remote_file "/home/vagrant/download/python-numpy_1.10.4-2ubuntu2_amd64.deb" do68  source "https://launchpad.net/ubuntu/+archive/primary/+files/python-numpy_1.10.4-2ubuntu2_amd64.deb"69  owner 'vagrant'70  group 'vagrant'71  mode '0755'72  action :create73end74execute "install numpy-1.10.4" do75  cwd "/home/vagrant/download/"76  command "dpkg -i ./python-numpy_1.10.4-2ubuntu2_amd64.deb"77end78remote_file "/home/vagrant/download/bazel-0.2.1-installer-linux-x86_64.sh" do79  source "https://github.com/bazelbuild/bazel/releases/download/0.2.1/bazel-0.2.1-installer-linux-x86_64.sh"80  owner 'vagrant'81  group 'vagrant'82  mode '0755'83  action :create84end85file "/home/vagrant/download/bazel-0.2.1-installer-linux-x86_64.sh" do86  mode '0755'87end88execute "install bazel" do89  user "vagrant"90  environment "HOME" => "/home/vagrant"91  cwd "/home/vagrant/download/"92  command "./bazel-0.2.1-installer-linux-x86_64.sh --user --prefix=/home/vagrant/ --bin=/home/vagrant/bin --base=/home/vagrant/.bazel --bazelrc=/home/vagrant/.bazelrc"93end94execute "extract python_pip grpcio" do95  command "sudo pip install --upgrade ndg-httpsclient && pip install grpcio"96end97git "/home/vagrant/serving" do98  repository "https://github.com/tensorflow/serving"99  enable_submodules true100  user "vagrant"101  group "vagrant"102  action :sync103end104execute "configure tensorflow serving" do105  cwd "/home/vagrant/serving/tensorflow/"106  command "./configure"107  user "vagrant"108  group "vagrant"109end110execute "install tensorflow servivg" do111  cwd "/home/vagrant/serving/"112  environment "HOME" => "/home/vagrant"113  command "/home/vagrant/bin/bazel build tensorflow_serving/..."114  user "vagrant"115  group "vagrant"116end...execute
Using AI Code Generation
1bazel.execute("build", "//my/package:target")2bazel.execute("test", "//my/package:target")3bazel.execute("build", "//my/package:target")4bazel.execute("test", "//my/package:target")5bazel.execute("build", "//my/package:target")6bazel.execute("test", "//my/package:target")7bazel.execute("build", "//my/package:target")8bazel.execute("test", "//my/package:target")9bazel.execute("build", "//my/package:target")10bazel.execute("test", "//my/package:target")11bazel.execute("build", "//my/package:target")12bazel.execute("test", "//my/package:target")13bazel.execute("build", "//myLearn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
