go: cloud.google.com/go/dataproc/apiv1 Index | Examples | Files

package dataproc

import "cloud.google.com/go/dataproc/apiv1"

Package dataproc is an auto-generated package for the Cloud Dataproc API.

Manages Hadoop-based clusters and jobs on Google Cloud Platform.

Use of Context

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

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

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

Index

Examples

Package Files

autoscaling_policy_client.go cluster_controller_client.go doc.go job_controller_client.go longrunning.go workflow_template_client.go

func DefaultAuthScopes Uses

func DefaultAuthScopes() []string

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

type AutoscalingPolicyCallOptions Uses

type AutoscalingPolicyCallOptions struct {
    CreateAutoscalingPolicy []gax.CallOption
    UpdateAutoscalingPolicy []gax.CallOption
    GetAutoscalingPolicy    []gax.CallOption
    ListAutoscalingPolicies []gax.CallOption
    DeleteAutoscalingPolicy []gax.CallOption
}

AutoscalingPolicyCallOptions contains the retry settings for each method of AutoscalingPolicyClient.

type AutoscalingPolicyClient Uses

type AutoscalingPolicyClient struct {

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

AutoscalingPolicyClient is a client for interacting with Cloud Dataproc API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewAutoscalingPolicyClient Uses

func NewAutoscalingPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalingPolicyClient, error)

NewAutoscalingPolicyClient creates a new autoscaling policy service client.

The API interface for managing autoscaling policies in the Dataproc API.

Code:

ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*AutoscalingPolicyClient) Close Uses

func (c *AutoscalingPolicyClient) Close() error

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

func (*AutoscalingPolicyClient) Connection Uses

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

Connection returns a connection to the API service.

Deprecated.

func (*AutoscalingPolicyClient) CreateAutoscalingPolicy Uses

func (c *AutoscalingPolicyClient) CreateAutoscalingPolicy(ctx context.Context, req *dataprocpb.CreateAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, error)

CreateAutoscalingPolicy creates new autoscaling policy.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.CreateAutoscalingPolicyRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateAutoscalingPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*AutoscalingPolicyClient) DeleteAutoscalingPolicy Uses

func (c *AutoscalingPolicyClient) DeleteAutoscalingPolicy(ctx context.Context, req *dataprocpb.DeleteAutoscalingPolicyRequest, opts ...gax.CallOption) error

DeleteAutoscalingPolicy deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Code:

ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.DeleteAutoscalingPolicyRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteAutoscalingPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*AutoscalingPolicyClient) GetAutoscalingPolicy Uses

func (c *AutoscalingPolicyClient) GetAutoscalingPolicy(ctx context.Context, req *dataprocpb.GetAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, error)

GetAutoscalingPolicy retrieves autoscaling policy.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.GetAutoscalingPolicyRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetAutoscalingPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*AutoscalingPolicyClient) ListAutoscalingPolicies Uses

func (c *AutoscalingPolicyClient) ListAutoscalingPolicies(ctx context.Context, req *dataprocpb.ListAutoscalingPoliciesRequest, opts ...gax.CallOption) *AutoscalingPolicyIterator

ListAutoscalingPolicies lists autoscaling policies in the project.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
// import "google.golang.org/api/iterator"

ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.ListAutoscalingPoliciesRequest{
    // TODO: Fill request struct fields.
}
it := c.ListAutoscalingPolicies(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*AutoscalingPolicyClient) UpdateAutoscalingPolicy Uses

func (c *AutoscalingPolicyClient) UpdateAutoscalingPolicy(ctx context.Context, req *dataprocpb.UpdateAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, error)

UpdateAutoscalingPolicy updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewAutoscalingPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.UpdateAutoscalingPolicyRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateAutoscalingPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type AutoscalingPolicyIterator Uses

type AutoscalingPolicyIterator struct {

    // 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.
    Response interface{}

    // 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.
    InternalFetch func(pageSize int, pageToken string) (results []*dataprocpb.AutoscalingPolicy, nextPageToken string, err error)
    // contains filtered or unexported fields
}

AutoscalingPolicyIterator manages a stream of *dataprocpb.AutoscalingPolicy.

func (*AutoscalingPolicyIterator) Next Uses

func (it *AutoscalingPolicyIterator) Next() (*dataprocpb.AutoscalingPolicy, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*AutoscalingPolicyIterator) PageInfo Uses

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

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

type ClusterControllerCallOptions Uses

