Cloud Life Sciences API v2beta - Package cloud.google.com/go/lifesciences/apiv2beta (v0.2.0)

Package lifesciences is an auto-generated package for the Cloud Life Sciences API.

Cloud Life Sciences is a suite of services and tools for managing, processing, and transforming life sciences data.

 NOTE 
 : 
  
 This 
  
 package 
  
 is 
  
 in 
  
 beta 
 . 
  
 It 
  
 is 
  
 not 
  
 stable 
 , 
  
 and 
  
 may 
  
 be 
  
 subject 
  
 to 
  
 changes 
 . 

Example usage

To get started with this package, create a client.

 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
 c 
 , 
  
 err 
  
 := 
  
 lifesciences 
 . 
 NewWorkflowsServiceV2BetaClient 
 ( 
 ctx 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 defer 
  
 c 
 . 
 Close 
 () 

The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client.

 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
 c 
 , 
  
 err 
  
 := 
  
 lifesciences 
 . 
 NewWorkflowsServiceV2BetaClient 
 ( 
 ctx 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 defer 
  
 c 
 . 
 Close 
 () 
 req 
  
 := 
  
& lifesciencespb 
 . 
 RunPipelineRequest 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/lifesciences/v2beta#RunPipelineRequest. 
 } 
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 RunPipeline 
 ( 
 ctx 
 , 
  
 req 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 resp 
 , 
  
 err 
  
 := 
  
 op 
 . 
 Wait 
 ( 
 ctx 
 ) 
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
 } 
 // TODO: Use resp. 
 _ 
  
 = 
  
 resp 

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go .

Functions

func DefaultAuthScopes

  func 
  
 DefaultAuthScopes 
 () 
  
 [] 
  string 
 
 

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

RunPipelineOperation

  type 
  
 RunPipelineOperation 
  
 struct 
  
 { 
  
 // contains filtered or unexported fields 
 } 
 

RunPipelineOperation manages a long-running operation from RunPipeline.

func (*RunPipelineOperation) Done

  func 
  
 ( 
 op 
  
 * 
  RunPipelineOperation 
 
 ) 
  
 Done 
 () 
  
  bool 
 
 

Done reports whether the long-running operation has completed.

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*RunPipelineOperation) Name

  func 
  
 ( 
 op 
  
 * 
  RunPipelineOperation 
 
 ) 
  
 Name 
 () 
  
  string 
 
 

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*RunPipelineOperation) Poll

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*RunPipelineOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

WorkflowsServiceV2BetaCallOptions

  type 
  
 WorkflowsServiceV2BetaCallOptions 
  
 struct 
  
 { 
  
 RunPipeline 
  
 [] 
  gax 
 
 . 
  CallOption 
 
 } 
 

WorkflowsServiceV2BetaCallOptions contains the retry settings for each method of WorkflowsServiceV2BetaClient.

WorkflowsServiceV2BetaClient

  type 
  
 WorkflowsServiceV2BetaClient 
  
 struct 
  
 { 
  
 // The call options for this service. 
  
 CallOptions 
  
 * 
  WorkflowsServiceV2BetaCallOptions 
 
  
 // LROClient is used internally to handle long-running operations. 
  
 // It is exposed so that its CallOptions can be modified if required. 
  
 // Users should not Close this client. 
  
 LROClient 
  
 * 
  lroauto 
 
 . 
  OperationsClient 
 
  
 // contains filtered or unexported fields 
 } 
 

WorkflowsServiceV2BetaClient is a client for interacting with Cloud Life Sciences API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

A service for running workflows, such as pipelines consisting of Docker containers.

func NewWorkflowsServiceV2BetaClient

  func 
  
 NewWorkflowsServiceV2BetaClient 
 ( 
 ctx 
  
  context 
 
 . 
  Context 
 
 , 
  
 opts 
  
 ... 
 option 
 . 
 ClientOption 
 ) 
  
 ( 
 * 
  WorkflowsServiceV2BetaClient 
 
 , 
  
  error 
 
 ) 
 

NewWorkflowsServiceV2BetaClient creates a new workflows service v2 beta client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

A service for running workflows, such as pipelines consisting of Docker containers.

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lifesciences 
  
 "cloud.google.com/go/lifesciences/apiv2beta" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 c 
 , 
  
 err 
  
 := 
  
 lifesciences 
 . 
 NewWorkflowsServiceV2BetaClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 // TODO: Use client. 
  
 _ 
  
 = 
  
 c 
 } 
 

func (*WorkflowsServiceV2BetaClient) Close

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*WorkflowsServiceV2BetaClient) Connection

  func 
  
 ( 
 c 
  
 * 
  WorkflowsServiceV2BetaClient 
 
 ) 
  
 Connection 
 () 
  
 * 
 grpc 
 . 
 ClientConn 
 

Connection returns a connection to the API service.

Deprecated.

func (*WorkflowsServiceV2BetaClient) RunPipeline

RunPipeline 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 (at https://cloud.google.com/iam/ ) permission:

lifesciences.workflows.run

Example

  package 
  
 main 
 import 
  
 ( 
  
 "context" 
  
 lifesciences 
  
 "cloud.google.com/go/lifesciences/apiv2beta" 
  
 lifesciencespb 
  
 "google.golang.org/genproto/googleapis/cloud/lifesciences/v2beta" 
 ) 
 func 
  
 main 
 () 
  
 { 
  
 ctx 
  
 := 
  
 context 
 . 
 Background 
 () 
  
 c 
 , 
  
 err 
  
 := 
  
 lifesciences 
 . 
 NewWorkflowsServiceV2BetaClient 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 defer 
  
 c 
 . 
  Close 
 
 () 
  
 req 
  
 := 
  
& lifesciencespb 
 . 
  RunPipelineRequest 
 
 { 
  
 // TODO: Fill request struct fields. 
  
 // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/lifesciences/v2beta#RunPipelineRequest. 
  
 } 
  
 op 
 , 
  
 err 
  
 := 
  
 c 
 . 
 RunPipeline 
 ( 
 ctx 
 , 
  
 req 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 resp 
 , 
  
 err 
  
 := 
  
 op 
 . 
  Wait 
 
 ( 
 ctx 
 ) 
  
 if 
  
 err 
  
 != 
  
 nil 
  
 { 
  
 // TODO: Handle error. 
  
 } 
  
 // TODO: Use resp. 
  
 _ 
  
 = 
  
 resp 
 } 
 

func (*WorkflowsServiceV2BetaClient) RunPipelineOperation

  func 
  
 ( 
 c 
  
 * 
  WorkflowsServiceV2BetaClient 
 
 ) 
  
 RunPipelineOperation 
 ( 
 name 
  
  string 
 
 ) 
  
 * 
  RunPipelineOperation 
 
 

RunPipelineOperation returns a new RunPipelineOperation from a given name. The name must be that of a previously created RunPipelineOperation, possibly from a different process.

Create a Mobile Website
View Site in Mobile | Classic
Share by: