Cloud Run Admin API v2 - Package cloud.google.com/go/run/apiv2 (v1.12.1)

Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.

Package run is an auto-generated package for theCloud Run Admin API.

Deploy and manage user provided container images that scale automaticallybased on incoming requests. The Cloud Run Admin API v1 follows the KnativeServing API specification, while v2 is aligned with Google Cloud AIP-basedAPI standards, as described inhttps://google.aip.dev/ (athttps://google.aip.dev/).

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:

Example usage

To get started with this package, create a client.

// go get cloud.google.com/go/run/apiv2@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:=run.NewBuildsClient(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:=&runpb.SubmitBuildRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#SubmitBuildRequest.}resp,err:=c.SubmitBuild(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp

Use of Context

The ctx passed to NewBuildsClient 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()[]string

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

BuildsCallOptions

typeBuildsCallOptionsstruct{SubmitBuild[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

BuildsCallOptions contains the retry settings for each method of BuildsClient.

BuildsClient

typeBuildsClientstruct{// The call options for this service.CallOptions*BuildsCallOptions// contains filtered or unexported fields}

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

Cloud Run Build Control Plane API

func NewBuildsClient

funcNewBuildsClient(ctxcontext.Context,opts...option.ClientOption)(*BuildsClient,error)

NewBuildsClient creates a new builds client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run Build Control Plane API

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewBuildsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewBuildsRESTClient

funcNewBuildsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*BuildsClient,error)

NewBuildsRESTClient creates a new builds rest client.

Cloud Run Build Control Plane API

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewBuildsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*BuildsClient) Close

func(c*BuildsClient)Close()error

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

func (*BuildsClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*BuildsClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewBuildsClient(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 (*BuildsClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewBuildsClient(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 (*BuildsClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewBuildsClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewBuildsClient(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 (*BuildsClient) SubmitBuild

SubmitBuild submits a build in a given project.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewBuildsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.SubmitBuildRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#SubmitBuildRequest.}resp,err:=c.SubmitBuild(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*BuildsClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewBuildsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

CancelExecutionOperation

typeCancelExecutionOperationstruct{// contains filtered or unexported fields}

CancelExecutionOperation manages a long-running operation from CancelExecution.

func (*CancelExecutionOperation) Done

Done reports whether the long-running operation has completed.

func (*CancelExecutionOperation) Metadata

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 (*CancelExecutionOperation) Name

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

func (*CancelExecutionOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CancelExecutionOperation) Wait

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

See documentation of Poll for error-handling information.

CreateJobOperation

typeCreateJobOperationstruct{// contains filtered or unexported fields}

CreateJobOperation manages a long-running operation from CreateJob.

func (*CreateJobOperation) Done

func(op*CreateJobOperation)Done()bool

Done reports whether the long-running operation has completed.

func (*CreateJobOperation) Metadata

func(op*CreateJobOperation)Metadata()(*runpb.Job,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 (*CreateJobOperation) Name

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

func (*CreateJobOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateJobOperation) Wait

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

See documentation of Poll for error-handling information.

CreateServiceOperation

typeCreateServiceOperationstruct{// contains filtered or unexported fields}

CreateServiceOperation manages a long-running operation from CreateService.

func (*CreateServiceOperation) Done

Done reports whether the long-running operation has completed.

func (*CreateServiceOperation) Metadata

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 (*CreateServiceOperation) Name

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

func (*CreateServiceOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateServiceOperation) Wait

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

See documentation of Poll for error-handling information.

CreateWorkerPoolOperation

typeCreateWorkerPoolOperationstruct{// contains filtered or unexported fields}

CreateWorkerPoolOperation manages a long-running operation from CreateWorkerPool.

func (*CreateWorkerPoolOperation) Done

Done reports whether the long-running operation has completed.

func (*CreateWorkerPoolOperation) Metadata

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 (*CreateWorkerPoolOperation) Name

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

func (*CreateWorkerPoolOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateWorkerPoolOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteExecutionOperation

typeDeleteExecutionOperationstruct{// contains filtered or unexported fields}

DeleteExecutionOperation manages a long-running operation from DeleteExecution.

func (*DeleteExecutionOperation) Done

Done reports whether the long-running operation has completed.

func (*DeleteExecutionOperation) Metadata

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 (*DeleteExecutionOperation) Name

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

func (*DeleteExecutionOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteExecutionOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteJobOperation

typeDeleteJobOperationstruct{// contains filtered or unexported fields}

DeleteJobOperation manages a long-running operation from DeleteJob.

func (*DeleteJobOperation) Done

func(op*DeleteJobOperation)Done()bool

Done reports whether the long-running operation has completed.

func (*DeleteJobOperation) Metadata

func(op*DeleteJobOperation)Metadata()(*runpb.Job,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 (*DeleteJobOperation) Name

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

func (*DeleteJobOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteJobOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteRevisionOperation

typeDeleteRevisionOperationstruct{// contains filtered or unexported fields}

DeleteRevisionOperation manages a long-running operation from DeleteRevision.

func (*DeleteRevisionOperation) Done

Done reports whether the long-running operation has completed.

func (*DeleteRevisionOperation) Metadata

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 (*DeleteRevisionOperation) Name

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

func (*DeleteRevisionOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteRevisionOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteServiceOperation

typeDeleteServiceOperationstruct{// contains filtered or unexported fields}

DeleteServiceOperation manages a long-running operation from DeleteService.

func (*DeleteServiceOperation) Done

Done reports whether the long-running operation has completed.

func (*DeleteServiceOperation) Metadata

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 (*DeleteServiceOperation) Name

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

func (*DeleteServiceOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteServiceOperation) Wait

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

See documentation of Poll for error-handling information.

DeleteWorkerPoolOperation

typeDeleteWorkerPoolOperationstruct{// contains filtered or unexported fields}

DeleteWorkerPoolOperation manages a long-running operation from DeleteWorkerPool.

func (*DeleteWorkerPoolOperation) Done

Done reports whether the long-running operation has completed.

func (*DeleteWorkerPoolOperation) Metadata

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 (*DeleteWorkerPoolOperation) Name

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

func (*DeleteWorkerPoolOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteWorkerPoolOperation) Wait

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

See documentation of Poll for error-handling information.

ExecutionIterator

typeExecutionIteratorstruct{// 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[]*runpb.Execution,nextPageTokenstring,errerror)// contains filtered or unexported fields}

ExecutionIterator manages a stream of *runpb.Execution.

func (*ExecutionIterator) All

func(it*ExecutionIterator)All()iter.Seq2[*runpb.Execution,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*ExecutionIterator) Next

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 (*ExecutionIterator) PageInfo

func(it*ExecutionIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

ExecutionsCallOptions

typeExecutionsCallOptionsstruct{GetExecution[]gax.CallOptionListExecutions[]gax.CallOptionDeleteExecution[]gax.CallOptionCancelExecution[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

ExecutionsCallOptions contains the retry settings for each method of ExecutionsClient.

ExecutionsClient

typeExecutionsClientstruct{// The call options for this service.CallOptions*ExecutionsCallOptions// 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}

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

Cloud Run Execution Control Plane API.

func NewExecutionsClient

funcNewExecutionsClient(ctxcontext.Context,opts...option.ClientOption)(*ExecutionsClient,error)

NewExecutionsClient creates a new executions client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run Execution Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewExecutionsRESTClient

funcNewExecutionsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ExecutionsClient,error)

NewExecutionsRESTClient creates a new executions rest client.

Cloud Run Execution Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewExecutionsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*ExecutionsClient) CancelExecution

CancelExecution cancels an Execution.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.CancelExecutionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#CancelExecutionRequest.}op,err:=c.CancelExecution(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ExecutionsClient) CancelExecutionOperation

func(c*ExecutionsClient)CancelExecutionOperation(namestring)*CancelExecutionOperation

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

func (*ExecutionsClient) Close

func(c*ExecutionsClient)Close()error

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

func (*ExecutionsClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*ExecutionsClient) DeleteExecution

DeleteExecution deletes an Execution.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.DeleteExecutionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteExecutionRequest.}op,err:=c.DeleteExecution(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ExecutionsClient) DeleteExecutionOperation

func(c*ExecutionsClient)DeleteExecutionOperation(namestring)*DeleteExecutionOperation

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

func (*ExecutionsClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewExecutionsClient(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 (*ExecutionsClient) GetExecution

GetExecution gets information about an Execution.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.GetExecutionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetExecutionRequest.}resp,err:=c.GetExecution(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ExecutionsClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewExecutionsClient(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 (*ExecutionsClient) ListExecutions

ListExecutions lists Executions from a Job. Results are sorted by creation time,descending.

Examples

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb""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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListExecutionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListExecutionsRequest.}it:=c.ListExecutions(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.(*runpb.ListExecutionsResponse)}}
all
packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListExecutionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListExecutionsRequest.}forresp,err:=rangec.ListExecutions(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*ExecutionsClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewExecutionsClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewExecutionsClient(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 (*ExecutionsClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewExecutionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(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[]*runpb.Job,nextPageTokenstring,errerror)// contains filtered or unexported fields}

JobIterator manages a stream of *runpb.Job.

func (*JobIterator) All

func(it*JobIterator)All()iter.Seq2[*runpb.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()(*runpb.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.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

JobsCallOptions

typeJobsCallOptionsstruct{CreateJob[]gax.CallOptionGetJob[]gax.CallOptionListJobs[]gax.CallOptionUpdateJob[]gax.CallOptionDeleteJob[]gax.CallOptionRunJob[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

JobsCallOptions contains the retry settings for each method of JobsClient.

JobsClient

typeJobsClientstruct{// The call options for this service.CallOptions*JobsCallOptions// 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}

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

Cloud Run Job Control Plane API.

func NewJobsClient

funcNewJobsClient(ctxcontext.Context,opts...option.ClientOption)(*JobsClient,error)

NewJobsClient creates a new jobs client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run Job Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewJobsRESTClient

funcNewJobsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*JobsClient,error)

NewJobsRESTClient creates a new jobs rest client.

Cloud Run Job Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*JobsClient) Close

func(c*JobsClient)Close()error

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

func (*JobsClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*JobsClient) CreateJob

CreateJob creates a Job.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.CreateJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#CreateJobRequest.}op,err:=c.CreateJob(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*JobsClient) CreateJobOperation

func(c*JobsClient)CreateJobOperation(namestring)*CreateJobOperation

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

func (*JobsClient) DeleteJob

DeleteJob deletes a Job.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.DeleteJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteJobRequest.}op,err:=c.DeleteJob(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*JobsClient) DeleteJobOperation

func(c*JobsClient)DeleteJobOperation(namestring)*DeleteJobOperation

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

func (*JobsClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(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 (*JobsClient) GetIamPolicy

GetIamPolicy gets the IAM Access Control policy currently in effect for the given Job.This result does not include any inherited policies.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(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 (*JobsClient) GetJob

GetJob gets information about a Job.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.GetJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetJobRequest.}resp,err:=c.GetJob(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*JobsClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(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 (*JobsClient) ListJobs

ListJobs lists Jobs. Results are sorted by creation time, descending.

Examples

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb""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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListJobsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#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.(*runpb.ListJobsResponse)}}
all
packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListJobsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#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 (*JobsClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewJobsClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(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 (*JobsClient) RunJob

RunJob triggers creation of a new Execution of this Job.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.RunJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#RunJobRequest.}op,err:=c.RunJob(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*JobsClient) RunJobOperation

func(c*JobsClient)RunJobOperation(namestring)*RunJobOperation

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

func (*JobsClient) SetIamPolicy

SetIamPolicy sets the IAM Access control policy for the specified Job. Overwritesany existing policy.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(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 (*JobsClient) TestIamPermissions

TestIamPermissions returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(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 (*JobsClient) UpdateJob

UpdateJob updates a Job.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.UpdateJobRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#UpdateJobRequest.}op,err:=c.UpdateJob(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*JobsClient) UpdateJobOperation

func(c*JobsClient)UpdateJobOperation(namestring)*UpdateJobOperation

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

func (*JobsClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewJobsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

LocationIterator

typeLocationIteratorstruct{// 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[]*locationpb.Location,nextPageTokenstring,errerror)// contains filtered or unexported fields}

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) Next

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 (*LocationIterator) PageInfo

func(it*LocationIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

LocationsCallOptions

typeLocationsCallOptionsstruct{ListLocations[]gax.CallOptionGetLocation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

LocationsCallOptions contains the retry settings for each method of LocationsClient.

LocationsClient

typeLocationsClientstruct{// The call options for this service.CallOptions*LocationsCallOptions// contains filtered or unexported fields}

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

An abstract interface that provides location-related information fora service. Service-specific metadata is provided through theLocation.metadata field.

func NewLocationsClient

funcNewLocationsClient(ctxcontext.Context,opts...option.ClientOption)(*LocationsClient,error)

NewLocationsClient creates a new locations client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

An abstract interface that provides location-related information fora service. Service-specific metadata is provided through theLocation.metadata field.

func NewLocationsRESTClient

funcNewLocationsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*LocationsClient,error)

NewLocationsRESTClient creates a new locations rest client.

An abstract interface that provides location-related information fora service. Service-specific metadata is provided through theLocation.metadata field.

func (*LocationsClient) Close

func(c*LocationsClient)Close()error

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

func (*LocationsClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*LocationsClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

func (*LocationsClient) GetLocation

GetLocation gets information about a location.

func (*LocationsClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

func (*LocationsClient) ListLocations

ListLocations lists information about the supported locations for this service.

func (*LocationsClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

func (*LocationsClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

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

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.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

RevisionIterator

typeRevisionIteratorstruct{// 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[]*runpb.Revision,nextPageTokenstring,errerror)// contains filtered or unexported fields}

RevisionIterator manages a stream of *runpb.Revision.

func (*RevisionIterator) All

func(it*RevisionIterator)All()iter.Seq2[*runpb.Revision,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*RevisionIterator) Next

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 (*RevisionIterator) PageInfo

func(it*RevisionIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

RevisionsCallOptions

typeRevisionsCallOptionsstruct{GetRevision[]gax.CallOptionListRevisions[]gax.CallOptionDeleteRevision[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

RevisionsCallOptions contains the retry settings for each method of RevisionsClient.

RevisionsClient

typeRevisionsClientstruct{// The call options for this service.CallOptions*RevisionsCallOptions// 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}

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

Cloud Run Revision Control Plane API.

func NewRevisionsClient

funcNewRevisionsClient(ctxcontext.Context,opts...option.ClientOption)(*RevisionsClient,error)

NewRevisionsClient creates a new revisions client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run Revision Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewRevisionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewRevisionsRESTClient

funcNewRevisionsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*RevisionsClient,error)

NewRevisionsRESTClient creates a new revisions rest client.

Cloud Run Revision Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewRevisionsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*RevisionsClient) Close

func(c*RevisionsClient)Close()error

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

func (*RevisionsClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*RevisionsClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewRevisionsClient(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 (*RevisionsClient) DeleteRevision

DeleteRevision deletes a Revision.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewRevisionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.DeleteRevisionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteRevisionRequest.}op,err:=c.DeleteRevision(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*RevisionsClient) DeleteRevisionOperation

func(c*RevisionsClient)DeleteRevisionOperation(namestring)*DeleteRevisionOperation

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

func (*RevisionsClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewRevisionsClient(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 (*RevisionsClient) GetRevision

GetRevision gets information about a Revision.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewRevisionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.GetRevisionRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetRevisionRequest.}resp,err:=c.GetRevision(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*RevisionsClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewRevisionsClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewRevisionsClient(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 (*RevisionsClient) ListRevisions

ListRevisions lists Revisions from a given Service, or from a given location. Resultsare sorted by creation time, descending.

Examples

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb""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:=run.NewRevisionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListRevisionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListRevisionsRequest.}it:=c.ListRevisions(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.(*runpb.ListRevisionsResponse)}}
all
packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewRevisionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListRevisionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListRevisionsRequest.}forresp,err:=rangec.ListRevisions(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*RevisionsClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewRevisionsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

RunJobOperation

typeRunJobOperationstruct{// contains filtered or unexported fields}

RunJobOperation manages a long-running operation from RunJob.

func (*RunJobOperation) Done

func(op*RunJobOperation)Done()bool

Done reports whether the long-running operation has completed.

func (*RunJobOperation) Metadata

func(op*RunJobOperation)Metadata()(*runpb.Execution,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 (*RunJobOperation) Name

func(op*RunJobOperation)Name()string

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

func (*RunJobOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*RunJobOperation) Wait

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

See documentation of Poll for error-handling information.

ServiceIterator

typeServiceIteratorstruct{// 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[]*runpb.Service,nextPageTokenstring,errerror)// contains filtered or unexported fields}

ServiceIterator manages a stream of *runpb.Service.

func (*ServiceIterator) All

func(it*ServiceIterator)All()iter.Seq2[*runpb.Service,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*ServiceIterator) Next

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 (*ServiceIterator) PageInfo

func(it*ServiceIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

ServicesCallOptions

typeServicesCallOptionsstruct{CreateService[]gax.CallOptionGetService[]gax.CallOptionListServices[]gax.CallOptionUpdateService[]gax.CallOptionDeleteService[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

ServicesCallOptions contains the retry settings for each method of ServicesClient.

ServicesClient

typeServicesClientstruct{// The call options for this service.CallOptions*ServicesCallOptions// 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}

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

Cloud Run Service Control Plane API

func NewServicesClient

funcNewServicesClient(ctxcontext.Context,opts...option.ClientOption)(*ServicesClient,error)

NewServicesClient creates a new services client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run Service Control Plane API

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewServicesRESTClient

funcNewServicesRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ServicesClient,error)

NewServicesRESTClient creates a new services rest client.

Cloud Run Service Control Plane API

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*ServicesClient) Close

func(c*ServicesClient)Close()error

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

func (*ServicesClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*ServicesClient) CreateService

CreateService creates a new Service in a given project and location.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.CreateServiceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#CreateServiceRequest.}op,err:=c.CreateService(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServicesClient) CreateServiceOperation

func(c*ServicesClient)CreateServiceOperation(namestring)*CreateServiceOperation

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

func (*ServicesClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(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 (*ServicesClient) DeleteService

DeleteService deletes a Service.This will cause the Service to stop serving traffic and will delete allrevisions.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.DeleteServiceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteServiceRequest.}op,err:=c.DeleteService(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServicesClient) DeleteServiceOperation

func(c*ServicesClient)DeleteServiceOperation(namestring)*DeleteServiceOperation

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

func (*ServicesClient) GetIamPolicy

GetIamPolicy gets the IAM Access Control policy currently in effect for the givenCloud Run Service. This result does not include any inherited policies.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(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 (*ServicesClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(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 (*ServicesClient) GetService

GetService gets information about a Service.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.GetServiceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetServiceRequest.}resp,err:=c.GetService(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServicesClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewServicesClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(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 (*ServicesClient) ListServices

ListServices lists Services. Results are sorted by creation time, descending.

Examples

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb""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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListServicesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListServicesRequest.}it:=c.ListServices(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.(*runpb.ListServicesResponse)}}
all
packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListServicesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListServicesRequest.}forresp,err:=rangec.ListServices(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*ServicesClient) SetIamPolicy

SetIamPolicy sets the IAM Access control policy for the specified Service. Overwritesany existing policy.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(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 (*ServicesClient) TestIamPermissions

TestIamPermissions returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(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 (*ServicesClient) UpdateService

UpdateService updates a Service.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.UpdateServiceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#UpdateServiceRequest.}op,err:=c.UpdateService(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServicesClient) UpdateServiceOperation

func(c*ServicesClient)UpdateServiceOperation(namestring)*UpdateServiceOperation

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

func (*ServicesClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewServicesClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

TaskIterator

typeTaskIteratorstruct{// 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[]*runpb.Task,nextPageTokenstring,errerror)// contains filtered or unexported fields}

TaskIterator manages a stream of *runpb.Task.

func (*TaskIterator) All

func(it*TaskIterator)All()iter.Seq2[*runpb.Task,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*TaskIterator) Next

func(it*TaskIterator)Next()(*runpb.Task,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 (*TaskIterator) PageInfo

func(it*TaskIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

TasksCallOptions

typeTasksCallOptionsstruct{GetTask[]gax.CallOptionListTasks[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

TasksCallOptions contains the retry settings for each method of TasksClient.

TasksClient

typeTasksClientstruct{// The call options for this service.CallOptions*TasksCallOptions// contains filtered or unexported fields}

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

Cloud Run Task Control Plane API.

func NewTasksClient

funcNewTasksClient(ctxcontext.Context,opts...option.ClientOption)(*TasksClient,error)

NewTasksClient creates a new tasks client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run Task Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewTasksClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewTasksRESTClient

funcNewTasksRESTClient(ctxcontext.Context,opts...option.ClientOption)(*TasksClient,error)

NewTasksRESTClient creates a new tasks rest client.

Cloud Run Task Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewTasksRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*TasksClient) Close

func(c*TasksClient)Close()error

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

func (*TasksClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*TasksClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewTasksClient(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 (*TasksClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewTasksClient(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 (*TasksClient) GetTask

GetTask gets information about a Task.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewTasksClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.GetTaskRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetTaskRequest.}resp,err:=c.GetTask(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*TasksClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewTasksClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewTasksClient(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 (*TasksClient) ListTasks

ListTasks lists Tasks from an Execution of a Job.

Examples

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb""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:=run.NewTasksClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListTasksRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListTasksRequest.}it:=c.ListTasks(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.(*runpb.ListTasksResponse)}}
all
packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewTasksClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListTasksRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListTasksRequest.}forresp,err:=rangec.ListTasks(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*TasksClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewTasksClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

UpdateJobOperation

typeUpdateJobOperationstruct{// contains filtered or unexported fields}

UpdateJobOperation manages a long-running operation from UpdateJob.

func (*UpdateJobOperation) Done

func(op*UpdateJobOperation)Done()bool

Done reports whether the long-running operation has completed.

func (*UpdateJobOperation) Metadata

func(op*UpdateJobOperation)Metadata()(*runpb.Job,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 (*UpdateJobOperation) Name

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

func (*UpdateJobOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*UpdateJobOperation) Wait

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

See documentation of Poll for error-handling information.

UpdateServiceOperation

typeUpdateServiceOperationstruct{// contains filtered or unexported fields}

UpdateServiceOperation manages a long-running operation from UpdateService.

func (*UpdateServiceOperation) Done

Done reports whether the long-running operation has completed.

func (*UpdateServiceOperation) Metadata

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 (*UpdateServiceOperation) Name

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

func (*UpdateServiceOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*UpdateServiceOperation) Wait

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

See documentation of Poll for error-handling information.

UpdateWorkerPoolOperation

typeUpdateWorkerPoolOperationstruct{// contains filtered or unexported fields}

UpdateWorkerPoolOperation manages a long-running operation from UpdateWorkerPool.

func (*UpdateWorkerPoolOperation) Done

Done reports whether the long-running operation has completed.

func (*UpdateWorkerPoolOperation) Metadata

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 (*UpdateWorkerPoolOperation) Name

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

func (*UpdateWorkerPoolOperation) Poll

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

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

If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*UpdateWorkerPoolOperation) Wait

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

See documentation of Poll for error-handling information.

WorkerPoolIterator

typeWorkerPoolIteratorstruct{// 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[]*runpb.WorkerPool,nextPageTokenstring,errerror)// contains filtered or unexported fields}

WorkerPoolIterator manages a stream of *runpb.WorkerPool.

func (*WorkerPoolIterator) All

func(it*WorkerPoolIterator)All()iter.Seq2[*runpb.WorkerPool,error]

All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.

func (*WorkerPoolIterator) Next

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 (*WorkerPoolIterator) PageInfo

func(it*WorkerPoolIterator)PageInfo()*iterator.PageInfo

PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.

WorkerPoolsCallOptions

typeWorkerPoolsCallOptionsstruct{CreateWorkerPool[]gax.CallOptionGetWorkerPool[]gax.CallOptionListWorkerPools[]gax.CallOptionUpdateWorkerPool[]gax.CallOptionDeleteWorkerPool[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOptionWaitOperation[]gax.CallOption}

WorkerPoolsCallOptions contains the retry settings for each method of WorkerPoolsClient.

WorkerPoolsClient

typeWorkerPoolsClientstruct{// The call options for this service.CallOptions*WorkerPoolsCallOptions// 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}

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

Cloud Run WorkerPool Control Plane API.

func NewWorkerPoolsClient

funcNewWorkerPoolsClient(ctxcontext.Context,opts...option.ClientOption)(*WorkerPoolsClient,error)

NewWorkerPoolsClient creates a new worker pools client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.

Cloud Run WorkerPool Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func NewWorkerPoolsRESTClient

funcNewWorkerPoolsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*WorkerPoolsClient,error)

NewWorkerPoolsRESTClient creates a new worker pools rest client.

Cloud Run WorkerPool Control Plane API.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}

func (*WorkerPoolsClient) Close

func(c*WorkerPoolsClient)Close()error

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

func (*WorkerPoolsClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*WorkerPoolsClient) CreateWorkerPool

CreateWorkerPool creates a new WorkerPool in a given project and location.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.CreateWorkerPoolRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#CreateWorkerPoolRequest.}op,err:=c.CreateWorkerPool(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkerPoolsClient) CreateWorkerPoolOperation

func(c*WorkerPoolsClient)CreateWorkerPoolOperation(namestring)*CreateWorkerPoolOperation

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

func (*WorkerPoolsClient) DeleteOperation

DeleteOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(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 (*WorkerPoolsClient) DeleteWorkerPool

DeleteWorkerPool deletes a WorkerPool.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.DeleteWorkerPoolRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#DeleteWorkerPoolRequest.}op,err:=c.DeleteWorkerPool(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkerPoolsClient) DeleteWorkerPoolOperation

func(c*WorkerPoolsClient)DeleteWorkerPoolOperation(namestring)*DeleteWorkerPoolOperation

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

func (*WorkerPoolsClient) GetIamPolicy

GetIamPolicy gets the IAM Access Control policy currently in effect for the givenCloud Run WorkerPool. This result does not include any inherited policies.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(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 (*WorkerPoolsClient) GetOperation

GetOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(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 (*WorkerPoolsClient) GetWorkerPool

GetWorkerPool gets information about a WorkerPool.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.GetWorkerPoolRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#GetWorkerPoolRequest.}resp,err:=c.GetWorkerPool(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkerPoolsClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Examples

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2""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:=run.NewWorkerPoolsClient(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"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(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 (*WorkerPoolsClient) ListWorkerPools

ListWorkerPools lists WorkerPools. Results are sorted by creation time, descending.

Examples

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb""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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListWorkerPoolsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListWorkerPoolsRequest.}it:=c.ListWorkerPools(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.(*runpb.ListWorkerPoolsResponse)}}
all
packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.ListWorkerPoolsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#ListWorkerPoolsRequest.}forresp,err:=rangec.ListWorkerPools(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}

func (*WorkerPoolsClient) SetIamPolicy

SetIamPolicy sets the IAM Access control policy for the specified WorkerPool. Overwritesany existing policy.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(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 (*WorkerPoolsClient) TestIamPermissions

TestIamPermissions returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Example

packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(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 (*WorkerPoolsClient) UpdateWorkerPool

UpdateWorkerPool updates a WorkerPool.

Example

packagemainimport("context"run"cloud.google.com/go/run/apiv2"runpb"cloud.google.com/go/run/apiv2/runpb")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&runpb.UpdateWorkerPoolRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/run/apiv2/runpb#UpdateWorkerPoolRequest.}op,err:=c.UpdateWorkerPool(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*WorkerPoolsClient) UpdateWorkerPoolOperation

func(c*WorkerPoolsClient)UpdateWorkerPoolOperation(namestring)*UpdateWorkerPoolOperation

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

func (*WorkerPoolsClient) WaitOperation

WaitOperation is a utility method from google.longrunning.Operations.

Example

packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"run"cloud.google.com/go/run/apiv2")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:=run.NewWorkerPoolsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.WaitOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#WaitOperationRequest.}resp,err:=c.WaitOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

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.