type ClusterControllerCallOptions struct {
    CreateCluster   []gax.CallOption
    UpdateCluster   []gax.CallOption
    DeleteCluster   []gax.CallOption
    GetCluster      []gax.CallOption
    ListClusters    []gax.CallOption
    DiagnoseCluster []gax.CallOption
}

ClusterControllerCallOptions contains the retry settings for each method of ClusterControllerClient.

type ClusterControllerClient Uses

type ClusterControllerClient struct {

    // LROClient is used internally to handle longrunning operations.
    // It is exposed so that its CallOptions can be modified if required.
    // Users should not Close this client.
    LROClient *lroauto.OperationsClient

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

ClusterControllerClient is a client for interacting with Cloud Dataproc API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewClusterControllerClient Uses

func NewClusterControllerClient(ctx context.Context, opts ...option.ClientOption) (*ClusterControllerClient, error)

NewClusterControllerClient creates a new cluster controller client.

The ClusterControllerService provides methods to manage clusters of Compute Engine instances.

Code:

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*ClusterControllerClient) Close Uses

func (c *ClusterControllerClient) Close() error

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

func (*ClusterControllerClient) Connection Uses

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

Connection returns a connection to the API service.

Deprecated.

func (*ClusterControllerClient) CreateCluster Uses

func (c *ClusterControllerClient) CreateCluster(ctx context.Context, req *dataprocpb.CreateClusterRequest, opts ...gax.CallOption) (*CreateClusterOperation, error)

CreateCluster creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.CreateClusterRequest{
    // TODO: Fill request struct fields.
}
op, err := c.CreateCluster(ctx, req)
if err != nil {
    // TODO: Handle error.
}

resp, err := op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*ClusterControllerClient) CreateClusterOperation Uses

func (c *ClusterControllerClient) CreateClusterOperation(name string) *CreateClusterOperation

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

func (*ClusterControllerClient) DeleteCluster Uses

func (c *ClusterControllerClient) DeleteCluster(ctx context.Context, req *dataprocpb.DeleteClusterRequest, opts ...gax.CallOption) (*DeleteClusterOperation, error)

DeleteCluster deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.DeleteClusterRequest{
    // TODO: Fill request struct fields.
}
op, err := c.DeleteCluster(ctx, req)
if err != nil {
    // TODO: Handle error.
}

err = op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}

func (*ClusterControllerClient) DeleteClusterOperation Uses

func (c *ClusterControllerClient) DeleteClusterOperation(name string) *DeleteClusterOperation

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

func (*ClusterControllerClient) DiagnoseCluster Uses

func (c *ClusterControllerClient) DiagnoseCluster(ctx context.Context, req *dataprocpb.DiagnoseClusterRequest, opts ...gax.CallOption) (*DiagnoseClusterOperation, error)

DiagnoseCluster gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.DiagnoseClusterRequest{
    // TODO: Fill request struct fields.
}
op, err := c.DiagnoseCluster(ctx, req)
if err != nil {
    // TODO: Handle error.
}

resp, err := op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*ClusterControllerClient) DiagnoseClusterOperation Uses

func (c *ClusterControllerClient) DiagnoseClusterOperation(name string) *DiagnoseClusterOperation

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

func (*ClusterControllerClient) GetCluster Uses

func (c *ClusterControllerClient) GetCluster(ctx context.Context, req *dataprocpb.GetClusterRequest, opts ...gax.CallOption) (*dataprocpb.Cluster, error)

GetCluster gets the resource representation for a cluster in a project.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.GetClusterRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetCluster(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*ClusterControllerClient) ListClusters Uses

func (c *ClusterControllerClient) ListClusters(ctx context.Context, req *dataprocpb.ListClustersRequest, opts ...gax.CallOption) *ClusterIterator

ListClusters lists all regions/{region}/clusters in a project alphabetically.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
// import "google.golang.org/api/iterator"

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.ListClustersRequest{
    // TODO: Fill request struct fields.
}
it := c.ListClusters(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*ClusterControllerClient) UpdateCluster Uses

func (c *ClusterControllerClient) UpdateCluster(ctx context.Context, req *dataprocpb.UpdateClusterRequest, opts ...gax.CallOption) (*UpdateClusterOperation, error)

UpdateCluster updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewClusterControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.UpdateClusterRequest{
    // TODO: Fill request struct fields.
}
op, err := c.UpdateCluster(ctx, req)
if err != nil {
    // TODO: Handle error.
}

