Package cloud.google.com/go/dataproc/v2/apiv1 (v2.15.0) Stay organized with collections Save and categorize content based on your preferences.
Package dataproc is an auto-generated package for theCloud Dataproc API.
Manages Hadoop-based clusters and jobs on Google Cloud Platform.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/dataproc/v2/apiv1@latestctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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, mentioned above.
req:=&dataprocpb.CreateAutoscalingPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateAutoscalingPolicyRequest.}resp,err:=c.CreateAutoscalingPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp
Use of Context
The ctx passed to NewAutoscalingPolicyClient is used for authentication requests andfor 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.
Functions
func DefaultAuthScopes
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AutoscalingPolicyCallOptions
typeAutoscalingPolicyCallOptionsstruct{CreateAutoscalingPolicy[]gax.CallOptionUpdateAutoscalingPolicy[]gax.CallOptionGetAutoscalingPolicy[]gax.CallOptionListAutoscalingPolicies[]gax.CallOptionDeleteAutoscalingPolicy[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}AutoscalingPolicyCallOptions contains the retry settings for each method of AutoscalingPolicyClient.
AutoscalingPolicyClient
typeAutoscalingPolicyClientstruct{// The call options for this service.CallOptions*AutoscalingPolicyCallOptions// contains filtered or unexported fields}AutoscalingPolicyClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The API interface for managing autoscaling policies in theDataproc API.
func NewAutoscalingPolicyClient
funcNewAutoscalingPolicyClient(ctxcontext.Context,opts...option.ClientOption)(*AutoscalingPolicyClient,error)NewAutoscalingPolicyClient creates a new autoscaling policy service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The API interface for managing autoscaling policies in theDataproc API.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewAutoscalingPolicyRESTClient
funcNewAutoscalingPolicyRESTClient(ctxcontext.Context,opts...option.ClientOption)(*AutoscalingPolicyClient,error)NewAutoscalingPolicyRESTClient creates a new autoscaling policy service rest client.
The API interface for managing autoscaling policies in theDataproc API.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*AutoscalingPolicyClient) CancelOperation
func(c*AutoscalingPolicyClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*AutoscalingPolicyClient) Close
func(c*AutoscalingPolicyClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*AutoscalingPolicyClient) Connection (deprecated)
func(c*AutoscalingPolicyClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*AutoscalingPolicyClient) CreateAutoscalingPolicy
func(c*AutoscalingPolicyClient)CreateAutoscalingPolicy(ctxcontext.Context,req*dataprocpb.CreateAutoscalingPolicyRequest,opts...gax.CallOption)(*dataprocpb.AutoscalingPolicy,error)CreateAutoscalingPolicy creates new autoscaling policy.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateAutoscalingPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateAutoscalingPolicyRequest.}resp,err:=c.CreateAutoscalingPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AutoscalingPolicyClient) DeleteAutoscalingPolicy
func(c*AutoscalingPolicyClient)DeleteAutoscalingPolicy(ctxcontext.Context,req*dataprocpb.DeleteAutoscalingPolicyRequest,opts...gax.CallOption)errorDeleteAutoscalingPolicy deletes an autoscaling policy. It is an error to delete an autoscalingpolicy that is in use by one or more clusters.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteAutoscalingPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteAutoscalingPolicyRequest.}err=c.DeleteAutoscalingPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*AutoscalingPolicyClient) DeleteOperation
func(c*AutoscalingPolicyClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*AutoscalingPolicyClient) GetAutoscalingPolicy
func(c*AutoscalingPolicyClient)GetAutoscalingPolicy(ctxcontext.Context,req*dataprocpb.GetAutoscalingPolicyRequest,opts...gax.CallOption)(*dataprocpb.AutoscalingPolicy,error)GetAutoscalingPolicy retrieves autoscaling policy.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetAutoscalingPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetAutoscalingPolicyRequest.}resp,err:=c.GetAutoscalingPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AutoscalingPolicyClient) GetIamPolicy
func(c*AutoscalingPolicyClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AutoscalingPolicyClient) GetOperation
func(c*AutoscalingPolicyClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AutoscalingPolicyClient) ListAutoscalingPolicies
func(c*AutoscalingPolicyClient)ListAutoscalingPolicies(ctxcontext.Context,req*dataprocpb.ListAutoscalingPoliciesRequest,opts...gax.CallOption)*AutoscalingPolicyIteratorListAutoscalingPolicies lists autoscaling policies in the project.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListAutoscalingPoliciesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListAutoscalingPoliciesRequest.}it:=c.ListAutoscalingPolicies(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListAutoscalingPoliciesResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListAutoscalingPoliciesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListAutoscalingPoliciesRequest.}forresp,err:=rangec.ListAutoscalingPolicies(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*AutoscalingPolicyClient) ListOperations
func(c*AutoscalingPolicyClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*AutoscalingPolicyClient) SetIamPolicy
func(c*AutoscalingPolicyClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AutoscalingPolicyClient) TestIamPermissions
func(c*AutoscalingPolicyClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*AutoscalingPolicyClient) UpdateAutoscalingPolicy
func(c*AutoscalingPolicyClient)UpdateAutoscalingPolicy(ctxcontext.Context,req*dataprocpb.UpdateAutoscalingPolicyRequest,opts...gax.CallOption)(*dataprocpb.AutoscalingPolicy,error)UpdateAutoscalingPolicy updates (replaces) autoscaling policy.
Disabled check for update_mask, because all updates will be fullreplacements.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewAutoscalingPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.UpdateAutoscalingPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateAutoscalingPolicyRequest.}resp,err:=c.UpdateAutoscalingPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}AutoscalingPolicyIterator
typeAutoscalingPolicyIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.AutoscalingPolicy,nextPageTokenstring,errerror)// contains filtered or unexported fields}AutoscalingPolicyIterator manages a stream of *dataprocpb.AutoscalingPolicy.
func (*AutoscalingPolicyIterator) All
func(it*AutoscalingPolicyIterator)All()iter.Seq2[*dataprocpb.AutoscalingPolicy,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*AutoscalingPolicyIterator) Next
func(it*AutoscalingPolicyIterator)Next()(*dataprocpb.AutoscalingPolicy,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*AutoscalingPolicyIterator) PageInfo
func(it*AutoscalingPolicyIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
BatchControllerCallOptions
typeBatchControllerCallOptionsstruct{CreateBatch[]gax.CallOptionGetBatch[]gax.CallOptionListBatches[]gax.CallOptionDeleteBatch[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}BatchControllerCallOptions contains the retry settings for each method of BatchControllerClient.
BatchControllerClient
typeBatchControllerClientstruct{// The call options for this service.CallOptions*BatchControllerCallOptions// 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}BatchControllerClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The BatchController provides methods to manage batch workloads.
func NewBatchControllerClient
funcNewBatchControllerClient(ctxcontext.Context,opts...option.ClientOption)(*BatchControllerClient,error)NewBatchControllerClient creates a new batch controller client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The BatchController provides methods to manage batch workloads.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewBatchControllerRESTClient
funcNewBatchControllerRESTClient(ctxcontext.Context,opts...option.ClientOption)(*BatchControllerClient,error)NewBatchControllerRESTClient creates a new batch controller rest client.
The BatchController provides methods to manage batch workloads.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*BatchControllerClient) CancelOperation
func(c*BatchControllerClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*BatchControllerClient) Close
func(c*BatchControllerClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*BatchControllerClient) Connection (deprecated)
func(c*BatchControllerClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*BatchControllerClient) CreateBatch
func(c*BatchControllerClient)CreateBatch(ctxcontext.Context,req*dataprocpb.CreateBatchRequest,opts...gax.CallOption)(*CreateBatchOperation,error)CreateBatch creates a batch workload that executes asynchronously.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateBatchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateBatchRequest.}op,err:=c.CreateBatch(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*BatchControllerClient) CreateBatchOperation
func(c*BatchControllerClient)CreateBatchOperation(namestring)*CreateBatchOperationCreateBatchOperation returns a new CreateBatchOperation from a given name.The name must be that of a previously created CreateBatchOperation, possibly from a different process.
func (*BatchControllerClient) DeleteBatch
func(c*BatchControllerClient)DeleteBatch(ctxcontext.Context,req*dataprocpb.DeleteBatchRequest,opts...gax.CallOption)errorDeleteBatch deletes the batch workload resource. If the batch is not in terminal state,the delete fails and the response returns FAILED_PRECONDITION.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteBatchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteBatchRequest.}err=c.DeleteBatch(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*BatchControllerClient) DeleteOperation
func(c*BatchControllerClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*BatchControllerClient) GetBatch
func(c*BatchControllerClient)GetBatch(ctxcontext.Context,req*dataprocpb.GetBatchRequest,opts...gax.CallOption)(*dataprocpb.Batch,error)GetBatch gets the batch workload resource representation.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetBatchRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetBatchRequest.}resp,err:=c.GetBatch(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*BatchControllerClient) GetIamPolicy
func(c*BatchControllerClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*BatchControllerClient) GetOperation
func(c*BatchControllerClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*BatchControllerClient) ListBatches
func(c*BatchControllerClient)ListBatches(ctxcontext.Context,req*dataprocpb.ListBatchesRequest,opts...gax.CallOption)*BatchIteratorListBatches lists batch workloads.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListBatchesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListBatchesRequest.}it:=c.ListBatches(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListBatchesResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListBatchesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListBatchesRequest.}forresp,err:=rangec.ListBatches(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*BatchControllerClient) ListOperations
func(c*BatchControllerClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*BatchControllerClient) SetIamPolicy
func(c*BatchControllerClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*BatchControllerClient) TestIamPermissions
func(c*BatchControllerClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewBatchControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}BatchIterator
typeBatchIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.Batch,nextPageTokenstring,errerror)// contains filtered or unexported fields}BatchIterator manages a stream of *dataprocpb.Batch.
func (*BatchIterator) All
func(it*BatchIterator)All()iter.Seq2[*dataprocpb.Batch,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*BatchIterator) Next
func(it*BatchIterator)Next()(*dataprocpb.Batch,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*BatchIterator) PageInfo
func(it*BatchIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ClusterControllerCallOptions
typeClusterControllerCallOptionsstruct{CreateCluster[]gax.CallOptionUpdateCluster[]gax.CallOptionStopCluster[]gax.CallOptionStartCluster[]gax.CallOptionDeleteCluster[]gax.CallOptionGetCluster[]gax.CallOptionListClusters[]gax.CallOptionDiagnoseCluster[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ClusterControllerCallOptions contains the retry settings for each method of ClusterControllerClient.
ClusterControllerClient
typeClusterControllerClientstruct{// The call options for this service.CallOptions*ClusterControllerCallOptions// 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}ClusterControllerClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ClusterControllerService provides methods to manage clustersof Compute Engine instances.
func NewClusterControllerClient
funcNewClusterControllerClient(ctxcontext.Context,opts...option.ClientOption)(*ClusterControllerClient,error)NewClusterControllerClient creates a new cluster controller client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The ClusterControllerService provides methods to manage clustersof Compute Engine instances.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewClusterControllerRESTClient
funcNewClusterControllerRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ClusterControllerClient,error)NewClusterControllerRESTClient creates a new cluster controller rest client.
The ClusterControllerService provides methods to manage clustersof Compute Engine instances.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ClusterControllerClient) CancelOperation
func(c*ClusterControllerClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ClusterControllerClient) Close
func(c*ClusterControllerClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ClusterControllerClient) Connection (deprecated)
func(c*ClusterControllerClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ClusterControllerClient) CreateCluster
func(c*ClusterControllerClient)CreateCluster(ctxcontext.Context,req*dataprocpb.CreateClusterRequest,opts...gax.CallOption)(*CreateClusterOperation,error)CreateCluster creates a cluster in a project. The returnedOperation.metadata will beClusterOperationMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateClusterRequest.}op,err:=c.CreateCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) CreateClusterOperation
func(c*ClusterControllerClient)CreateClusterOperation(namestring)*CreateClusterOperationCreateClusterOperation returns a new CreateClusterOperation from a given name.The name must be that of a previously created CreateClusterOperation, possibly from a different process.
func (*ClusterControllerClient) DeleteCluster
func(c*ClusterControllerClient)DeleteCluster(ctxcontext.Context,req*dataprocpb.DeleteClusterRequest,opts...gax.CallOption)(*DeleteClusterOperation,error)DeleteCluster deletes a cluster in a project. The returnedOperation.metadata will beClusterOperationMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteClusterRequest.}op,err:=c.DeleteCluster(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*ClusterControllerClient) DeleteClusterOperation
func(c*ClusterControllerClient)DeleteClusterOperation(namestring)*DeleteClusterOperationDeleteClusterOperation returns a new DeleteClusterOperation from a given name.The name must be that of a previously created DeleteClusterOperation, possibly from a different process.
func (*ClusterControllerClient) DeleteOperation
func(c*ClusterControllerClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ClusterControllerClient) DiagnoseCluster
func(c*ClusterControllerClient)DiagnoseCluster(ctxcontext.Context,req*dataprocpb.DiagnoseClusterRequest,opts...gax.CallOption)(*DiagnoseClusterOperation,error)DiagnoseCluster gets cluster diagnostic information. The returnedOperation.metadata will beClusterOperationMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).After the operation completes,Operation.responsecontainsDiagnoseClusterResults (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DiagnoseClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DiagnoseClusterRequest.}op,err:=c.DiagnoseCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) DiagnoseClusterOperation
func(c*ClusterControllerClient)DiagnoseClusterOperation(namestring)*DiagnoseClusterOperationDiagnoseClusterOperation returns a new DiagnoseClusterOperation from a given name.The name must be that of a previously created DiagnoseClusterOperation, possibly from a different process.
func (*ClusterControllerClient) GetCluster
func(c*ClusterControllerClient)GetCluster(ctxcontext.Context,req*dataprocpb.GetClusterRequest,opts...gax.CallOption)(*dataprocpb.Cluster,error)GetCluster gets the resource representation for a cluster in a project.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetClusterRequest.}resp,err:=c.GetCluster(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) GetIamPolicy
func(c*ClusterControllerClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) GetOperation
func(c*ClusterControllerClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) ListClusters
func(c*ClusterControllerClient)ListClusters(ctxcontext.Context,req*dataprocpb.ListClustersRequest,opts...gax.CallOption)*ClusterIteratorListClusters lists all regions/{region}/clusters in a project alphabetically.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListClustersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListClustersRequest.}it:=c.ListClusters(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListClustersResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListClustersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListClustersRequest.}forresp,err:=rangec.ListClusters(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ClusterControllerClient) ListOperations
func(c*ClusterControllerClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ClusterControllerClient) SetIamPolicy
func(c*ClusterControllerClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) StartCluster
func(c*ClusterControllerClient)StartCluster(ctxcontext.Context,req*dataprocpb.StartClusterRequest,opts...gax.CallOption)(*StartClusterOperation,error)StartCluster starts a cluster in a project.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.StartClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#StartClusterRequest.}op,err:=c.StartCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) StartClusterOperation
func(c*ClusterControllerClient)StartClusterOperation(namestring)*StartClusterOperationStartClusterOperation returns a new StartClusterOperation from a given name.The name must be that of a previously created StartClusterOperation, possibly from a different process.
func (*ClusterControllerClient) StopCluster
func(c*ClusterControllerClient)StopCluster(ctxcontext.Context,req*dataprocpb.StopClusterRequest,opts...gax.CallOption)(*StopClusterOperation,error)StopCluster stops a cluster in a project.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.StopClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#StopClusterRequest.}op,err:=c.StopCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) StopClusterOperation
func(c*ClusterControllerClient)StopClusterOperation(namestring)*StopClusterOperationStopClusterOperation returns a new StopClusterOperation from a given name.The name must be that of a previously created StopClusterOperation, possibly from a different process.
func (*ClusterControllerClient) TestIamPermissions
func(c*ClusterControllerClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) UpdateCluster
func(c*ClusterControllerClient)UpdateCluster(ctxcontext.Context,req*dataprocpb.UpdateClusterRequest,opts...gax.CallOption)(*UpdateClusterOperation,error)UpdateCluster updates a cluster in a project. The returnedOperation.metadata will beClusterOperationMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).The cluster must be in a[RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an erroris returned.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewClusterControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.UpdateClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateClusterRequest.}op,err:=c.UpdateCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ClusterControllerClient) UpdateClusterOperation
func(c*ClusterControllerClient)UpdateClusterOperation(namestring)*UpdateClusterOperationUpdateClusterOperation returns a new UpdateClusterOperation from a given name.The name must be that of a previously created UpdateClusterOperation, possibly from a different process.
ClusterIterator
typeClusterIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.Cluster,nextPageTokenstring,errerror)// contains filtered or unexported fields}ClusterIterator manages a stream of *dataprocpb.Cluster.
func (*ClusterIterator) All
func(it*ClusterIterator)All()iter.Seq2[*dataprocpb.Cluster,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ClusterIterator) Next
func(it*ClusterIterator)Next()(*dataprocpb.Cluster,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ClusterIterator) PageInfo
func(it*ClusterIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CreateBatchOperation
typeCreateBatchOperationstruct{// contains filtered or unexported fields}CreateBatchOperation manages a long-running operation from CreateBatch.
func (*CreateBatchOperation) Done
func(op*CreateBatchOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateBatchOperation) Metadata
func(op*CreateBatchOperation)Metadata()(*dataprocpb.BatchOperationMetadata,error)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 (*CreateBatchOperation) Name
func(op*CreateBatchOperation)Name()stringName 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 (*CreateBatchOperation) Poll
func(op*CreateBatchOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Batch,error)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 andthe 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 (*CreateBatchOperation) Wait
func(op*CreateBatchOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Batch,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateClusterOperation
typeCreateClusterOperationstruct{// contains filtered or unexported fields}CreateClusterOperation manages a long-running operation from CreateCluster.
func (*CreateClusterOperation) Delete
func(op*CreateClusterOperation)Delete(ctxcontext.Context,opts...gax.CallOption)errorDelete deletes a long-running operation.This method indicates that the client is no longer interested in the operation result.It does not cancel the operation.
func (*CreateClusterOperation) Done
func(op*CreateClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateClusterOperation) Metadata
func(op*CreateClusterOperation)Metadata()(*dataprocpb.ClusterOperationMetadata,error)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 (*CreateClusterOperation) Name
func(op*CreateClusterOperation)Name()stringName 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 (*CreateClusterOperation) Poll
func(op*CreateClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)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 andthe 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 (*CreateClusterOperation) Wait
func(op*CreateClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateNodeGroupOperation
typeCreateNodeGroupOperationstruct{// contains filtered or unexported fields}CreateNodeGroupOperation manages a long-running operation from CreateNodeGroup.
func (*CreateNodeGroupOperation) Done
func(op*CreateNodeGroupOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateNodeGroupOperation) Metadata
func(op*CreateNodeGroupOperation)Metadata()(*dataprocpb.NodeGroupOperationMetadata,error)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 (*CreateNodeGroupOperation) Name
func(op*CreateNodeGroupOperation)Name()stringName 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 (*CreateNodeGroupOperation) Poll
func(op*CreateNodeGroupOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.NodeGroup,error)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 andthe 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 (*CreateNodeGroupOperation) Wait
func(op*CreateNodeGroupOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.NodeGroup,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateSessionOperation
typeCreateSessionOperationstruct{// contains filtered or unexported fields}CreateSessionOperation manages a long-running operation from CreateSession.
func (*CreateSessionOperation) Done
func(op*CreateSessionOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateSessionOperation) Metadata
func(op*CreateSessionOperation)Metadata()(*dataprocpb.SessionOperationMetadata,error)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 (*CreateSessionOperation) Name
func(op*CreateSessionOperation)Name()stringName 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 (*CreateSessionOperation) Poll
func(op*CreateSessionOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Session,error)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 andthe 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 (*CreateSessionOperation) Wait
func(op*CreateSessionOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Session,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteClusterOperation
typeDeleteClusterOperationstruct{// contains filtered or unexported fields}DeleteClusterOperation manages a long-running operation from DeleteCluster.
func (*DeleteClusterOperation) Delete
func(op*DeleteClusterOperation)Delete(ctxcontext.Context,opts...gax.CallOption)errorDelete deletes a long-running operation.This method indicates that the client is no longer interested in the operation result.It does not cancel the operation.
func (*DeleteClusterOperation) Done
func(op*DeleteClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteClusterOperation) Metadata
func(op*DeleteClusterOperation)Metadata()(*dataprocpb.ClusterOperationMetadata,error)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 (*DeleteClusterOperation) Name
func(op*DeleteClusterOperation)Name()stringName 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 (*DeleteClusterOperation) Poll
func(op*DeleteClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteClusterOperation) Wait
func(op*DeleteClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteSessionOperation
typeDeleteSessionOperationstruct{// contains filtered or unexported fields}DeleteSessionOperation manages a long-running operation from DeleteSession.
func (*DeleteSessionOperation) Done
func(op*DeleteSessionOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteSessionOperation) Metadata
func(op*DeleteSessionOperation)Metadata()(*dataprocpb.SessionOperationMetadata,error)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 (*DeleteSessionOperation) Name
func(op*DeleteSessionOperation)Name()stringName 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 (*DeleteSessionOperation) Poll
func(op*DeleteSessionOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Session,error)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 andthe 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 (*DeleteSessionOperation) Wait
func(op*DeleteSessionOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Session,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DiagnoseClusterOperation
typeDiagnoseClusterOperationstruct{// contains filtered or unexported fields}DiagnoseClusterOperation manages a long-running operation from DiagnoseCluster.
func (*DiagnoseClusterOperation) Delete
func(op*DiagnoseClusterOperation)Delete(ctxcontext.Context,opts...gax.CallOption)errorDelete deletes a long-running operation.This method indicates that the client is no longer interested in the operation result.It does not cancel the operation.
func (*DiagnoseClusterOperation) Done
func(op*DiagnoseClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DiagnoseClusterOperation) Metadata
func(op*DiagnoseClusterOperation)Metadata()(*dataprocpb.ClusterOperationMetadata,error)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 (*DiagnoseClusterOperation) Name
func(op*DiagnoseClusterOperation)Name()stringName 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 (*DiagnoseClusterOperation) Poll
func(op*DiagnoseClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.DiagnoseClusterResults,error)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 andthe 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 (*DiagnoseClusterOperation) Wait
func(op*DiagnoseClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.DiagnoseClusterResults,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
InstantiateInlineWorkflowTemplateOperation
typeInstantiateInlineWorkflowTemplateOperationstruct{// contains filtered or unexported fields}InstantiateInlineWorkflowTemplateOperation manages a long-running operation from InstantiateInlineWorkflowTemplate.
func (*InstantiateInlineWorkflowTemplateOperation) Cancel
func(op*InstantiateInlineWorkflowTemplateOperation)Cancel(ctxcontext.Context,opts...gax.CallOption)errorCancel starts asynchronous cancellation on a long-running operation.The server makes a best effort to cancel the operation, but success is not guaranteed.Clients can use Poll or other methods to check whether the cancellation succeeded or whether the operationcompleted despite cancellation. On successful cancellation, the operation is not deleted;instead, op.Poll returns an error with code Canceled.
func (*InstantiateInlineWorkflowTemplateOperation) Delete
func(op*InstantiateInlineWorkflowTemplateOperation)Delete(ctxcontext.Context,opts...gax.CallOption)errorDelete deletes a long-running operation.This method indicates that the client is no longer interested in the operation result.It does not cancel the operation.
func (*InstantiateInlineWorkflowTemplateOperation) Done
func(op*InstantiateInlineWorkflowTemplateOperation)Done()boolDone reports whether the long-running operation has completed.
func (*InstantiateInlineWorkflowTemplateOperation) Metadata
func(op*InstantiateInlineWorkflowTemplateOperation)Metadata()(*dataprocpb.WorkflowMetadata,error)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 (*InstantiateInlineWorkflowTemplateOperation) Name
func(op*InstantiateInlineWorkflowTemplateOperation)Name()stringName 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 (*InstantiateInlineWorkflowTemplateOperation) Poll
func(op*InstantiateInlineWorkflowTemplateOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*InstantiateInlineWorkflowTemplateOperation) Wait
func(op*InstantiateInlineWorkflowTemplateOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
InstantiateWorkflowTemplateOperation
typeInstantiateWorkflowTemplateOperationstruct{// contains filtered or unexported fields}InstantiateWorkflowTemplateOperation manages a long-running operation from InstantiateWorkflowTemplate.
func (*InstantiateWorkflowTemplateOperation) Cancel
func(op*InstantiateWorkflowTemplateOperation)Cancel(ctxcontext.Context,opts...gax.CallOption)errorCancel starts asynchronous cancellation on a long-running operation.The server makes a best effort to cancel the operation, but success is not guaranteed.Clients can use Poll or other methods to check whether the cancellation succeeded or whether the operationcompleted despite cancellation. On successful cancellation, the operation is not deleted;instead, op.Poll returns an error with code Canceled.
func (*InstantiateWorkflowTemplateOperation) Delete
func(op*InstantiateWorkflowTemplateOperation)Delete(ctxcontext.Context,opts...gax.CallOption)errorDelete deletes a long-running operation.This method indicates that the client is no longer interested in the operation result.It does not cancel the operation.
func (*InstantiateWorkflowTemplateOperation) Done
func(op*InstantiateWorkflowTemplateOperation)Done()boolDone reports whether the long-running operation has completed.
func (*InstantiateWorkflowTemplateOperation) Metadata
func(op*InstantiateWorkflowTemplateOperation)Metadata()(*dataprocpb.WorkflowMetadata,error)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 (*InstantiateWorkflowTemplateOperation) Name
func(op*InstantiateWorkflowTemplateOperation)Name()stringName 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 (*InstantiateWorkflowTemplateOperation) Poll
func(op*InstantiateWorkflowTemplateOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*InstantiateWorkflowTemplateOperation) Wait
func(op*InstantiateWorkflowTemplateOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
JobControllerCallOptions
typeJobControllerCallOptionsstruct{SubmitJob[]gax.CallOptionSubmitJobAsOperation[]gax.CallOptionGetJob[]gax.CallOptionListJobs[]gax.CallOptionUpdateJob[]gax.CallOptionCancelJob[]gax.CallOptionDeleteJob[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}JobControllerCallOptions contains the retry settings for each method of JobControllerClient.
JobControllerClient
typeJobControllerClientstruct{// The call options for this service.CallOptions*JobControllerCallOptions// 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}JobControllerClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The JobController provides methods to manage jobs.
func NewJobControllerClient
funcNewJobControllerClient(ctxcontext.Context,opts...option.ClientOption)(*JobControllerClient,error)NewJobControllerClient creates a new job controller client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The JobController provides methods to manage jobs.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewJobControllerRESTClient
funcNewJobControllerRESTClient(ctxcontext.Context,opts...option.ClientOption)(*JobControllerClient,error)NewJobControllerRESTClient creates a new job controller rest client.
The JobController provides methods to manage jobs.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*JobControllerClient) CancelJob
func(c*JobControllerClient)CancelJob(ctxcontext.Context,req*dataprocpb.CancelJobRequest,opts...gax.CallOption)(*dataprocpb.Job,error)CancelJob starts a job cancellation request. To access the job resourceafter cancellation, callregions/{region}/jobs.list (athttps://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list)orregions/{region}/jobs.get (athttps://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CancelJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CancelJobRequest.}resp,err:=c.CancelJob(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) CancelOperation
func(c*JobControllerClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*JobControllerClient) Close
func(c*JobControllerClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*JobControllerClient) Connection (deprecated)
func(c*JobControllerClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*JobControllerClient) DeleteJob
func(c*JobControllerClient)DeleteJob(ctxcontext.Context,req*dataprocpb.DeleteJobRequest,opts...gax.CallOption)errorDeleteJob deletes the job from the project. If the job is active, the delete fails,and the response returns FAILED_PRECONDITION.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteJobRequest.}err=c.DeleteJob(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*JobControllerClient) DeleteOperation
func(c*JobControllerClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*JobControllerClient) GetIamPolicy
func(c*JobControllerClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) GetJob
func(c*JobControllerClient)GetJob(ctxcontext.Context,req*dataprocpb.GetJobRequest,opts...gax.CallOption)(*dataprocpb.Job,error)GetJob gets the resource representation for a job in a project.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetJobRequest.}resp,err:=c.GetJob(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) GetOperation
func(c*JobControllerClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) ListJobs
func(c*JobControllerClient)ListJobs(ctxcontext.Context,req*dataprocpb.ListJobsRequest,opts...gax.CallOption)*JobIteratorListJobs lists regions/{region}/jobs in a project.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListJobsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListJobsRequest.}it:=c.ListJobs(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListJobsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListJobsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListJobsRequest.}forresp,err:=rangec.ListJobs(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*JobControllerClient) ListOperations
func(c*JobControllerClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*JobControllerClient) SetIamPolicy
func(c*JobControllerClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) SubmitJob
func(c*JobControllerClient)SubmitJob(ctxcontext.Context,req*dataprocpb.SubmitJobRequest,opts...gax.CallOption)(*dataprocpb.Job,error)SubmitJob submits a job to a cluster.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.SubmitJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#SubmitJobRequest.}resp,err:=c.SubmitJob(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) SubmitJobAsOperation
func(c*JobControllerClient)SubmitJobAsOperation(ctxcontext.Context,req*dataprocpb.SubmitJobRequest,opts...gax.CallOption)(*SubmitJobAsOperationOperation,error)SubmitJobAsOperation submits job to a cluster.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.SubmitJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#SubmitJobRequest.}op,err:=c.SubmitJobAsOperation(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) SubmitJobAsOperationOperation
func(c*JobControllerClient)SubmitJobAsOperationOperation(namestring)*SubmitJobAsOperationOperationSubmitJobAsOperationOperation returns a new SubmitJobAsOperationOperation from a given name.The name must be that of a previously created SubmitJobAsOperationOperation, possibly from a different process.
func (*JobControllerClient) TestIamPermissions
func(c*JobControllerClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*JobControllerClient) UpdateJob
func(c*JobControllerClient)UpdateJob(ctxcontext.Context,req*dataprocpb.UpdateJobRequest,opts...gax.CallOption)(*dataprocpb.Job,error)UpdateJob updates a job in a project.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewJobControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.UpdateJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateJobRequest.}resp,err:=c.UpdateJob(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}JobIterator
typeJobIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.Job,nextPageTokenstring,errerror)// contains filtered or unexported fields}JobIterator manages a stream of *dataprocpb.Job.
func (*JobIterator) All
func(it*JobIterator)All()iter.Seq2[*dataprocpb.Job,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*JobIterator) Next
func(it*JobIterator)Next()(*dataprocpb.Job,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*JobIterator) PageInfo
func(it*JobIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
NodeGroupControllerCallOptions
typeNodeGroupControllerCallOptionsstruct{CreateNodeGroup[]gax.CallOptionResizeNodeGroup[]gax.CallOptionGetNodeGroup[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}NodeGroupControllerCallOptions contains the retry settings for each method of NodeGroupControllerClient.
NodeGroupControllerClient
typeNodeGroupControllerClientstruct{// The call options for this service.CallOptions*NodeGroupControllerCallOptions// 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}NodeGroupControllerClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NodeGroupControllerService provides methods to manage node groupsof Compute Engine managed instances.
func NewNodeGroupControllerClient
funcNewNodeGroupControllerClient(ctxcontext.Context,opts...option.ClientOption)(*NodeGroupControllerClient,error)NewNodeGroupControllerClient creates a new node group controller client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The NodeGroupControllerService provides methods to manage node groupsof Compute Engine managed instances.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewNodeGroupControllerRESTClient
funcNewNodeGroupControllerRESTClient(ctxcontext.Context,opts...option.ClientOption)(*NodeGroupControllerClient,error)NewNodeGroupControllerRESTClient creates a new node group controller rest client.
The NodeGroupControllerService provides methods to manage node groupsof Compute Engine managed instances.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*NodeGroupControllerClient) CancelOperation
func(c*NodeGroupControllerClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*NodeGroupControllerClient) Close
func(c*NodeGroupControllerClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*NodeGroupControllerClient) Connection (deprecated)
func(c*NodeGroupControllerClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*NodeGroupControllerClient) CreateNodeGroup
func(c*NodeGroupControllerClient)CreateNodeGroup(ctxcontext.Context,req*dataprocpb.CreateNodeGroupRequest,opts...gax.CallOption)(*CreateNodeGroupOperation,error)CreateNodeGroup creates a node group in a cluster. The returnedOperation.metadata isNodeGroupOperationMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateNodeGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateNodeGroupRequest.}op,err:=c.CreateNodeGroup(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*NodeGroupControllerClient) CreateNodeGroupOperation
func(c*NodeGroupControllerClient)CreateNodeGroupOperation(namestring)*CreateNodeGroupOperationCreateNodeGroupOperation returns a new CreateNodeGroupOperation from a given name.The name must be that of a previously created CreateNodeGroupOperation, possibly from a different process.
func (*NodeGroupControllerClient) DeleteOperation
func(c*NodeGroupControllerClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*NodeGroupControllerClient) GetIamPolicy
func(c*NodeGroupControllerClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*NodeGroupControllerClient) GetNodeGroup
func(c*NodeGroupControllerClient)GetNodeGroup(ctxcontext.Context,req*dataprocpb.GetNodeGroupRequest,opts...gax.CallOption)(*dataprocpb.NodeGroup,error)GetNodeGroup gets the resource representation for a node group in acluster.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetNodeGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetNodeGroupRequest.}resp,err:=c.GetNodeGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*NodeGroupControllerClient) GetOperation
func(c*NodeGroupControllerClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*NodeGroupControllerClient) ListOperations
func(c*NodeGroupControllerClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*NodeGroupControllerClient) ResizeNodeGroup
func(c*NodeGroupControllerClient)ResizeNodeGroup(ctxcontext.Context,req*dataprocpb.ResizeNodeGroupRequest,opts...gax.CallOption)(*ResizeNodeGroupOperation,error)ResizeNodeGroup resizes a node group in a cluster. The returnedOperation.metadata isNodeGroupOperationMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ResizeNodeGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ResizeNodeGroupRequest.}op,err:=c.ResizeNodeGroup(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*NodeGroupControllerClient) ResizeNodeGroupOperation
func(c*NodeGroupControllerClient)ResizeNodeGroupOperation(namestring)*ResizeNodeGroupOperationResizeNodeGroupOperation returns a new ResizeNodeGroupOperation from a given name.The name must be that of a previously created ResizeNodeGroupOperation, possibly from a different process.
func (*NodeGroupControllerClient) SetIamPolicy
func(c*NodeGroupControllerClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*NodeGroupControllerClient) TestIamPermissions
func(c*NodeGroupControllerClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewNodeGroupControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}OperationIterator
typeOperationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// contains filtered or unexported fields}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func(it*OperationIterator)All()iter.Seq2[*longrunningpb.Operation,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*OperationIterator) Next
func(it*OperationIterator)Next()(*longrunningpb.Operation,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func(it*OperationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ResizeNodeGroupOperation
typeResizeNodeGroupOperationstruct{// contains filtered or unexported fields}ResizeNodeGroupOperation manages a long-running operation from ResizeNodeGroup.
func (*ResizeNodeGroupOperation) Done
func(op*ResizeNodeGroupOperation)Done()boolDone reports whether the long-running operation has completed.
func (*ResizeNodeGroupOperation) Metadata
func(op*ResizeNodeGroupOperation)Metadata()(*dataprocpb.NodeGroupOperationMetadata,error)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 (*ResizeNodeGroupOperation) Name
func(op*ResizeNodeGroupOperation)Name()stringName 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 (*ResizeNodeGroupOperation) Poll
func(op*ResizeNodeGroupOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.NodeGroup,error)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 andthe 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 (*ResizeNodeGroupOperation) Wait
func(op*ResizeNodeGroupOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.NodeGroup,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
SessionControllerCallOptions
typeSessionControllerCallOptionsstruct{CreateSession[]gax.CallOptionGetSession[]gax.CallOptionListSessions[]gax.CallOptionTerminateSession[]gax.CallOptionDeleteSession[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SessionControllerCallOptions contains the retry settings for each method of SessionControllerClient.
SessionControllerClient
typeSessionControllerClientstruct{// The call options for this service.CallOptions*SessionControllerCallOptions// 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}SessionControllerClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SessionController provides methods to manage interactive sessions.
func NewSessionControllerClient
funcNewSessionControllerClient(ctxcontext.Context,opts...option.ClientOption)(*SessionControllerClient,error)NewSessionControllerClient creates a new session controller client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The SessionController provides methods to manage interactive sessions.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSessionControllerRESTClient
funcNewSessionControllerRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SessionControllerClient,error)NewSessionControllerRESTClient creates a new session controller rest client.
The SessionController provides methods to manage interactive sessions.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SessionControllerClient) CancelOperation
func(c*SessionControllerClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*SessionControllerClient) Close
func(c*SessionControllerClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SessionControllerClient) Connection (deprecated)
func(c*SessionControllerClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SessionControllerClient) CreateSession
func(c*SessionControllerClient)CreateSession(ctxcontext.Context,req*dataprocpb.CreateSessionRequest,opts...gax.CallOption)(*CreateSessionOperation,error)CreateSession create an interactive session asynchronously.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateSessionRequest.}op,err:=c.CreateSession(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) CreateSessionOperation
func(c*SessionControllerClient)CreateSessionOperation(namestring)*CreateSessionOperationCreateSessionOperation returns a new CreateSessionOperation from a given name.The name must be that of a previously created CreateSessionOperation, possibly from a different process.
func (*SessionControllerClient) DeleteOperation
func(c*SessionControllerClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*SessionControllerClient) DeleteSession
func(c*SessionControllerClient)DeleteSession(ctxcontext.Context,req*dataprocpb.DeleteSessionRequest,opts...gax.CallOption)(*DeleteSessionOperation,error)DeleteSession deletes the interactive session resource. If the session is not in terminalstate, it is terminated, and then deleted.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteSessionRequest.}op,err:=c.DeleteSession(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) DeleteSessionOperation
func(c*SessionControllerClient)DeleteSessionOperation(namestring)*DeleteSessionOperationDeleteSessionOperation returns a new DeleteSessionOperation from a given name.The name must be that of a previously created DeleteSessionOperation, possibly from a different process.
func (*SessionControllerClient) GetIamPolicy
func(c*SessionControllerClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) GetOperation
func(c*SessionControllerClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) GetSession
func(c*SessionControllerClient)GetSession(ctxcontext.Context,req*dataprocpb.GetSessionRequest,opts...gax.CallOption)(*dataprocpb.Session,error)GetSession gets the resource representation for an interactive session.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetSessionRequest.}resp,err:=c.GetSession(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) ListOperations
func(c*SessionControllerClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SessionControllerClient) ListSessions
func(c*SessionControllerClient)ListSessions(ctxcontext.Context,req*dataprocpb.ListSessionsRequest,opts...gax.CallOption)*SessionIteratorListSessions lists interactive sessions.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListSessionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionsRequest.}it:=c.ListSessions(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListSessionsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListSessionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionsRequest.}forresp,err:=rangec.ListSessions(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SessionControllerClient) SetIamPolicy
func(c*SessionControllerClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) TerminateSession
func(c*SessionControllerClient)TerminateSession(ctxcontext.Context,req*dataprocpb.TerminateSessionRequest,opts...gax.CallOption)(*TerminateSessionOperation,error)TerminateSession terminates the interactive session.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.TerminateSessionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#TerminateSessionRequest.}op,err:=c.TerminateSession(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionControllerClient) TerminateSessionOperation
func(c*SessionControllerClient)TerminateSessionOperation(namestring)*TerminateSessionOperationTerminateSessionOperation returns a new TerminateSessionOperation from a given name.The name must be that of a previously created TerminateSessionOperation, possibly from a different process.
func (*SessionControllerClient) TestIamPermissions
func(c*SessionControllerClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}SessionIterator
typeSessionIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.Session,nextPageTokenstring,errerror)// contains filtered or unexported fields}SessionIterator manages a stream of *dataprocpb.Session.
func (*SessionIterator) All
func(it*SessionIterator)All()iter.Seq2[*dataprocpb.Session,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*SessionIterator) Next
func(it*SessionIterator)Next()(*dataprocpb.Session,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*SessionIterator) PageInfo
func(it*SessionIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SessionTemplateControllerCallOptions
typeSessionTemplateControllerCallOptionsstruct{CreateSessionTemplate[]gax.CallOptionUpdateSessionTemplate[]gax.CallOptionGetSessionTemplate[]gax.CallOptionListSessionTemplates[]gax.CallOptionDeleteSessionTemplate[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}SessionTemplateControllerCallOptions contains the retry settings for each method of SessionTemplateControllerClient.
SessionTemplateControllerClient
typeSessionTemplateControllerClientstruct{// The call options for this service.CallOptions*SessionTemplateControllerCallOptions// contains filtered or unexported fields}SessionTemplateControllerClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SessionTemplateController provides methods to manage session templates.
func NewSessionTemplateControllerClient
funcNewSessionTemplateControllerClient(ctxcontext.Context,opts...option.ClientOption)(*SessionTemplateControllerClient,error)NewSessionTemplateControllerClient creates a new session template controller client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The SessionTemplateController provides methods to manage session templates.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewSessionTemplateControllerRESTClient
funcNewSessionTemplateControllerRESTClient(ctxcontext.Context,opts...option.ClientOption)(*SessionTemplateControllerClient,error)NewSessionTemplateControllerRESTClient creates a new session template controller rest client.
The SessionTemplateController provides methods to manage session templates.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*SessionTemplateControllerClient) CancelOperation
func(c*SessionTemplateControllerClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*SessionTemplateControllerClient) Close
func(c*SessionTemplateControllerClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*SessionTemplateControllerClient) Connection (deprecated)
func(c*SessionTemplateControllerClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*SessionTemplateControllerClient) CreateSessionTemplate
func(c*SessionTemplateControllerClient)CreateSessionTemplate(ctxcontext.Context,req*dataprocpb.CreateSessionTemplateRequest,opts...gax.CallOption)(*dataprocpb.SessionTemplate,error)CreateSessionTemplate create a session template synchronously.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateSessionTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateSessionTemplateRequest.}resp,err:=c.CreateSessionTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionTemplateControllerClient) DeleteOperation
func(c*SessionTemplateControllerClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*SessionTemplateControllerClient) DeleteSessionTemplate
func(c*SessionTemplateControllerClient)DeleteSessionTemplate(ctxcontext.Context,req*dataprocpb.DeleteSessionTemplateRequest,opts...gax.CallOption)errorDeleteSessionTemplate deletes a session template.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteSessionTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteSessionTemplateRequest.}err=c.DeleteSessionTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*SessionTemplateControllerClient) GetIamPolicy
func(c*SessionTemplateControllerClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionTemplateControllerClient) GetOperation
func(c*SessionTemplateControllerClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionTemplateControllerClient) GetSessionTemplate
func(c*SessionTemplateControllerClient)GetSessionTemplate(ctxcontext.Context,req*dataprocpb.GetSessionTemplateRequest,opts...gax.CallOption)(*dataprocpb.SessionTemplate,error)GetSessionTemplate gets the resource representation for a session template.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetSessionTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetSessionTemplateRequest.}resp,err:=c.GetSessionTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionTemplateControllerClient) ListOperations
func(c*SessionTemplateControllerClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SessionTemplateControllerClient) ListSessionTemplates
func(c*SessionTemplateControllerClient)ListSessionTemplates(ctxcontext.Context,req*dataprocpb.ListSessionTemplatesRequest,opts...gax.CallOption)*SessionTemplateIteratorListSessionTemplates lists session templates.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListSessionTemplatesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionTemplatesRequest.}it:=c.ListSessionTemplates(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListSessionTemplatesResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListSessionTemplatesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionTemplatesRequest.}forresp,err:=rangec.ListSessionTemplates(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*SessionTemplateControllerClient) SetIamPolicy
func(c*SessionTemplateControllerClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionTemplateControllerClient) TestIamPermissions
func(c*SessionTemplateControllerClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*SessionTemplateControllerClient) UpdateSessionTemplate
func(c*SessionTemplateControllerClient)UpdateSessionTemplate(ctxcontext.Context,req*dataprocpb.UpdateSessionTemplateRequest,opts...gax.CallOption)(*dataprocpb.SessionTemplate,error)UpdateSessionTemplate updates the session template synchronously.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewSessionTemplateControllerClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.UpdateSessionTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateSessionTemplateRequest.}resp,err:=c.UpdateSessionTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}SessionTemplateIterator
typeSessionTemplateIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.SessionTemplate,nextPageTokenstring,errerror)// contains filtered or unexported fields}SessionTemplateIterator manages a stream of *dataprocpb.SessionTemplate.
func (*SessionTemplateIterator) All
func(it*SessionTemplateIterator)All()iter.Seq2[*dataprocpb.SessionTemplate,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*SessionTemplateIterator) Next
func(it*SessionTemplateIterator)Next()(*dataprocpb.SessionTemplate,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*SessionTemplateIterator) PageInfo
func(it*SessionTemplateIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
StartClusterOperation
typeStartClusterOperationstruct{// contains filtered or unexported fields}StartClusterOperation manages a long-running operation from StartCluster.
func (*StartClusterOperation) Done
func(op*StartClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*StartClusterOperation) Metadata
func(op*StartClusterOperation)Metadata()(*dataprocpb.ClusterOperationMetadata,error)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 (*StartClusterOperation) Name
func(op*StartClusterOperation)Name()stringName 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 (*StartClusterOperation) Poll
func(op*StartClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)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 andthe 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 (*StartClusterOperation) Wait
func(op*StartClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
StopClusterOperation
typeStopClusterOperationstruct{// contains filtered or unexported fields}StopClusterOperation manages a long-running operation from StopCluster.
func (*StopClusterOperation) Done
func(op*StopClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*StopClusterOperation) Metadata
func(op*StopClusterOperation)Metadata()(*dataprocpb.ClusterOperationMetadata,error)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 (*StopClusterOperation) Name
func(op*StopClusterOperation)Name()stringName 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 (*StopClusterOperation) Poll
func(op*StopClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)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 andthe 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 (*StopClusterOperation) Wait
func(op*StopClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
SubmitJobAsOperationOperation
typeSubmitJobAsOperationOperationstruct{// contains filtered or unexported fields}SubmitJobAsOperationOperation manages a long-running operation from SubmitJobAsOperation.
func (*SubmitJobAsOperationOperation) Done
func(op*SubmitJobAsOperationOperation)Done()boolDone reports whether the long-running operation has completed.
func (*SubmitJobAsOperationOperation) Metadata
func(op*SubmitJobAsOperationOperation)Metadata()(*dataprocpb.JobMetadata,error)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 (*SubmitJobAsOperationOperation) Name
func(op*SubmitJobAsOperationOperation)Name()stringName 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 (*SubmitJobAsOperationOperation) Poll
func(op*SubmitJobAsOperationOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Job,error)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 andthe 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 (*SubmitJobAsOperationOperation) Wait
func(op*SubmitJobAsOperationOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Job,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
TerminateSessionOperation
typeTerminateSessionOperationstruct{// contains filtered or unexported fields}TerminateSessionOperation manages a long-running operation from TerminateSession.
func (*TerminateSessionOperation) Done
func(op*TerminateSessionOperation)Done()boolDone reports whether the long-running operation has completed.
func (*TerminateSessionOperation) Metadata
func(op*TerminateSessionOperation)Metadata()(*dataprocpb.SessionOperationMetadata,error)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 (*TerminateSessionOperation) Name
func(op*TerminateSessionOperation)Name()stringName 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 (*TerminateSessionOperation) Poll
func(op*TerminateSessionOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Session,error)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 andthe 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 (*TerminateSessionOperation) Wait
func(op*TerminateSessionOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Session,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateClusterOperation
typeUpdateClusterOperationstruct{// contains filtered or unexported fields}UpdateClusterOperation manages a long-running operation from UpdateCluster.
func (*UpdateClusterOperation) Delete
func(op*UpdateClusterOperation)Delete(ctxcontext.Context,opts...gax.CallOption)errorDelete deletes a long-running operation.This method indicates that the client is no longer interested in the operation result.It does not cancel the operation.
func (*UpdateClusterOperation) Done
func(op*UpdateClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateClusterOperation) Metadata
func(op*UpdateClusterOperation)Metadata()(*dataprocpb.ClusterOperationMetadata,error)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 (*UpdateClusterOperation) Name
func(op*UpdateClusterOperation)Name()stringName 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 (*UpdateClusterOperation) Poll
func(op*UpdateClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)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 andthe 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 (*UpdateClusterOperation) Wait
func(op*UpdateClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*dataprocpb.Cluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
WorkflowTemplateCallOptions
typeWorkflowTemplateCallOptionsstruct{CreateWorkflowTemplate[]gax.CallOptionGetWorkflowTemplate[]gax.CallOptionInstantiateWorkflowTemplate[]gax.CallOptionInstantiateInlineWorkflowTemplate[]gax.CallOptionUpdateWorkflowTemplate[]gax.CallOptionListWorkflowTemplates[]gax.CallOptionDeleteWorkflowTemplate[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}WorkflowTemplateCallOptions contains the retry settings for each method of WorkflowTemplateClient.
WorkflowTemplateClient
typeWorkflowTemplateClientstruct{// The call options for this service.CallOptions*WorkflowTemplateCallOptions// 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}WorkflowTemplateClient is a client for interacting with Cloud Dataproc API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The API interface for managing Workflow Templates in theDataproc API.
func NewWorkflowTemplateClient
funcNewWorkflowTemplateClient(ctxcontext.Context,opts...option.ClientOption)(*WorkflowTemplateClient,error)NewWorkflowTemplateClient creates a new workflow template service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The API interface for managing Workflow Templates in theDataproc API.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewWorkflowTemplateRESTClient
funcNewWorkflowTemplateRESTClient(ctxcontext.Context,opts...option.ClientOption)(*WorkflowTemplateClient,error)NewWorkflowTemplateRESTClient creates a new workflow template service rest client.
The API interface for managing Workflow Templates in theDataproc API.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*WorkflowTemplateClient) CancelOperation
func(c*WorkflowTemplateClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*WorkflowTemplateClient) Close
func(c*WorkflowTemplateClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*WorkflowTemplateClient) Connection (deprecated)
func(c*WorkflowTemplateClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*WorkflowTemplateClient) CreateWorkflowTemplate
func(c*WorkflowTemplateClient)CreateWorkflowTemplate(ctxcontext.Context,req*dataprocpb.CreateWorkflowTemplateRequest,opts...gax.CallOption)(*dataprocpb.WorkflowTemplate,error)CreateWorkflowTemplate creates new workflow template.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.CreateWorkflowTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateWorkflowTemplateRequest.}resp,err:=c.CreateWorkflowTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*WorkflowTemplateClient) DeleteOperation
func(c*WorkflowTemplateClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*WorkflowTemplateClient) DeleteWorkflowTemplate
func(c*WorkflowTemplateClient)DeleteWorkflowTemplate(ctxcontext.Context,req*dataprocpb.DeleteWorkflowTemplateRequest,opts...gax.CallOption)errorDeleteWorkflowTemplate deletes a workflow template. It does not cancel in-progress workflows.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.DeleteWorkflowTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteWorkflowTemplateRequest.}err=c.DeleteWorkflowTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*WorkflowTemplateClient) GetIamPolicy
func(c*WorkflowTemplateClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*WorkflowTemplateClient) GetOperation
func(c*WorkflowTemplateClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*WorkflowTemplateClient) GetWorkflowTemplate
func(c*WorkflowTemplateClient)GetWorkflowTemplate(ctxcontext.Context,req*dataprocpb.GetWorkflowTemplateRequest,opts...gax.CallOption)(*dataprocpb.WorkflowTemplate,error)GetWorkflowTemplate retrieves the latest workflow template.
Can retrieve previously instantiated template by specifying optionalversion parameter.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.GetWorkflowTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetWorkflowTemplateRequest.}resp,err:=c.GetWorkflowTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*WorkflowTemplateClient) InstantiateInlineWorkflowTemplate
func(c*WorkflowTemplateClient)InstantiateInlineWorkflowTemplate(ctxcontext.Context,req*dataprocpb.InstantiateInlineWorkflowTemplateRequest,opts...gax.CallOption)(*InstantiateInlineWorkflowTemplateOperation,error)InstantiateInlineWorkflowTemplate instantiates a template and begins execution.
This method is equivalent to executing the sequenceCreateWorkflowTemplate,InstantiateWorkflowTemplate,DeleteWorkflowTemplate.
The returned Operation can be used to track execution ofworkflow by pollingoperations.get.The Operation will complete when entire workflow is finished.
The running workflow can be aborted viaoperations.cancel.This will cause any inflight jobs to be cancelled and workflow-ownedclusters to be deleted.
The Operation.metadata will beWorkflowMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).Also see UsingWorkflowMetadata (athttps://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion,Operation.response will beEmpty.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.InstantiateInlineWorkflowTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#InstantiateInlineWorkflowTemplateRequest.}op,err:=c.InstantiateInlineWorkflowTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*WorkflowTemplateClient) InstantiateInlineWorkflowTemplateOperation
func(c*WorkflowTemplateClient)InstantiateInlineWorkflowTemplateOperation(namestring)*InstantiateInlineWorkflowTemplateOperationInstantiateInlineWorkflowTemplateOperation returns a new InstantiateInlineWorkflowTemplateOperation from a given name.The name must be that of a previously created InstantiateInlineWorkflowTemplateOperation, possibly from a different process.
func (*WorkflowTemplateClient) InstantiateWorkflowTemplate
func(c*WorkflowTemplateClient)InstantiateWorkflowTemplate(ctxcontext.Context,req*dataprocpb.InstantiateWorkflowTemplateRequest,opts...gax.CallOption)(*InstantiateWorkflowTemplateOperation,error)InstantiateWorkflowTemplate instantiates a template and begins execution.
The returned Operation can be used to track execution ofworkflow by pollingoperations.get.The Operation will complete when entire workflow is finished.
The running workflow can be aborted viaoperations.cancel.This will cause any inflight jobs to be cancelled and workflow-ownedclusters to be deleted.
The Operation.metadata will beWorkflowMetadata (athttps://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).Also see UsingWorkflowMetadata (athttps://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
On successful completion,Operation.response will beEmpty.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.InstantiateWorkflowTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#InstantiateWorkflowTemplateRequest.}op,err:=c.InstantiateWorkflowTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*WorkflowTemplateClient) InstantiateWorkflowTemplateOperation
func(c*WorkflowTemplateClient)InstantiateWorkflowTemplateOperation(namestring)*InstantiateWorkflowTemplateOperationInstantiateWorkflowTemplateOperation returns a new InstantiateWorkflowTemplateOperation from a given name.The name must be that of a previously created InstantiateWorkflowTemplateOperation, possibly from a different process.
func (*WorkflowTemplateClient) ListOperations
func(c*WorkflowTemplateClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*WorkflowTemplateClient) ListWorkflowTemplates
func(c*WorkflowTemplateClient)ListWorkflowTemplates(ctxcontext.Context,req*dataprocpb.ListWorkflowTemplatesRequest,opts...gax.CallOption)*WorkflowTemplateIteratorListWorkflowTemplates lists workflows that match the specified filter in the request.
Examples
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListWorkflowTemplatesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListWorkflowTemplatesRequest.}it:=c.ListWorkflowTemplates(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*dataprocpb.ListWorkflowTemplatesResponse)}}all
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.ListWorkflowTemplatesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListWorkflowTemplatesRequest.}forresp,err:=rangec.ListWorkflowTemplates(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*WorkflowTemplateClient) SetIamPolicy
func(c*WorkflowTemplateClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*WorkflowTemplateClient) TestIamPermissions
func(c*WorkflowTemplateClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"iampb"cloud.google.com/go/iam/apiv1/iampb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*WorkflowTemplateClient) UpdateWorkflowTemplate
func(c*WorkflowTemplateClient)UpdateWorkflowTemplate(ctxcontext.Context,req*dataprocpb.UpdateWorkflowTemplateRequest,opts...gax.CallOption)(*dataprocpb.WorkflowTemplate,error)UpdateWorkflowTemplate updates (replaces) workflow template. The updated templatemust contain version that matches the current server version.
Example
packagemainimport("context"dataproc"cloud.google.com/go/dataproc/v2/apiv1"dataprocpb"cloud.google.com/go/dataproc/v2/apiv1/dataprocpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=dataproc.NewWorkflowTemplateClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&dataprocpb.UpdateWorkflowTemplateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateWorkflowTemplateRequest.}resp,err:=c.UpdateWorkflowTemplate(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}WorkflowTemplateIterator
typeWorkflowTemplateIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*dataprocpb.WorkflowTemplate,nextPageTokenstring,errerror)// contains filtered or unexported fields}WorkflowTemplateIterator manages a stream of *dataprocpb.WorkflowTemplate.
func (*WorkflowTemplateIterator) All
func(it*WorkflowTemplateIterator)All()iter.Seq2[*dataprocpb.WorkflowTemplate,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*WorkflowTemplateIterator) Next
func(it*WorkflowTemplateIterator)Next()(*dataprocpb.WorkflowTemplate,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*WorkflowTemplateIterator) PageInfo
func(it*WorkflowTemplateIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.