Reference documentation and code samples for the Cloud Life Sciences V2beta API class Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.
Client for the WorkflowsService service.
A service for running workflows, such as pipelines consisting of Docker containers.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the WorkflowsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all WorkflowsService clients ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the WorkflowsService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> Client
Create a new WorkflowsService client object.
- (config) — Configure the WorkflowsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new do |config| config.timeout = 10.0 end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#operations_client
def operations_client() -> ::Google::Cloud::LifeSciences::V2beta::WorkflowsService::Operations
Get the associated client for long-running operations.
#run_pipeline
def run_pipeline(request, options = nil) -> ::Gapic::Operation
def run_pipeline(parent: nil, pipeline: nil, labels: nil, pub_sub_topic: nil) -> ::Gapic::Operation
Runs a pipeline. The returned Operation's [metadata] [google.longrunning.Operation.metadata] field will contain a google.cloud.lifesciences.v2beta.Metadata object describing the status of the pipeline execution. The response field will contain a google.cloud.lifesciences.v2beta.RunPipelineResponse object if the pipeline completes successfully.
Note: Before you can use this method, the Life Sciences Service Agent must have access to your project. This is done automatically when the Cloud Life Sciences API is first enabled, but if you delete this permission you must disable and re-enable the API to grant the Life Sciences Service Agent the required permissions. Authorization requires the following Google IAM permission:
lifesciences.workflows.run
def run_pipeline(request, options = nil) -> ::Gapic::Operation
run_pipeline
via a request object, either of type
RunPipelineRequest or an equivalent Hash.
- request (::Google::Cloud::LifeSciences::V2beta::RunPipelineRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def run_pipeline(parent: nil, pipeline: nil, labels: nil, pub_sub_topic: nil) -> ::Gapic::Operation
run_pipeline
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — The project and location that this request should be executed against.
- pipeline (::Google::Cloud::LifeSciences::V2beta::Pipeline, ::Hash) — Required. The description of the pipeline to run.
-
labels (::Hash{::String => ::String}) — User-defined labels to associate with the returned operation. These
labels are not propagated to any Google Cloud Platform resources used by
the operation, and can be modified at any time.
To associate labels with resources created while executing the operation, see the appropriate resource message (for example,
VirtualMachine
). - pub_sub_topic (::String) — The name of an existing Pub/Sub topic. The server will publish messages to this topic whenever the status of the operation changes. The Life Sciences Service Agent account must have publisher permissions to the specified topic or notifications will not be sent.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/life_sciences/v2beta" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::LifeSciences::V2beta::RunPipelineRequest.new # Call the run_pipeline method. result = client.run_pipeline request # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done! timeout: 60 if result.response? p result.response else puts "No response received." end