resp, err := op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*ClusterControllerClient) UpdateClusterOperation Uses

func (c *ClusterControllerClient) UpdateClusterOperation(name string) *UpdateClusterOperation

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

type ClusterIterator Uses

type ClusterIterator struct {

    // 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.
    Response interface{}

    // 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.
    InternalFetch func(pageSize int, pageToken string) (results []*dataprocpb.Cluster, nextPageToken string, err error)
    // contains filtered or unexported fields
}

ClusterIterator manages a stream of *dataprocpb.Cluster.

func (*ClusterIterator) Next Uses

func (it *ClusterIterator) Next() (*dataprocpb.Cluster, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*ClusterIterator) PageInfo Uses

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

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

type CreateClusterOperation Uses

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

CreateClusterOperation manages a long-running operation from CreateCluster.

func (*CreateClusterOperation) Delete Uses

func (op *CreateClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error

Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation.

func (*CreateClusterOperation) Done Uses

func (op *CreateClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateClusterOperation) Metadata Uses

func (op *CreateClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)

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

func (*CreateClusterOperation) Name Uses

func (op *CreateClusterOperation) 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 (*CreateClusterOperation) Poll Uses

func (op *CreateClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)

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

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

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

func (*CreateClusterOperation) Wait Uses

func (op *CreateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)

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

See documentation of Poll for error-handling information.

type DeleteClusterOperation Uses

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

DeleteClusterOperation manages a long-running operation from DeleteCluster.

func (*DeleteClusterOperation) Delete Uses

func (op *DeleteClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error

Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation.

func (*DeleteClusterOperation) Done Uses

func (op *DeleteClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DeleteClusterOperation) Metadata Uses

func (op *DeleteClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)

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

func (*DeleteClusterOperation) Name Uses

func (op *DeleteClusterOperation) 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 (*DeleteClusterOperation) Poll Uses

func (op *DeleteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*DeleteClusterOperation) Wait Uses

func (op *DeleteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

type DiagnoseClusterOperation Uses

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

DiagnoseClusterOperation manages a long-running operation from DiagnoseCluster.

func (*DiagnoseClusterOperation) Delete Uses

func (op *DiagnoseClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error

Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation.

func (*DiagnoseClusterOperation) Done Uses

func (op *DiagnoseClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DiagnoseClusterOperation) Metadata Uses

func (op *DiagnoseClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)

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

func (*DiagnoseClusterOperation) Name Uses

func (op *DiagnoseClusterOperation) 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 (*DiagnoseClusterOperation) Poll Uses

func (op *DiagnoseClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.DiagnoseClusterResults, error)

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

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

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

func (*DiagnoseClusterOperation) Wait Uses

func (op *DiagnoseClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.DiagnoseClusterResults, error)

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

See documentation of Poll for error-handling information.

type InstantiateInlineWorkflowTemplateOperation Uses

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

InstantiateInlineWorkflowTemplateOperation manages a long-running operation from InstantiateInlineWorkflowTemplate.

func (*InstantiateInlineWorkflowTemplateOperation) Cancel Uses

func (op *InstantiateInlineWorkflowTemplateOperation) Cancel(ctx context.Context, opts ...gax.CallOption) error

Cancel starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients can use Poll or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, op.Poll returns an error with code Canceled.

func (*InstantiateInlineWorkflowTemplateOperation) Delete Uses

func (op *InstantiateInlineWorkflowTemplateOperation) Delete(ctx context.Context, opts ...gax.CallOption) error

Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation.

func (*InstantiateInlineWorkflowTemplateOperation) Done Uses

func (op *InstantiateInlineWorkflowTemplateOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*InstantiateInlineWorkflowTemplateOperation) Metadata Uses

func (op *InstantiateInlineWorkflowTemplateOperation) Metadata() (*dataprocpb.WorkflowMetadata, error)

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

func (*InstantiateInlineWorkflowTemplateOperation) Name Uses

func (op *InstantiateInlineWorkflowTemplateOperation) 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 (*InstantiateInlineWorkflowTemplateOperation) Poll Uses

func (op *InstantiateInlineWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*InstantiateInlineWorkflowTemplateOperation) Wait Uses

func (op *InstantiateInlineWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

type InstantiateWorkflowTemplateOperation Uses

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

InstantiateWorkflowTemplateOperation manages a long-running operation from InstantiateWorkflowTemplate.

func (*InstantiateWorkflowTemplateOperation) Cancel Uses

func (op *InstantiateWorkflowTemplateOperation) Cancel(ctx context.Context, opts ...gax.CallOption) error

Cancel starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients can use Poll or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, op.Poll returns an error with code Canceled.

func (*InstantiateWorkflowTemplateOperation) Delete Uses

func (op *InstantiateWorkflowTemplateOperation) Delete(ctx context.Context, opts ...gax.CallOption) error

Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation.

func (*InstantiateWorkflowTemplateOperation) Done Uses

func (op *InstantiateWorkflowTemplateOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*InstantiateWorkflowTemplateOperation) Metadata Uses

func (op *InstantiateWorkflowTemplateOperation) Metadata() (*dataprocpb.WorkflowMetadata, error)

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

func (*InstantiateWorkflowTemplateOperation) Name Uses

func (op *InstantiateWorkflowTemplateOperation) 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 (*InstantiateWorkflowTemplateOperation) Poll Uses

func (op *InstantiateWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

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

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

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

func (*InstantiateWorkflowTemplateOperation) Wait Uses

func (op *InstantiateWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

type JobControllerCallOptions Uses

type JobControllerCallOptions struct {
    SubmitJob            []gax.CallOption
    SubmitJobAsOperation []gax.CallOption
    GetJob               []gax.CallOption
    ListJobs             []gax.CallOption
    UpdateJob            []gax.CallOption
    CancelJob            []gax.CallOption
    DeleteJob            []gax.CallOption
}

JobControllerCallOptions contains the retry settings for each method of JobControllerClient.

type JobControllerClient Uses

type JobControllerClient struct {

    // LROClient is used internally to handle longrunning operations.
    // It is exposed so that its CallOptions can be modified if required.
    // Users should not Close this client.
    LROClient *lroauto.OperationsClient

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

JobControllerClient is a client for interacting with Cloud Dataproc API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewJobControllerClient Uses

func NewJobControllerClient(ctx context.Context, opts ...option.ClientOption) (*JobControllerClient, error)

NewJobControllerClient creates a new job controller client.

The JobController provides methods to manage jobs.

Code:

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*JobControllerClient) CancelJob Uses

func (c *JobControllerClient) CancelJob(ctx context.Context, req *dataprocpb.CancelJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)

CancelJob starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (at https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or regions/{region}/jobs.get (at https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.CancelJobRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CancelJob(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*JobControllerClient) Close Uses

func (c *JobControllerClient) Close() error

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

func (*JobControllerClient) Connection Uses

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

Connection returns a connection to the API service.

Deprecated.

func (*JobControllerClient) DeleteJob Uses

func (c *JobControllerClient) DeleteJob(ctx context.Context, req *dataprocpb.DeleteJobRequest, opts ...gax.CallOption) error

DeleteJob deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Code:

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.DeleteJobRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteJob(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*JobControllerClient) GetJob Uses

func (c *JobControllerClient) GetJob(ctx context.Context, req *dataprocpb.GetJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)

GetJob gets the resource representation for a job in a project.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.GetJobRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetJob(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*JobControllerClient) ListJobs Uses

func (c *JobControllerClient) ListJobs(ctx context.Context, req *dataprocpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator

ListJobs lists regions/{region}/jobs in a project.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
// import "google.golang.org/api/iterator"

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.ListJobsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListJobs(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*JobControllerClient) SubmitJob Uses

func (c *JobControllerClient) SubmitJob(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)

SubmitJob submits a job to a cluster.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.SubmitJobRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.SubmitJob(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*JobControllerClient) SubmitJobAsOperation Uses

func (c *JobControllerClient) SubmitJobAsOperation(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*SubmitJobAsOperationOperation, error)

SubmitJobAsOperation submits job to a cluster.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.SubmitJobRequest{
    // TODO: Fill request struct fields.
}
op, err := c.SubmitJobAsOperation(ctx, req)
if err != nil {
    // TODO: Handle error.
}

resp, err := op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*JobControllerClient) SubmitJobAsOperationOperation Uses

func (c *JobControllerClient) SubmitJobAsOperationOperation(name string) *SubmitJobAsOperationOperation

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

func (*JobControllerClient) UpdateJob Uses

func (c *JobControllerClient) UpdateJob(ctx context.Context, req *dataprocpb.UpdateJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)

UpdateJob updates a job in a project.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewJobControllerClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.UpdateJobRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateJob(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type JobIterator Uses

type JobIterator struct {

    // 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.
    Response interface{}

    // 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.
    InternalFetch func(pageSize int, pageToken string) (results []*dataprocpb.Job, nextPageToken string, err error)
    // contains filtered or unexported fields
}

JobIterator manages a stream of *dataprocpb.Job.

func (*JobIterator) Next Uses

func (it *JobIterator) Next() (*dataprocpb.Job, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*JobIterator) PageInfo Uses

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

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

type SubmitJobAsOperationOperation Uses

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

SubmitJobAsOperationOperation manages a long-running operation from SubmitJobAsOperation.

func (*SubmitJobAsOperationOperation) Done Uses

func (op *SubmitJobAsOperationOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*SubmitJobAsOperationOperation) Metadata Uses

func (op *SubmitJobAsOperationOperation) Metadata() (*dataprocpb.JobMetadata, error)

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

func (*SubmitJobAsOperationOperation) Name Uses

func (op *SubmitJobAsOperationOperation) 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 (*SubmitJobAsOperationOperation) Poll Uses

func (op *SubmitJobAsOperationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Job, error)

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

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

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

func (*SubmitJobAsOperationOperation) Wait Uses

func (op *SubmitJobAsOperationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Job, error)

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

See documentation of Poll for error-handling information.

type UpdateClusterOperation Uses

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

UpdateClusterOperation manages a long-running operation from UpdateCluster.

func (*UpdateClusterOperation) Delete Uses

func (op *UpdateClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error

Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation.

func (*UpdateClusterOperation) Done Uses

func (op *UpdateClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateClusterOperation) Metadata Uses

func (op *UpdateClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)

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

func (*UpdateClusterOperation) Name Uses

func (op *UpdateClusterOperation) 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 (*UpdateClusterOperation) Poll Uses

func (op *UpdateClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)

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

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

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

func (*UpdateClusterOperation) Wait Uses

func (op *UpdateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)

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

See documentation of Poll for error-handling information.

type WorkflowTemplateCallOptions Uses

type WorkflowTemplateCallOptions struct {
    CreateWorkflowTemplate            []gax.CallOption
    GetWorkflowTemplate               []gax.CallOption
    InstantiateWorkflowTemplate       []gax.CallOption
    InstantiateInlineWorkflowTemplate []gax.CallOption
    UpdateWorkflowTemplate            []gax.CallOption
    ListWorkflowTemplates             []gax.CallOption
    DeleteWorkflowTemplate            []gax.CallOption
}

WorkflowTemplateCallOptions contains the retry settings for each method of WorkflowTemplateClient.

type WorkflowTemplateClient Uses

type WorkflowTemplateClient struct {

    // LROClient is used internally to handle longrunning operations.
    // It is exposed so that its CallOptions can be modified if required.
    // Users should not Close this client.
    LROClient *lroauto.OperationsClient

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

WorkflowTemplateClient is a client for interacting with Cloud Dataproc API.

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewWorkflowTemplateClient Uses

func NewWorkflowTemplateClient(ctx context.Context, opts ...option.ClientOption) (*WorkflowTemplateClient, error)

NewWorkflowTemplateClient creates a new workflow template service client.

The API interface for managing Workflow Templates in the Dataproc API.

Code:

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*WorkflowTemplateClient) Close Uses

func (c *WorkflowTemplateClient) Close() error

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

func (*WorkflowTemplateClient) Connection Uses

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

Connection returns a connection to the API service.

Deprecated.

func (*WorkflowTemplateClient) CreateWorkflowTemplate Uses

func (c *WorkflowTemplateClient) CreateWorkflowTemplate(ctx context.Context, req *dataprocpb.CreateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error)

CreateWorkflowTemplate creates new workflow template.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.CreateWorkflowTemplateRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateWorkflowTemplate(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*WorkflowTemplateClient) DeleteWorkflowTemplate Uses

func (c *WorkflowTemplateClient) DeleteWorkflowTemplate(ctx context.Context, req *dataprocpb.DeleteWorkflowTemplateRequest, opts ...gax.CallOption) error

DeleteWorkflowTemplate deletes a workflow template. It does not cancel in-progress workflows.

Code:

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.DeleteWorkflowTemplateRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteWorkflowTemplate(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*WorkflowTemplateClient) GetWorkflowTemplate Uses

func (c *WorkflowTemplateClient) GetWorkflowTemplate(ctx context.Context, req *dataprocpb.GetWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error)

GetWorkflowTemplate retrieves the latest workflow template.

Can retrieve previously instantiated template by specifying optional version parameter.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.GetWorkflowTemplateRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetWorkflowTemplate(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*WorkflowTemplateClient) InstantiateInlineWorkflowTemplate Uses

func (c *WorkflowTemplateClient) InstantiateInlineWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateInlineWorkflowTemplateRequest, opts ...gax.CallOption) (*InstantiateInlineWorkflowTemplateOperation, error)

InstantiateInlineWorkflowTemplate instantiates a template and begins execution.

This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.

The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.

The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.

The Operation.metadata will be WorkflowMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (at https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).

On successful completion, Operation.response will be Empty.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.InstantiateInlineWorkflowTemplateRequest{
    // TODO: Fill request struct fields.
}
op, err := c.InstantiateInlineWorkflowTemplate(ctx, req)
if err != nil {
    // TODO: Handle error.
}

err = op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}

func (*WorkflowTemplateClient) InstantiateInlineWorkflowTemplateOperation Uses

func (c *WorkflowTemplateClient) InstantiateInlineWorkflowTemplateOperation(name string) *InstantiateInlineWorkflowTemplateOperation

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

func (*WorkflowTemplateClient) InstantiateWorkflowTemplate Uses

func (c *WorkflowTemplateClient) InstantiateWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateWorkflowTemplateRequest, opts ...gax.CallOption) (*InstantiateWorkflowTemplateOperation, error)

InstantiateWorkflowTemplate instantiates a template and begins execution.

The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.

The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.

The Operation.metadata will be WorkflowMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (at https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).

On successful completion, Operation.response will be Empty.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.InstantiateWorkflowTemplateRequest{
    // TODO: Fill request struct fields.
}
op, err := c.InstantiateWorkflowTemplate(ctx, req)
if err != nil {
    // TODO: Handle error.
}

err = op.Wait(ctx)
if err != nil {
    // TODO: Handle error.
}

func (*WorkflowTemplateClient) InstantiateWorkflowTemplateOperation Uses

func (c *WorkflowTemplateClient) InstantiateWorkflowTemplateOperation(name string) *InstantiateWorkflowTemplateOperation

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

func (*WorkflowTemplateClient) ListWorkflowTemplates Uses

func (c *WorkflowTemplateClient) ListWorkflowTemplates(ctx context.Context, req *dataprocpb.ListWorkflowTemplatesRequest, opts ...gax.CallOption) *WorkflowTemplateIterator

ListWorkflowTemplates lists workflows that match the specified filter in the request.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"
// import "google.golang.org/api/iterator"

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.ListWorkflowTemplatesRequest{
    // TODO: Fill request struct fields.
}
it := c.ListWorkflowTemplates(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*WorkflowTemplateClient) UpdateWorkflowTemplate Uses

func (c *WorkflowTemplateClient) UpdateWorkflowTemplate(ctx context.Context, req *dataprocpb.UpdateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error)

UpdateWorkflowTemplate updates (replaces) workflow template. The updated template must contain version that matches the current server version.

Code:

// import dataprocpb "google.golang.org/genproto/googleapis/cloud/dataproc/v1"

ctx := context.Background()
c, err := dataproc.NewWorkflowTemplateClient(ctx)
if err != nil {
    // TODO: Handle error.
}

req := &dataprocpb.UpdateWorkflowTemplateRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateWorkflowTemplate(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type WorkflowTemplateIterator Uses

type WorkflowTemplateIterator struct {

    // 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.
    Response interface{}

    // 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.
    InternalFetch func(pageSize int, pageToken string) (results []*dataprocpb.WorkflowTemplate, nextPageToken string, err error)
    // contains filtered or unexported fields
}

WorkflowTemplateIterator manages a stream of *dataprocpb.WorkflowTemplate.

func (*WorkflowTemplateIterator) Next Uses

func (it *WorkflowTemplateIterator) Next() (*dataprocpb.WorkflowTemplate, error)

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*WorkflowTemplateIterator) PageInfo Uses

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

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

Package dataproc imports 22 packages (graph) and is imported by 2 packages. Updated 2020-09-21. Refresh now. Tools for package owners.