Documentation
¶
Overview ¶
Package dataproc is an auto-generated package for the Cloud Dataproc API.
Manages Hadoop-based clusters and jobs on Google Cloud Platform.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
// go get cloud.google.com/go/dataproc/v2/apiv1@latest 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client, mentioned above.
req := &dataprocpb.CreateAutoscalingPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateAutoscalingPolicyRequest. } resp, err := c.CreateAutoscalingPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewAutoscalingPolicyClient 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.
Index ¶
- func DefaultAuthScopes() []string
- type AutoscalingPolicyCallOptions
- type AutoscalingPolicyClient
- func (c *AutoscalingPolicyClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *AutoscalingPolicyClient) Close() error
- func (c *AutoscalingPolicyClient) Connection() *grpc.ClientConndeprecated
- func (c *AutoscalingPolicyClient) CreateAutoscalingPolicy(ctx context.Context, req *dataprocpb.CreateAutoscalingPolicyRequest, ...) (*dataprocpb.AutoscalingPolicy, error)
- func (c *AutoscalingPolicyClient) DeleteAutoscalingPolicy(ctx context.Context, req *dataprocpb.DeleteAutoscalingPolicyRequest, ...) error
- func (c *AutoscalingPolicyClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *AutoscalingPolicyClient) GetAutoscalingPolicy(ctx context.Context, req *dataprocpb.GetAutoscalingPolicyRequest, ...) (*dataprocpb.AutoscalingPolicy, error)
- func (c *AutoscalingPolicyClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *AutoscalingPolicyClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *AutoscalingPolicyClient) ListAutoscalingPolicies(ctx context.Context, req *dataprocpb.ListAutoscalingPoliciesRequest, ...) *AutoscalingPolicyIterator
- func (c *AutoscalingPolicyClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *AutoscalingPolicyClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *AutoscalingPolicyClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *AutoscalingPolicyClient) UpdateAutoscalingPolicy(ctx context.Context, req *dataprocpb.UpdateAutoscalingPolicyRequest, ...) (*dataprocpb.AutoscalingPolicy, error)
- type AutoscalingPolicyIterator
- type BatchControllerCallOptions
- type BatchControllerClient
- func (c *BatchControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *BatchControllerClient) Close() error
- func (c *BatchControllerClient) Connection() *grpc.ClientConndeprecated
- func (c *BatchControllerClient) CreateBatch(ctx context.Context, req *dataprocpb.CreateBatchRequest, ...) (*CreateBatchOperation, error)
- func (c *BatchControllerClient) CreateBatchOperation(name string) *CreateBatchOperation
- func (c *BatchControllerClient) DeleteBatch(ctx context.Context, req *dataprocpb.DeleteBatchRequest, ...) error
- func (c *BatchControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *BatchControllerClient) GetBatch(ctx context.Context, req *dataprocpb.GetBatchRequest, opts ...gax.CallOption) (*dataprocpb.Batch, error)
- func (c *BatchControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *BatchControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *BatchControllerClient) ListBatches(ctx context.Context, req *dataprocpb.ListBatchesRequest, ...) *BatchIterator
- func (c *BatchControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *BatchControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *BatchControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- type BatchIterator
- type ClusterControllerCallOptions
- type ClusterControllerClient
- func (c *ClusterControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *ClusterControllerClient) Close() error
- func (c *ClusterControllerClient) Connection() *grpc.ClientConndeprecated
- func (c *ClusterControllerClient) CreateCluster(ctx context.Context, req *dataprocpb.CreateClusterRequest, ...) (*CreateClusterOperation, error)
- func (c *ClusterControllerClient) CreateClusterOperation(name string) *CreateClusterOperation
- func (c *ClusterControllerClient) DeleteCluster(ctx context.Context, req *dataprocpb.DeleteClusterRequest, ...) (*DeleteClusterOperation, error)
- func (c *ClusterControllerClient) DeleteClusterOperation(name string) *DeleteClusterOperation
- func (c *ClusterControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *ClusterControllerClient) DiagnoseCluster(ctx context.Context, req *dataprocpb.DiagnoseClusterRequest, ...) (*DiagnoseClusterOperation, error)
- func (c *ClusterControllerClient) DiagnoseClusterOperation(name string) *DiagnoseClusterOperation
- func (c *ClusterControllerClient) GetCluster(ctx context.Context, req *dataprocpb.GetClusterRequest, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- func (c *ClusterControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *ClusterControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *ClusterControllerClient) ListClusters(ctx context.Context, req *dataprocpb.ListClustersRequest, ...) *ClusterIterator
- func (c *ClusterControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *ClusterControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *ClusterControllerClient) StartCluster(ctx context.Context, req *dataprocpb.StartClusterRequest, ...) (*StartClusterOperation, error)
- func (c *ClusterControllerClient) StartClusterOperation(name string) *StartClusterOperation
- func (c *ClusterControllerClient) StopCluster(ctx context.Context, req *dataprocpb.StopClusterRequest, ...) (*StopClusterOperation, error)
- func (c *ClusterControllerClient) StopClusterOperation(name string) *StopClusterOperation
- func (c *ClusterControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *ClusterControllerClient) UpdateCluster(ctx context.Context, req *dataprocpb.UpdateClusterRequest, ...) (*UpdateClusterOperation, error)
- func (c *ClusterControllerClient) UpdateClusterOperation(name string) *UpdateClusterOperation
- type ClusterIterator
- type CreateBatchOperation
- func (op *CreateBatchOperation) Done() bool
- func (op *CreateBatchOperation) Metadata() (*dataprocpb.BatchOperationMetadata, error)
- func (op *CreateBatchOperation) Name() string
- func (op *CreateBatchOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Batch, error)
- func (op *CreateBatchOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Batch, error)
- type CreateClusterOperation
- func (op *CreateClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error
- func (op *CreateClusterOperation) Done() bool
- func (op *CreateClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
- func (op *CreateClusterOperation) Name() string
- func (op *CreateClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- func (op *CreateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- type CreateNodeGroupOperation
- func (op *CreateNodeGroupOperation) Done() bool
- func (op *CreateNodeGroupOperation) Metadata() (*dataprocpb.NodeGroupOperationMetadata, error)
- func (op *CreateNodeGroupOperation) Name() string
- func (op *CreateNodeGroupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
- func (op *CreateNodeGroupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
- type CreateSessionOperation
- func (op *CreateSessionOperation) Done() bool
- func (op *CreateSessionOperation) Metadata() (*dataprocpb.SessionOperationMetadata, error)
- func (op *CreateSessionOperation) Name() string
- func (op *CreateSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
- func (op *CreateSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
- type DeleteClusterOperation
- func (op *DeleteClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteClusterOperation) Done() bool
- func (op *DeleteClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
- func (op *DeleteClusterOperation) Name() string
- func (op *DeleteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteSessionOperation
- func (op *DeleteSessionOperation) Done() bool
- func (op *DeleteSessionOperation) Metadata() (*dataprocpb.SessionOperationMetadata, error)
- func (op *DeleteSessionOperation) Name() string
- func (op *DeleteSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
- func (op *DeleteSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
- type DiagnoseClusterOperation
- func (op *DiagnoseClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error
- func (op *DiagnoseClusterOperation) Done() bool
- func (op *DiagnoseClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
- func (op *DiagnoseClusterOperation) Name() string
- func (op *DiagnoseClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.DiagnoseClusterResults, error)
- func (op *DiagnoseClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.DiagnoseClusterResults, error)
- type InstantiateInlineWorkflowTemplateOperation
- func (op *InstantiateInlineWorkflowTemplateOperation) Cancel(ctx context.Context, opts ...gax.CallOption) error
- func (op *InstantiateInlineWorkflowTemplateOperation) Delete(ctx context.Context, opts ...gax.CallOption) error
- func (op *InstantiateInlineWorkflowTemplateOperation) Done() bool
- func (op *InstantiateInlineWorkflowTemplateOperation) Metadata() (*dataprocpb.WorkflowMetadata, error)
- func (op *InstantiateInlineWorkflowTemplateOperation) Name() string
- func (op *InstantiateInlineWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *InstantiateInlineWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type InstantiateWorkflowTemplateOperation
- func (op *InstantiateWorkflowTemplateOperation) Cancel(ctx context.Context, opts ...gax.CallOption) error
- func (op *InstantiateWorkflowTemplateOperation) Delete(ctx context.Context, opts ...gax.CallOption) error
- func (op *InstantiateWorkflowTemplateOperation) Done() bool
- func (op *InstantiateWorkflowTemplateOperation) Metadata() (*dataprocpb.WorkflowMetadata, error)
- func (op *InstantiateWorkflowTemplateOperation) Name() string
- func (op *InstantiateWorkflowTemplateOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *InstantiateWorkflowTemplateOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type JobControllerCallOptions
- type JobControllerClient
- func (c *JobControllerClient) CancelJob(ctx context.Context, req *dataprocpb.CancelJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)
- func (c *JobControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *JobControllerClient) Close() error
- func (c *JobControllerClient) Connection() *grpc.ClientConndeprecated
- func (c *JobControllerClient) DeleteJob(ctx context.Context, req *dataprocpb.DeleteJobRequest, opts ...gax.CallOption) error
- func (c *JobControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *JobControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *JobControllerClient) GetJob(ctx context.Context, req *dataprocpb.GetJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)
- func (c *JobControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *JobControllerClient) ListJobs(ctx context.Context, req *dataprocpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator
- func (c *JobControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *JobControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *JobControllerClient) SubmitJob(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)
- func (c *JobControllerClient) SubmitJobAsOperation(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*SubmitJobAsOperationOperation, error)
- func (c *JobControllerClient) SubmitJobAsOperationOperation(name string) *SubmitJobAsOperationOperation
- func (c *JobControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *JobControllerClient) UpdateJob(ctx context.Context, req *dataprocpb.UpdateJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)
- type JobIterator
- type NodeGroupControllerCallOptions
- type NodeGroupControllerClient
- func (c *NodeGroupControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *NodeGroupControllerClient) Close() error
- func (c *NodeGroupControllerClient) Connection() *grpc.ClientConndeprecated
- func (c *NodeGroupControllerClient) CreateNodeGroup(ctx context.Context, req *dataprocpb.CreateNodeGroupRequest, ...) (*CreateNodeGroupOperation, error)
- func (c *NodeGroupControllerClient) CreateNodeGroupOperation(name string) *CreateNodeGroupOperation
- func (c *NodeGroupControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *NodeGroupControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *NodeGroupControllerClient) GetNodeGroup(ctx context.Context, req *dataprocpb.GetNodeGroupRequest, ...) (*dataprocpb.NodeGroup, error)
- func (c *NodeGroupControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *NodeGroupControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *NodeGroupControllerClient) ResizeNodeGroup(ctx context.Context, req *dataprocpb.ResizeNodeGroupRequest, ...) (*ResizeNodeGroupOperation, error)
- func (c *NodeGroupControllerClient) ResizeNodeGroupOperation(name string) *ResizeNodeGroupOperation
- func (c *NodeGroupControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *NodeGroupControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- type OperationIterator
- type ResizeNodeGroupOperation
- func (op *ResizeNodeGroupOperation) Done() bool
- func (op *ResizeNodeGroupOperation) Metadata() (*dataprocpb.NodeGroupOperationMetadata, error)
- func (op *ResizeNodeGroupOperation) Name() string
- func (op *ResizeNodeGroupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
- func (op *ResizeNodeGroupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
- type SessionControllerCallOptions
- type SessionControllerClient
- func (c *SessionControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *SessionControllerClient) Close() error
- func (c *SessionControllerClient) Connection() *grpc.ClientConndeprecated
- func (c *SessionControllerClient) CreateSession(ctx context.Context, req *dataprocpb.CreateSessionRequest, ...) (*CreateSessionOperation, error)
- func (c *SessionControllerClient) CreateSessionOperation(name string) *CreateSessionOperation
- func (c *SessionControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *SessionControllerClient) DeleteSession(ctx context.Context, req *dataprocpb.DeleteSessionRequest, ...) (*DeleteSessionOperation, error)
- func (c *SessionControllerClient) DeleteSessionOperation(name string) *DeleteSessionOperation
- func (c *SessionControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *SessionControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *SessionControllerClient) GetSession(ctx context.Context, req *dataprocpb.GetSessionRequest, opts ...gax.CallOption) (*dataprocpb.Session, error)
- func (c *SessionControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *SessionControllerClient) ListSessions(ctx context.Context, req *dataprocpb.ListSessionsRequest, ...) *SessionIterator
- func (c *SessionControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *SessionControllerClient) TerminateSession(ctx context.Context, req *dataprocpb.TerminateSessionRequest, ...) (*TerminateSessionOperation, error)
- func (c *SessionControllerClient) TerminateSessionOperation(name string) *TerminateSessionOperation
- func (c *SessionControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- type SessionIterator
- type SessionTemplateControllerCallOptions
- type SessionTemplateControllerClient
- func (c *SessionTemplateControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *SessionTemplateControllerClient) Close() error
- func (c *SessionTemplateControllerClient) Connection() *grpc.ClientConndeprecated
- func (c *SessionTemplateControllerClient) CreateSessionTemplate(ctx context.Context, req *dataprocpb.CreateSessionTemplateRequest, ...) (*dataprocpb.SessionTemplate, error)
- func (c *SessionTemplateControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *SessionTemplateControllerClient) DeleteSessionTemplate(ctx context.Context, req *dataprocpb.DeleteSessionTemplateRequest, ...) error
- func (c *SessionTemplateControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *SessionTemplateControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *SessionTemplateControllerClient) GetSessionTemplate(ctx context.Context, req *dataprocpb.GetSessionTemplateRequest, ...) (*dataprocpb.SessionTemplate, error)
- func (c *SessionTemplateControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *SessionTemplateControllerClient) ListSessionTemplates(ctx context.Context, req *dataprocpb.ListSessionTemplatesRequest, ...) *SessionTemplateIterator
- func (c *SessionTemplateControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *SessionTemplateControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *SessionTemplateControllerClient) UpdateSessionTemplate(ctx context.Context, req *dataprocpb.UpdateSessionTemplateRequest, ...) (*dataprocpb.SessionTemplate, error)
- type SessionTemplateIterator
- type StartClusterOperation
- func (op *StartClusterOperation) Done() bool
- func (op *StartClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
- func (op *StartClusterOperation) Name() string
- func (op *StartClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- func (op *StartClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- type StopClusterOperation
- func (op *StopClusterOperation) Done() bool
- func (op *StopClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
- func (op *StopClusterOperation) Name() string
- func (op *StopClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- func (op *StopClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- type SubmitJobAsOperationOperation
- func (op *SubmitJobAsOperationOperation) Done() bool
- func (op *SubmitJobAsOperationOperation) Metadata() (*dataprocpb.JobMetadata, error)
- func (op *SubmitJobAsOperationOperation) Name() string
- func (op *SubmitJobAsOperationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Job, error)
- func (op *SubmitJobAsOperationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Job, error)
- type TerminateSessionOperation
- func (op *TerminateSessionOperation) Done() bool
- func (op *TerminateSessionOperation) Metadata() (*dataprocpb.SessionOperationMetadata, error)
- func (op *TerminateSessionOperation) Name() string
- func (op *TerminateSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
- func (op *TerminateSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
- type UpdateClusterOperation
- func (op *UpdateClusterOperation) Delete(ctx context.Context, opts ...gax.CallOption) error
- func (op *UpdateClusterOperation) Done() bool
- func (op *UpdateClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
- func (op *UpdateClusterOperation) Name() string
- func (op *UpdateClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- func (op *UpdateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Cluster, error)
- type WorkflowTemplateCallOptions
- type WorkflowTemplateClient
- func (c *WorkflowTemplateClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *WorkflowTemplateClient) Close() error
- func (c *WorkflowTemplateClient) Connection() *grpc.ClientConndeprecated
- func (c *WorkflowTemplateClient) CreateWorkflowTemplate(ctx context.Context, req *dataprocpb.CreateWorkflowTemplateRequest, ...) (*dataprocpb.WorkflowTemplate, error)
- func (c *WorkflowTemplateClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *WorkflowTemplateClient) DeleteWorkflowTemplate(ctx context.Context, req *dataprocpb.DeleteWorkflowTemplateRequest, ...) error
- func (c *WorkflowTemplateClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *WorkflowTemplateClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *WorkflowTemplateClient) GetWorkflowTemplate(ctx context.Context, req *dataprocpb.GetWorkflowTemplateRequest, ...) (*dataprocpb.WorkflowTemplate, error)
- func (c *WorkflowTemplateClient) InstantiateInlineWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateInlineWorkflowTemplateRequest, ...) (*InstantiateInlineWorkflowTemplateOperation, error)
- func (c *WorkflowTemplateClient) InstantiateInlineWorkflowTemplateOperation(name string) *InstantiateInlineWorkflowTemplateOperation
- func (c *WorkflowTemplateClient) InstantiateWorkflowTemplate(ctx context.Context, req *dataprocpb.InstantiateWorkflowTemplateRequest, ...) (*InstantiateWorkflowTemplateOperation, error)
- func (c *WorkflowTemplateClient) InstantiateWorkflowTemplateOperation(name string) *InstantiateWorkflowTemplateOperation
- func (c *WorkflowTemplateClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *WorkflowTemplateClient) ListWorkflowTemplates(ctx context.Context, req *dataprocpb.ListWorkflowTemplatesRequest, ...) *WorkflowTemplateIterator
- func (c *WorkflowTemplateClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *WorkflowTemplateClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *WorkflowTemplateClient) UpdateWorkflowTemplate(ctx context.Context, req *dataprocpb.UpdateWorkflowTemplateRequest, ...) (*dataprocpb.WorkflowTemplate, error)
- type WorkflowTemplateIterator
Examples ¶
- AutoscalingPolicyClient.CancelOperation
- AutoscalingPolicyClient.CreateAutoscalingPolicy
- AutoscalingPolicyClient.DeleteAutoscalingPolicy
- AutoscalingPolicyClient.DeleteOperation
- AutoscalingPolicyClient.GetAutoscalingPolicy
- AutoscalingPolicyClient.GetIamPolicy
- AutoscalingPolicyClient.GetOperation
- AutoscalingPolicyClient.ListAutoscalingPolicies
- AutoscalingPolicyClient.ListAutoscalingPolicies (All)
- AutoscalingPolicyClient.ListOperations
- AutoscalingPolicyClient.ListOperations (All)
- AutoscalingPolicyClient.SetIamPolicy
- AutoscalingPolicyClient.TestIamPermissions
- AutoscalingPolicyClient.UpdateAutoscalingPolicy
- BatchControllerClient.CancelOperation
- BatchControllerClient.CreateBatch
- BatchControllerClient.DeleteBatch
- BatchControllerClient.DeleteOperation
- BatchControllerClient.GetBatch
- BatchControllerClient.GetIamPolicy
- BatchControllerClient.GetOperation
- BatchControllerClient.ListBatches
- BatchControllerClient.ListBatches (All)
- BatchControllerClient.ListOperations
- BatchControllerClient.ListOperations (All)
- BatchControllerClient.SetIamPolicy
- BatchControllerClient.TestIamPermissions
- ClusterControllerClient.CancelOperation
- ClusterControllerClient.CreateCluster
- ClusterControllerClient.DeleteCluster
- ClusterControllerClient.DeleteOperation
- ClusterControllerClient.DiagnoseCluster
- ClusterControllerClient.GetCluster
- ClusterControllerClient.GetIamPolicy
- ClusterControllerClient.GetOperation
- ClusterControllerClient.ListClusters
- ClusterControllerClient.ListClusters (All)
- ClusterControllerClient.ListOperations
- ClusterControllerClient.ListOperations (All)
- ClusterControllerClient.SetIamPolicy
- ClusterControllerClient.StartCluster
- ClusterControllerClient.StopCluster
- ClusterControllerClient.TestIamPermissions
- ClusterControllerClient.UpdateCluster
- JobControllerClient.CancelJob
- JobControllerClient.CancelOperation
- JobControllerClient.DeleteJob
- JobControllerClient.DeleteOperation
- JobControllerClient.GetIamPolicy
- JobControllerClient.GetJob
- JobControllerClient.GetOperation
- JobControllerClient.ListJobs
- JobControllerClient.ListJobs (All)
- JobControllerClient.ListOperations
- JobControllerClient.ListOperations (All)
- JobControllerClient.SetIamPolicy
- JobControllerClient.SubmitJob
- JobControllerClient.SubmitJobAsOperation
- JobControllerClient.TestIamPermissions
- JobControllerClient.UpdateJob
- NewAutoscalingPolicyClient
- NewAutoscalingPolicyRESTClient
- NewBatchControllerClient
- NewBatchControllerRESTClient
- NewClusterControllerClient
- NewClusterControllerRESTClient
- NewJobControllerClient
- NewJobControllerRESTClient
- NewNodeGroupControllerClient
- NewNodeGroupControllerRESTClient
- NewSessionControllerClient
- NewSessionControllerRESTClient
- NewSessionTemplateControllerClient
- NewSessionTemplateControllerRESTClient
- NewWorkflowTemplateClient
- NewWorkflowTemplateRESTClient
- NodeGroupControllerClient.CancelOperation
- NodeGroupControllerClient.CreateNodeGroup
- NodeGroupControllerClient.DeleteOperation
- NodeGroupControllerClient.GetIamPolicy
- NodeGroupControllerClient.GetNodeGroup
- NodeGroupControllerClient.GetOperation
- NodeGroupControllerClient.ListOperations
- NodeGroupControllerClient.ListOperations (All)
- NodeGroupControllerClient.ResizeNodeGroup
- NodeGroupControllerClient.SetIamPolicy
- NodeGroupControllerClient.TestIamPermissions
- SessionControllerClient.CancelOperation
- SessionControllerClient.CreateSession
- SessionControllerClient.DeleteOperation
- SessionControllerClient.DeleteSession
- SessionControllerClient.GetIamPolicy
- SessionControllerClient.GetOperation
- SessionControllerClient.GetSession
- SessionControllerClient.ListOperations
- SessionControllerClient.ListOperations (All)
- SessionControllerClient.ListSessions
- SessionControllerClient.ListSessions (All)
- SessionControllerClient.SetIamPolicy
- SessionControllerClient.TerminateSession
- SessionControllerClient.TestIamPermissions
- SessionTemplateControllerClient.CancelOperation
- SessionTemplateControllerClient.CreateSessionTemplate
- SessionTemplateControllerClient.DeleteOperation
- SessionTemplateControllerClient.DeleteSessionTemplate
- SessionTemplateControllerClient.GetIamPolicy
- SessionTemplateControllerClient.GetOperation
- SessionTemplateControllerClient.GetSessionTemplate
- SessionTemplateControllerClient.ListOperations
- SessionTemplateControllerClient.ListOperations (All)
- SessionTemplateControllerClient.ListSessionTemplates
- SessionTemplateControllerClient.ListSessionTemplates (All)
- SessionTemplateControllerClient.SetIamPolicy
- SessionTemplateControllerClient.TestIamPermissions
- SessionTemplateControllerClient.UpdateSessionTemplate
- WorkflowTemplateClient.CancelOperation
- WorkflowTemplateClient.CreateWorkflowTemplate
- WorkflowTemplateClient.DeleteOperation
- WorkflowTemplateClient.DeleteWorkflowTemplate
- WorkflowTemplateClient.GetIamPolicy
- WorkflowTemplateClient.GetOperation
- WorkflowTemplateClient.GetWorkflowTemplate
- WorkflowTemplateClient.InstantiateInlineWorkflowTemplate
- WorkflowTemplateClient.InstantiateWorkflowTemplate
- WorkflowTemplateClient.ListOperations
- WorkflowTemplateClient.ListOperations (All)
- WorkflowTemplateClient.ListWorkflowTemplates
- WorkflowTemplateClient.ListWorkflowTemplates (All)
- WorkflowTemplateClient.SetIamPolicy
- WorkflowTemplateClient.TestIamPermissions
- WorkflowTemplateClient.UpdateWorkflowTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type AutoscalingPolicyCallOptions ¶
type AutoscalingPolicyCallOptions struct { CreateAutoscalingPolicy []gax.CallOption UpdateAutoscalingPolicy []gax.CallOption GetAutoscalingPolicy []gax.CallOption ListAutoscalingPolicies []gax.CallOption DeleteAutoscalingPolicy []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
AutoscalingPolicyCallOptions contains the retry settings for each method of AutoscalingPolicyClient.
type AutoscalingPolicyClient ¶
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.
The API interface for managing autoscaling policies in the Dataproc API.
func NewAutoscalingPolicyClient ¶
func NewAutoscalingPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalingPolicyClient, error)
NewAutoscalingPolicyClient creates a new autoscaling policy service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The API interface for managing autoscaling policies in the Dataproc API.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewAutoscalingPolicyRESTClient ¶
func NewAutoscalingPolicyRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalingPolicyClient, error)
NewAutoscalingPolicyRESTClient creates a new autoscaling policy service rest client.
The API interface for managing autoscaling policies in the Dataproc API.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*AutoscalingPolicyClient) CancelOperation ¶
func (c *AutoscalingPolicyClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*AutoscalingPolicyClient) Close ¶
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
deprecated
func (c *AutoscalingPolicyClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AutoscalingPolicyClient) CreateAutoscalingPolicy ¶
func (c *AutoscalingPolicyClient) CreateAutoscalingPolicy(ctx context.Context, req *dataprocpb.CreateAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, error)
CreateAutoscalingPolicy creates new autoscaling policy.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateAutoscalingPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateAutoscalingPolicyRequest. } resp, err := c.CreateAutoscalingPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AutoscalingPolicyClient) DeleteAutoscalingPolicy ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteAutoscalingPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteAutoscalingPolicyRequest. } err = c.DeleteAutoscalingPolicy(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*AutoscalingPolicyClient) DeleteOperation ¶
func (c *AutoscalingPolicyClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*AutoscalingPolicyClient) GetAutoscalingPolicy ¶
func (c *AutoscalingPolicyClient) GetAutoscalingPolicy(ctx context.Context, req *dataprocpb.GetAutoscalingPolicyRequest, opts ...gax.CallOption) (*dataprocpb.AutoscalingPolicy, error)
GetAutoscalingPolicy retrieves autoscaling policy.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetAutoscalingPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetAutoscalingPolicyRequest. } resp, err := c.GetAutoscalingPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AutoscalingPolicyClient) GetIamPolicy ¶
func (c *AutoscalingPolicyClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AutoscalingPolicyClient) GetOperation ¶
func (c *AutoscalingPolicyClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AutoscalingPolicyClient) ListAutoscalingPolicies ¶
func (c *AutoscalingPolicyClient) ListAutoscalingPolicies(ctx context.Context, req *dataprocpb.ListAutoscalingPoliciesRequest, opts ...gax.CallOption) *AutoscalingPolicyIterator
ListAutoscalingPolicies lists autoscaling policies in the project.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListAutoscalingPoliciesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListAutoscalingPoliciesRequest. } it := c.ListAutoscalingPolicies(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListAutoscalingPoliciesResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListAutoscalingPoliciesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListAutoscalingPoliciesRequest. } for resp, err := range c.ListAutoscalingPolicies(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*AutoscalingPolicyClient) ListOperations ¶
func (c *AutoscalingPolicyClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*AutoscalingPolicyClient) SetIamPolicy ¶
func (c *AutoscalingPolicyClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AutoscalingPolicyClient) TestIamPermissions ¶
func (c *AutoscalingPolicyClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*AutoscalingPolicyClient) UpdateAutoscalingPolicy ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewAutoscalingPolicyClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.UpdateAutoscalingPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateAutoscalingPolicyRequest. } resp, err := c.UpdateAutoscalingPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type AutoscalingPolicyIterator ¶
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) All ¶ added in v2.7.0
func (it *AutoscalingPolicyIterator) All() iter.Seq2[*dataprocpb.AutoscalingPolicy, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AutoscalingPolicyIterator) Next ¶
func (it *AutoscalingPolicyIterator) Next() (*dataprocpb.AutoscalingPolicy, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*AutoscalingPolicyIterator) PageInfo ¶
func (it *AutoscalingPolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BatchControllerCallOptions ¶
type BatchControllerCallOptions struct { CreateBatch []gax.CallOption GetBatch []gax.CallOption ListBatches []gax.CallOption DeleteBatch []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
BatchControllerCallOptions contains the retry settings for each method of BatchControllerClient.
type BatchControllerClient ¶
type BatchControllerClient struct { // The call options for this service. CallOptions *BatchControllerCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
BatchControllerClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The BatchController provides methods to manage batch workloads.
func NewBatchControllerClient ¶
func NewBatchControllerClient(ctx context.Context, opts ...option.ClientOption) (*BatchControllerClient, error)
NewBatchControllerClient creates a new batch controller client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The BatchController provides methods to manage batch workloads.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewBatchControllerRESTClient ¶
func NewBatchControllerRESTClient(ctx context.Context, opts ...option.ClientOption) (*BatchControllerClient, error)
NewBatchControllerRESTClient creates a new batch controller rest client.
The BatchController provides methods to manage batch workloads.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewBatchControllerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*BatchControllerClient) CancelOperation ¶
func (c *BatchControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*BatchControllerClient) Close ¶
func (c *BatchControllerClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*BatchControllerClient) Connection
deprecated
func (c *BatchControllerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*BatchControllerClient) CreateBatch ¶
func (c *BatchControllerClient) CreateBatch(ctx context.Context, req *dataprocpb.CreateBatchRequest, opts ...gax.CallOption) (*CreateBatchOperation, error)
CreateBatch creates a batch workload that executes asynchronously.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateBatchRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateBatchRequest. } op, err := c.CreateBatch(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BatchControllerClient) CreateBatchOperation ¶
func (c *BatchControllerClient) CreateBatchOperation(name string) *CreateBatchOperation
CreateBatchOperation returns a new CreateBatchOperation from a given name. The name must be that of a previously created CreateBatchOperation, possibly from a different process.
func (*BatchControllerClient) DeleteBatch ¶
func (c *BatchControllerClient) DeleteBatch(ctx context.Context, req *dataprocpb.DeleteBatchRequest, opts ...gax.CallOption) error
DeleteBatch deletes the batch workload resource. If the batch is not in terminal state, the delete fails and the response returns FAILED_PRECONDITION.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteBatchRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteBatchRequest. } err = c.DeleteBatch(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*BatchControllerClient) DeleteOperation ¶
func (c *BatchControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*BatchControllerClient) GetBatch ¶
func (c *BatchControllerClient) GetBatch(ctx context.Context, req *dataprocpb.GetBatchRequest, opts ...gax.CallOption) (*dataprocpb.Batch, error)
GetBatch gets the batch workload resource representation.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetBatchRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetBatchRequest. } resp, err := c.GetBatch(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BatchControllerClient) GetIamPolicy ¶
func (c *BatchControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BatchControllerClient) GetOperation ¶
func (c *BatchControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BatchControllerClient) ListBatches ¶
func (c *BatchControllerClient) ListBatches(ctx context.Context, req *dataprocpb.ListBatchesRequest, opts ...gax.CallOption) *BatchIterator
ListBatches lists batch workloads.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListBatchesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListBatchesRequest. } it := c.ListBatches(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListBatchesResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListBatchesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListBatchesRequest. } for resp, err := range c.ListBatches(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*BatchControllerClient) ListOperations ¶
func (c *BatchControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*BatchControllerClient) SetIamPolicy ¶
func (c *BatchControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*BatchControllerClient) TestIamPermissions ¶
func (c *BatchControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewBatchControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type BatchIterator ¶
type BatchIterator 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.Batch, nextPageToken string, err error) // contains filtered or unexported fields }
BatchIterator manages a stream of *dataprocpb.Batch.
func (*BatchIterator) All ¶ added in v2.7.0
func (it *BatchIterator) All() iter.Seq2[*dataprocpb.Batch, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BatchIterator) Next ¶
func (it *BatchIterator) Next() (*dataprocpb.Batch, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BatchIterator) PageInfo ¶
func (it *BatchIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ClusterControllerCallOptions ¶
type ClusterControllerCallOptions struct { CreateCluster []gax.CallOption UpdateCluster []gax.CallOption StopCluster []gax.CallOption StartCluster []gax.CallOption DeleteCluster []gax.CallOption GetCluster []gax.CallOption ListClusters []gax.CallOption DiagnoseCluster []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
ClusterControllerCallOptions contains the retry settings for each method of ClusterControllerClient.
type ClusterControllerClient ¶
type ClusterControllerClient struct { // The call options for this service. CallOptions *ClusterControllerCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
ClusterControllerClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The ClusterControllerService provides methods to manage clusters of Compute Engine instances.
func NewClusterControllerClient ¶
func NewClusterControllerClient(ctx context.Context, opts ...option.ClientOption) (*ClusterControllerClient, error)
NewClusterControllerClient creates a new cluster controller client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The ClusterControllerService provides methods to manage clusters of Compute Engine instances.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewClusterControllerRESTClient ¶
func NewClusterControllerRESTClient(ctx context.Context, opts ...option.ClientOption) (*ClusterControllerClient, error)
NewClusterControllerRESTClient creates a new cluster controller rest client.
The ClusterControllerService provides methods to manage clusters of Compute Engine instances.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewClusterControllerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ClusterControllerClient) CancelOperation ¶
func (c *ClusterControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*ClusterControllerClient) Close ¶
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
deprecated
func (c *ClusterControllerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ClusterControllerClient) CreateCluster ¶
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).
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateClusterRequest. } op, err := c.CreateCluster(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) CreateClusterOperation ¶
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 ¶
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).
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteClusterRequest. } op, err := c.DeleteCluster(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*ClusterControllerClient) DeleteClusterOperation ¶
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) DeleteOperation ¶
func (c *ClusterControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*ClusterControllerClient) DiagnoseCluster ¶
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).
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DiagnoseClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DiagnoseClusterRequest. } op, err := c.DiagnoseCluster(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) DiagnoseClusterOperation ¶
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 ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetClusterRequest. } resp, err := c.GetCluster(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) GetIamPolicy ¶
func (c *ClusterControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) GetOperation ¶
func (c *ClusterControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) ListClusters ¶
func (c *ClusterControllerClient) ListClusters(ctx context.Context, req *dataprocpb.ListClustersRequest, opts ...gax.CallOption) *ClusterIterator
ListClusters lists all regions/{region}/clusters in a project alphabetically.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListClustersRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListClustersRequest. } it := c.ListClusters(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListClustersResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListClustersRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListClustersRequest. } for resp, err := range c.ListClusters(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*ClusterControllerClient) ListOperations ¶
func (c *ClusterControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*ClusterControllerClient) SetIamPolicy ¶
func (c *ClusterControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) StartCluster ¶
func (c *ClusterControllerClient) StartCluster(ctx context.Context, req *dataprocpb.StartClusterRequest, opts ...gax.CallOption) (*StartClusterOperation, error)
StartCluster starts a cluster in a project.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.StartClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#StartClusterRequest. } op, err := c.StartCluster(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) StartClusterOperation ¶
func (c *ClusterControllerClient) StartClusterOperation(name string) *StartClusterOperation
StartClusterOperation returns a new StartClusterOperation from a given name. The name must be that of a previously created StartClusterOperation, possibly from a different process.
func (*ClusterControllerClient) StopCluster ¶
func (c *ClusterControllerClient) StopCluster(ctx context.Context, req *dataprocpb.StopClusterRequest, opts ...gax.CallOption) (*StopClusterOperation, error)
StopCluster stops a cluster in a project.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.StopClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#StopClusterRequest. } op, err := c.StopCluster(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) StopClusterOperation ¶
func (c *ClusterControllerClient) StopClusterOperation(name string) *StopClusterOperation
StopClusterOperation returns a new StopClusterOperation from a given name. The name must be that of a previously created StopClusterOperation, possibly from a different process.
func (*ClusterControllerClient) TestIamPermissions ¶
func (c *ClusterControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) UpdateCluster ¶
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). The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewClusterControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.UpdateClusterRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateClusterRequest. } op, err := c.UpdateCluster(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ClusterControllerClient) UpdateClusterOperation ¶
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 ¶
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) All ¶ added in v2.7.0
func (it *ClusterIterator) All() iter.Seq2[*dataprocpb.Cluster, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ClusterIterator) Next ¶
func (it *ClusterIterator) Next() (*dataprocpb.Cluster, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ClusterIterator) PageInfo ¶
func (it *ClusterIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CreateBatchOperation ¶
type CreateBatchOperation struct {
// contains filtered or unexported fields
}
CreateBatchOperation manages a long-running operation from CreateBatch.
func (*CreateBatchOperation) Done ¶
func (op *CreateBatchOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateBatchOperation) Metadata ¶
func (op *CreateBatchOperation) Metadata() (*dataprocpb.BatchOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateBatchOperation) Name ¶
func (op *CreateBatchOperation) Name() 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 (*CreateBatchOperation) Poll ¶
func (op *CreateBatchOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Batch, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateBatchOperation) Wait ¶
func (op *CreateBatchOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Batch, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateClusterOperation ¶
type CreateClusterOperation struct {
// contains filtered or unexported fields
}
CreateClusterOperation manages a long-running operation from CreateCluster.
func (*CreateClusterOperation) Delete ¶
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 ¶
func (op *CreateClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateClusterOperation) Metadata ¶
func (op *CreateClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateClusterOperation) Name ¶
func (op *CreateClusterOperation) Name() 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 ¶
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 ¶
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 CreateNodeGroupOperation ¶
type CreateNodeGroupOperation struct {
// contains filtered or unexported fields
}
CreateNodeGroupOperation manages a long-running operation from CreateNodeGroup.
func (*CreateNodeGroupOperation) Done ¶
func (op *CreateNodeGroupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateNodeGroupOperation) Metadata ¶
func (op *CreateNodeGroupOperation) Metadata() (*dataprocpb.NodeGroupOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateNodeGroupOperation) Name ¶
func (op *CreateNodeGroupOperation) Name() 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 (*CreateNodeGroupOperation) Poll ¶
func (op *CreateNodeGroupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateNodeGroupOperation) Wait ¶
func (op *CreateNodeGroupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateSessionOperation ¶ added in v2.4.0
type CreateSessionOperation struct {
// contains filtered or unexported fields
}
CreateSessionOperation manages a long-running operation from CreateSession.
func (*CreateSessionOperation) Done ¶ added in v2.4.0
func (op *CreateSessionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateSessionOperation) Metadata ¶ added in v2.4.0
func (op *CreateSessionOperation) Metadata() (*dataprocpb.SessionOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateSessionOperation) Name ¶ added in v2.4.0
func (op *CreateSessionOperation) 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 (*CreateSessionOperation) Poll ¶ added in v2.4.0
func (op *CreateSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*CreateSessionOperation) Wait ¶ added in v2.4.0
func (op *CreateSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteClusterOperation ¶
type DeleteClusterOperation struct {
// contains filtered or unexported fields
}
DeleteClusterOperation manages a long-running operation from DeleteCluster.
func (*DeleteClusterOperation) Delete ¶
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 ¶
func (op *DeleteClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteClusterOperation) Metadata ¶
func (op *DeleteClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteClusterOperation) Name ¶
func (op *DeleteClusterOperation) Name() 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 ¶
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 ¶
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 DeleteSessionOperation ¶ added in v2.4.0
type DeleteSessionOperation struct {
// contains filtered or unexported fields
}
DeleteSessionOperation manages a long-running operation from DeleteSession.
func (*DeleteSessionOperation) Done ¶ added in v2.4.0
func (op *DeleteSessionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteSessionOperation) Metadata ¶ added in v2.4.0
func (op *DeleteSessionOperation) Metadata() (*dataprocpb.SessionOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteSessionOperation) Name ¶ added in v2.4.0
func (op *DeleteSessionOperation) 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 (*DeleteSessionOperation) Poll ¶ added in v2.4.0
func (op *DeleteSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*DeleteSessionOperation) Wait ¶ added in v2.4.0
func (op *DeleteSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DiagnoseClusterOperation ¶
type DiagnoseClusterOperation struct {
// contains filtered or unexported fields
}
DiagnoseClusterOperation manages a long-running operation from DiagnoseCluster.
func (*DiagnoseClusterOperation) Delete ¶
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 ¶
func (op *DiagnoseClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DiagnoseClusterOperation) Metadata ¶
func (op *DiagnoseClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DiagnoseClusterOperation) Name ¶
func (op *DiagnoseClusterOperation) Name() 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 ¶
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 ¶
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 ¶
type InstantiateInlineWorkflowTemplateOperation struct {
// contains filtered or unexported fields
}
InstantiateInlineWorkflowTemplateOperation manages a long-running operation from InstantiateInlineWorkflowTemplate.
func (*InstantiateInlineWorkflowTemplateOperation) Cancel ¶
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 ¶
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 ¶
func (op *InstantiateInlineWorkflowTemplateOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*InstantiateInlineWorkflowTemplateOperation) Metadata ¶
func (op *InstantiateInlineWorkflowTemplateOperation) Metadata() (*dataprocpb.WorkflowMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*InstantiateInlineWorkflowTemplateOperation) Name ¶
func (op *InstantiateInlineWorkflowTemplateOperation) Name() 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 ¶
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 ¶
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 ¶
type InstantiateWorkflowTemplateOperation struct {
// contains filtered or unexported fields
}
InstantiateWorkflowTemplateOperation manages a long-running operation from InstantiateWorkflowTemplate.
func (*InstantiateWorkflowTemplateOperation) Cancel ¶
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 ¶
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 ¶
func (op *InstantiateWorkflowTemplateOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*InstantiateWorkflowTemplateOperation) Metadata ¶
func (op *InstantiateWorkflowTemplateOperation) Metadata() (*dataprocpb.WorkflowMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*InstantiateWorkflowTemplateOperation) Name ¶
func (op *InstantiateWorkflowTemplateOperation) Name() 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 ¶
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 ¶
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 ¶
type JobControllerCallOptions struct { SubmitJob []gax.CallOption SubmitJobAsOperation []gax.CallOption GetJob []gax.CallOption ListJobs []gax.CallOption UpdateJob []gax.CallOption CancelJob []gax.CallOption DeleteJob []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
JobControllerCallOptions contains the retry settings for each method of JobControllerClient.
type JobControllerClient ¶
type JobControllerClient struct { // The call options for this service. CallOptions *JobControllerCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
JobControllerClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The JobController provides methods to manage jobs.
func NewJobControllerClient ¶
func NewJobControllerClient(ctx context.Context, opts ...option.ClientOption) (*JobControllerClient, error)
NewJobControllerClient creates a new job controller client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The JobController provides methods to manage jobs.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewJobControllerRESTClient ¶
func NewJobControllerRESTClient(ctx context.Context, opts ...option.ClientOption) (*JobControllerClient, error)
NewJobControllerRESTClient creates a new job controller rest client.
The JobController provides methods to manage jobs.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewJobControllerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*JobControllerClient) CancelJob ¶
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).
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CancelJobRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CancelJobRequest. } resp, err := c.CancelJob(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) CancelOperation ¶
func (c *JobControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*JobControllerClient) Close ¶
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
deprecated
func (c *JobControllerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*JobControllerClient) DeleteJob ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteJobRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteJobRequest. } err = c.DeleteJob(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*JobControllerClient) DeleteOperation ¶
func (c *JobControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*JobControllerClient) GetIamPolicy ¶
func (c *JobControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) GetJob ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetJobRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetJobRequest. } resp, err := c.GetJob(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) GetOperation ¶
func (c *JobControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) ListJobs ¶
func (c *JobControllerClient) ListJobs(ctx context.Context, req *dataprocpb.ListJobsRequest, opts ...gax.CallOption) *JobIterator
ListJobs lists regions/{region}/jobs in a project.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListJobsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListJobsRequest. } it := c.ListJobs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListJobsResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListJobsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListJobsRequest. } for resp, err := range c.ListJobs(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*JobControllerClient) ListOperations ¶
func (c *JobControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*JobControllerClient) SetIamPolicy ¶
func (c *JobControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) SubmitJob ¶
func (c *JobControllerClient) SubmitJob(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)
SubmitJob submits a job to a cluster.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.SubmitJobRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#SubmitJobRequest. } resp, err := c.SubmitJob(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) SubmitJobAsOperation ¶
func (c *JobControllerClient) SubmitJobAsOperation(ctx context.Context, req *dataprocpb.SubmitJobRequest, opts ...gax.CallOption) (*SubmitJobAsOperationOperation, error)
SubmitJobAsOperation submits job to a cluster.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.SubmitJobRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#SubmitJobRequest. } op, err := c.SubmitJobAsOperation(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) SubmitJobAsOperationOperation ¶
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) TestIamPermissions ¶
func (c *JobControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*JobControllerClient) UpdateJob ¶
func (c *JobControllerClient) UpdateJob(ctx context.Context, req *dataprocpb.UpdateJobRequest, opts ...gax.CallOption) (*dataprocpb.Job, error)
UpdateJob updates a job in a project.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewJobControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.UpdateJobRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateJobRequest. } resp, err := c.UpdateJob(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type JobIterator ¶
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) All ¶ added in v2.7.0
func (it *JobIterator) All() iter.Seq2[*dataprocpb.Job, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*JobIterator) Next ¶
func (it *JobIterator) Next() (*dataprocpb.Job, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. 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.
type NodeGroupControllerCallOptions ¶
type NodeGroupControllerCallOptions struct { CreateNodeGroup []gax.CallOption ResizeNodeGroup []gax.CallOption GetNodeGroup []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
NodeGroupControllerCallOptions contains the retry settings for each method of NodeGroupControllerClient.
type NodeGroupControllerClient ¶
type NodeGroupControllerClient struct { // The call options for this service. CallOptions *NodeGroupControllerCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
NodeGroupControllerClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The NodeGroupControllerService provides methods to manage node groups of Compute Engine managed instances.
func NewNodeGroupControllerClient ¶
func NewNodeGroupControllerClient(ctx context.Context, opts ...option.ClientOption) (*NodeGroupControllerClient, error)
NewNodeGroupControllerClient creates a new node group controller client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The NodeGroupControllerService provides methods to manage node groups of Compute Engine managed instances.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewNodeGroupControllerRESTClient ¶
func NewNodeGroupControllerRESTClient(ctx context.Context, opts ...option.ClientOption) (*NodeGroupControllerClient, error)
NewNodeGroupControllerRESTClient creates a new node group controller rest client.
The NodeGroupControllerService provides methods to manage node groups of Compute Engine managed instances.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*NodeGroupControllerClient) CancelOperation ¶
func (c *NodeGroupControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*NodeGroupControllerClient) Close ¶
func (c *NodeGroupControllerClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*NodeGroupControllerClient) Connection
deprecated
func (c *NodeGroupControllerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*NodeGroupControllerClient) CreateNodeGroup ¶
func (c *NodeGroupControllerClient) CreateNodeGroup(ctx context.Context, req *dataprocpb.CreateNodeGroupRequest, opts ...gax.CallOption) (*CreateNodeGroupOperation, error)
CreateNodeGroup creates a node group in a cluster. The returned Operation.metadata is NodeGroupOperationMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateNodeGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateNodeGroupRequest. } op, err := c.CreateNodeGroup(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*NodeGroupControllerClient) CreateNodeGroupOperation ¶
func (c *NodeGroupControllerClient) CreateNodeGroupOperation(name string) *CreateNodeGroupOperation
CreateNodeGroupOperation returns a new CreateNodeGroupOperation from a given name. The name must be that of a previously created CreateNodeGroupOperation, possibly from a different process.
func (*NodeGroupControllerClient) DeleteOperation ¶
func (c *NodeGroupControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*NodeGroupControllerClient) GetIamPolicy ¶
func (c *NodeGroupControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*NodeGroupControllerClient) GetNodeGroup ¶
func (c *NodeGroupControllerClient) GetNodeGroup(ctx context.Context, req *dataprocpb.GetNodeGroupRequest, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
GetNodeGroup gets the resource representation for a node group in a cluster.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetNodeGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetNodeGroupRequest. } resp, err := c.GetNodeGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*NodeGroupControllerClient) GetOperation ¶
func (c *NodeGroupControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*NodeGroupControllerClient) ListOperations ¶
func (c *NodeGroupControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*NodeGroupControllerClient) ResizeNodeGroup ¶
func (c *NodeGroupControllerClient) ResizeNodeGroup(ctx context.Context, req *dataprocpb.ResizeNodeGroupRequest, opts ...gax.CallOption) (*ResizeNodeGroupOperation, error)
ResizeNodeGroup resizes a node group in a cluster. The returned Operation.metadata is NodeGroupOperationMetadata (at https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ResizeNodeGroupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ResizeNodeGroupRequest. } op, err := c.ResizeNodeGroup(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*NodeGroupControllerClient) ResizeNodeGroupOperation ¶
func (c *NodeGroupControllerClient) ResizeNodeGroupOperation(name string) *ResizeNodeGroupOperation
ResizeNodeGroupOperation returns a new ResizeNodeGroupOperation from a given name. The name must be that of a previously created ResizeNodeGroupOperation, possibly from a different process.
func (*NodeGroupControllerClient) SetIamPolicy ¶
func (c *NodeGroupControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*NodeGroupControllerClient) TestIamPermissions ¶
func (c *NodeGroupControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewNodeGroupControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type OperationIterator ¶
type OperationIterator 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 []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶ added in v2.7.0
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. 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.
type ResizeNodeGroupOperation ¶
type ResizeNodeGroupOperation struct {
// contains filtered or unexported fields
}
ResizeNodeGroupOperation manages a long-running operation from ResizeNodeGroup.
func (*ResizeNodeGroupOperation) Done ¶
func (op *ResizeNodeGroupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ResizeNodeGroupOperation) Metadata ¶
func (op *ResizeNodeGroupOperation) Metadata() (*dataprocpb.NodeGroupOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ResizeNodeGroupOperation) Name ¶
func (op *ResizeNodeGroupOperation) Name() 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 (*ResizeNodeGroupOperation) Poll ¶
func (op *ResizeNodeGroupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*ResizeNodeGroupOperation) Wait ¶
func (op *ResizeNodeGroupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.NodeGroup, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type SessionControllerCallOptions ¶ added in v2.4.0
type SessionControllerCallOptions struct { CreateSession []gax.CallOption GetSession []gax.CallOption ListSessions []gax.CallOption TerminateSession []gax.CallOption DeleteSession []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
SessionControllerCallOptions contains the retry settings for each method of SessionControllerClient.
type SessionControllerClient ¶ added in v2.4.0
type SessionControllerClient struct { // The call options for this service. CallOptions *SessionControllerCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
SessionControllerClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SessionController provides methods to manage interactive sessions.
func NewSessionControllerClient ¶ added in v2.4.0
func NewSessionControllerClient(ctx context.Context, opts ...option.ClientOption) (*SessionControllerClient, error)
NewSessionControllerClient creates a new session controller client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The SessionController provides methods to manage interactive sessions.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewSessionControllerRESTClient ¶ added in v2.4.0
func NewSessionControllerRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionControllerClient, error)
NewSessionControllerRESTClient creates a new session controller rest client.
The SessionController provides methods to manage interactive sessions.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewSessionControllerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*SessionControllerClient) CancelOperation ¶ added in v2.4.0
func (c *SessionControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*SessionControllerClient) Close ¶ added in v2.4.0
func (c *SessionControllerClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionControllerClient) Connection
deprecated
added in
v2.4.0
func (c *SessionControllerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SessionControllerClient) CreateSession ¶ added in v2.4.0
func (c *SessionControllerClient) CreateSession(ctx context.Context, req *dataprocpb.CreateSessionRequest, opts ...gax.CallOption) (*CreateSessionOperation, error)
CreateSession create an interactive session asynchronously.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateSessionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateSessionRequest. } op, err := c.CreateSession(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) CreateSessionOperation ¶ added in v2.4.0
func (c *SessionControllerClient) CreateSessionOperation(name string) *CreateSessionOperation
CreateSessionOperation returns a new CreateSessionOperation from a given name. The name must be that of a previously created CreateSessionOperation, possibly from a different process.
func (*SessionControllerClient) DeleteOperation ¶ added in v2.4.0
func (c *SessionControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*SessionControllerClient) DeleteSession ¶ added in v2.4.0
func (c *SessionControllerClient) DeleteSession(ctx context.Context, req *dataprocpb.DeleteSessionRequest, opts ...gax.CallOption) (*DeleteSessionOperation, error)
DeleteSession deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteSessionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteSessionRequest. } op, err := c.DeleteSession(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) DeleteSessionOperation ¶ added in v2.4.0
func (c *SessionControllerClient) DeleteSessionOperation(name string) *DeleteSessionOperation
DeleteSessionOperation returns a new DeleteSessionOperation from a given name. The name must be that of a previously created DeleteSessionOperation, possibly from a different process.
func (*SessionControllerClient) GetIamPolicy ¶ added in v2.4.0
func (c *SessionControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) GetOperation ¶ added in v2.4.0
func (c *SessionControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) GetSession ¶ added in v2.4.0
func (c *SessionControllerClient) GetSession(ctx context.Context, req *dataprocpb.GetSessionRequest, opts ...gax.CallOption) (*dataprocpb.Session, error)
GetSession gets the resource representation for an interactive session.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetSessionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetSessionRequest. } resp, err := c.GetSession(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) ListOperations ¶ added in v2.4.0
func (c *SessionControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*SessionControllerClient) ListSessions ¶ added in v2.4.0
func (c *SessionControllerClient) ListSessions(ctx context.Context, req *dataprocpb.ListSessionsRequest, opts ...gax.CallOption) *SessionIterator
ListSessions lists interactive sessions.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListSessionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionsRequest. } it := c.ListSessions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListSessionsResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListSessionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionsRequest. } for resp, err := range c.ListSessions(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*SessionControllerClient) SetIamPolicy ¶ added in v2.4.0
func (c *SessionControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) TerminateSession ¶ added in v2.4.0
func (c *SessionControllerClient) TerminateSession(ctx context.Context, req *dataprocpb.TerminateSessionRequest, opts ...gax.CallOption) (*TerminateSessionOperation, error)
TerminateSession terminates the interactive session.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.TerminateSessionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#TerminateSessionRequest. } op, err := c.TerminateSession(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionControllerClient) TerminateSessionOperation ¶ added in v2.4.0
func (c *SessionControllerClient) TerminateSessionOperation(name string) *TerminateSessionOperation
TerminateSessionOperation returns a new TerminateSessionOperation from a given name. The name must be that of a previously created TerminateSessionOperation, possibly from a different process.
func (*SessionControllerClient) TestIamPermissions ¶ added in v2.4.0
func (c *SessionControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewSessionControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type SessionIterator ¶ added in v2.4.0
type SessionIterator 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.Session, nextPageToken string, err error) // contains filtered or unexported fields }
SessionIterator manages a stream of *dataprocpb.Session.
func (*SessionIterator) All ¶ added in v2.7.0
func (it *SessionIterator) All() iter.Seq2[*dataprocpb.Session, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SessionIterator) Next ¶ added in v2.4.0
func (it *SessionIterator) Next() (*dataprocpb.Session, 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 (*SessionIterator) PageInfo ¶ added in v2.4.0
func (it *SessionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SessionTemplateControllerCallOptions ¶ added in v2.4.0
type SessionTemplateControllerCallOptions struct { CreateSessionTemplate []gax.CallOption UpdateSessionTemplate []gax.CallOption GetSessionTemplate []gax.CallOption ListSessionTemplates []gax.CallOption DeleteSessionTemplate []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
SessionTemplateControllerCallOptions contains the retry settings for each method of SessionTemplateControllerClient.
type SessionTemplateControllerClient ¶ added in v2.4.0
type SessionTemplateControllerClient struct { // The call options for this service. CallOptions *SessionTemplateControllerCallOptions // contains filtered or unexported fields }
SessionTemplateControllerClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The SessionTemplateController provides methods to manage session templates.
func NewSessionTemplateControllerClient ¶ added in v2.4.0
func NewSessionTemplateControllerClient(ctx context.Context, opts ...option.ClientOption) (*SessionTemplateControllerClient, error)
NewSessionTemplateControllerClient creates a new session template controller client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The SessionTemplateController provides methods to manage session templates.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewSessionTemplateControllerRESTClient ¶ added in v2.4.0
func NewSessionTemplateControllerRESTClient(ctx context.Context, opts ...option.ClientOption) (*SessionTemplateControllerClient, error)
NewSessionTemplateControllerRESTClient creates a new session template controller rest client.
The SessionTemplateController provides methods to manage session templates.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*SessionTemplateControllerClient) CancelOperation ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*SessionTemplateControllerClient) Close ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*SessionTemplateControllerClient) Connection
deprecated
added in
v2.4.0
func (c *SessionTemplateControllerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*SessionTemplateControllerClient) CreateSessionTemplate ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) CreateSessionTemplate(ctx context.Context, req *dataprocpb.CreateSessionTemplateRequest, opts ...gax.CallOption) (*dataprocpb.SessionTemplate, error)
CreateSessionTemplate create a session template synchronously.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateSessionTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateSessionTemplateRequest. } resp, err := c.CreateSessionTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionTemplateControllerClient) DeleteOperation ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*SessionTemplateControllerClient) DeleteSessionTemplate ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) DeleteSessionTemplate(ctx context.Context, req *dataprocpb.DeleteSessionTemplateRequest, opts ...gax.CallOption) error
DeleteSessionTemplate deletes a session template.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteSessionTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteSessionTemplateRequest. } err = c.DeleteSessionTemplate(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*SessionTemplateControllerClient) GetIamPolicy ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionTemplateControllerClient) GetOperation ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionTemplateControllerClient) GetSessionTemplate ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) GetSessionTemplate(ctx context.Context, req *dataprocpb.GetSessionTemplateRequest, opts ...gax.CallOption) (*dataprocpb.SessionTemplate, error)
GetSessionTemplate gets the resource representation for a session template.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetSessionTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetSessionTemplateRequest. } resp, err := c.GetSessionTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionTemplateControllerClient) ListOperations ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*SessionTemplateControllerClient) ListSessionTemplates ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) ListSessionTemplates(ctx context.Context, req *dataprocpb.ListSessionTemplatesRequest, opts ...gax.CallOption) *SessionTemplateIterator
ListSessionTemplates lists session templates.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListSessionTemplatesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionTemplatesRequest. } it := c.ListSessionTemplates(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListSessionTemplatesResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListSessionTemplatesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListSessionTemplatesRequest. } for resp, err := range c.ListSessionTemplates(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*SessionTemplateControllerClient) SetIamPolicy ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionTemplateControllerClient) TestIamPermissions ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*SessionTemplateControllerClient) UpdateSessionTemplate ¶ added in v2.4.0
func (c *SessionTemplateControllerClient) UpdateSessionTemplate(ctx context.Context, req *dataprocpb.UpdateSessionTemplateRequest, opts ...gax.CallOption) (*dataprocpb.SessionTemplate, error)
UpdateSessionTemplate updates the session template synchronously.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewSessionTemplateControllerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.UpdateSessionTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateSessionTemplateRequest. } resp, err := c.UpdateSessionTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type SessionTemplateIterator ¶ added in v2.4.0
type SessionTemplateIterator 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.SessionTemplate, nextPageToken string, err error) // contains filtered or unexported fields }
SessionTemplateIterator manages a stream of *dataprocpb.SessionTemplate.
func (*SessionTemplateIterator) All ¶ added in v2.7.0
func (it *SessionTemplateIterator) All() iter.Seq2[*dataprocpb.SessionTemplate, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SessionTemplateIterator) Next ¶ added in v2.4.0
func (it *SessionTemplateIterator) Next() (*dataprocpb.SessionTemplate, 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 (*SessionTemplateIterator) PageInfo ¶ added in v2.4.0
func (it *SessionTemplateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type StartClusterOperation ¶
type StartClusterOperation struct {
// contains filtered or unexported fields
}
StartClusterOperation manages a long-running operation from StartCluster.
func (*StartClusterOperation) Done ¶
func (op *StartClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*StartClusterOperation) Metadata ¶
func (op *StartClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*StartClusterOperation) Name ¶
func (op *StartClusterOperation) Name() 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 (*StartClusterOperation) Poll ¶
func (op *StartClusterOperation) 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 (*StartClusterOperation) Wait ¶
func (op *StartClusterOperation) 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 StopClusterOperation ¶
type StopClusterOperation struct {
// contains filtered or unexported fields
}
StopClusterOperation manages a long-running operation from StopCluster.
func (*StopClusterOperation) Done ¶
func (op *StopClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*StopClusterOperation) Metadata ¶
func (op *StopClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*StopClusterOperation) Name ¶
func (op *StopClusterOperation) Name() 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 (*StopClusterOperation) Poll ¶
func (op *StopClusterOperation) 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 (*StopClusterOperation) Wait ¶
func (op *StopClusterOperation) 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 SubmitJobAsOperationOperation ¶
type SubmitJobAsOperationOperation struct {
// contains filtered or unexported fields
}
SubmitJobAsOperationOperation manages a long-running operation from SubmitJobAsOperation.
func (*SubmitJobAsOperationOperation) Done ¶
func (op *SubmitJobAsOperationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*SubmitJobAsOperationOperation) Metadata ¶
func (op *SubmitJobAsOperationOperation) Metadata() (*dataprocpb.JobMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*SubmitJobAsOperationOperation) Name ¶
func (op *SubmitJobAsOperationOperation) Name() 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 ¶
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 ¶
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 TerminateSessionOperation ¶ added in v2.4.0
type TerminateSessionOperation struct {
// contains filtered or unexported fields
}
TerminateSessionOperation manages a long-running operation from TerminateSession.
func (*TerminateSessionOperation) Done ¶ added in v2.4.0
func (op *TerminateSessionOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*TerminateSessionOperation) Metadata ¶ added in v2.4.0
func (op *TerminateSessionOperation) Metadata() (*dataprocpb.SessionOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*TerminateSessionOperation) Name ¶ added in v2.4.0
func (op *TerminateSessionOperation) 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 (*TerminateSessionOperation) Poll ¶ added in v2.4.0
func (op *TerminateSessionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds 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 (*TerminateSessionOperation) Wait ¶ added in v2.4.0
func (op *TerminateSessionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*dataprocpb.Session, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateClusterOperation ¶
type UpdateClusterOperation struct {
// contains filtered or unexported fields
}
UpdateClusterOperation manages a long-running operation from UpdateCluster.
func (*UpdateClusterOperation) Delete ¶
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 ¶
func (op *UpdateClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateClusterOperation) Metadata ¶
func (op *UpdateClusterOperation) Metadata() (*dataprocpb.ClusterOperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateClusterOperation) Name ¶
func (op *UpdateClusterOperation) Name() 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 ¶
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 ¶
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 ¶
type WorkflowTemplateCallOptions struct { CreateWorkflowTemplate []gax.CallOption GetWorkflowTemplate []gax.CallOption InstantiateWorkflowTemplate []gax.CallOption InstantiateInlineWorkflowTemplate []gax.CallOption UpdateWorkflowTemplate []gax.CallOption ListWorkflowTemplates []gax.CallOption DeleteWorkflowTemplate []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
WorkflowTemplateCallOptions contains the retry settings for each method of WorkflowTemplateClient.
type WorkflowTemplateClient ¶
type WorkflowTemplateClient struct { // The call options for this service. CallOptions *WorkflowTemplateCallOptions // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
WorkflowTemplateClient is a client for interacting with Cloud Dataproc API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The API interface for managing Workflow Templates in the Dataproc API.
func NewWorkflowTemplateClient ¶
func NewWorkflowTemplateClient(ctx context.Context, opts ...option.ClientOption) (*WorkflowTemplateClient, error)
NewWorkflowTemplateClient creates a new workflow template service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The API interface for managing Workflow Templates in the Dataproc API.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewWorkflowTemplateRESTClient ¶
func NewWorkflowTemplateRESTClient(ctx context.Context, opts ...option.ClientOption) (*WorkflowTemplateClient, error)
NewWorkflowTemplateRESTClient creates a new workflow template service rest client.
The API interface for managing Workflow Templates in the Dataproc API.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*WorkflowTemplateClient) CancelOperation ¶
func (c *WorkflowTemplateClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*WorkflowTemplateClient) Close ¶
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
deprecated
func (c *WorkflowTemplateClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*WorkflowTemplateClient) CreateWorkflowTemplate ¶
func (c *WorkflowTemplateClient) CreateWorkflowTemplate(ctx context.Context, req *dataprocpb.CreateWorkflowTemplateRequest, opts ...gax.CallOption) (*dataprocpb.WorkflowTemplate, error)
CreateWorkflowTemplate creates new workflow template.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.CreateWorkflowTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#CreateWorkflowTemplateRequest. } resp, err := c.CreateWorkflowTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*WorkflowTemplateClient) DeleteOperation ¶
func (c *WorkflowTemplateClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } }
Output:
func (*WorkflowTemplateClient) DeleteWorkflowTemplate ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.DeleteWorkflowTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#DeleteWorkflowTemplateRequest. } err = c.DeleteWorkflowTemplate(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*WorkflowTemplateClient) GetIamPolicy ¶
func (c *WorkflowTemplateClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*WorkflowTemplateClient) GetOperation ¶
func (c *WorkflowTemplateClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*WorkflowTemplateClient) GetWorkflowTemplate ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.GetWorkflowTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#GetWorkflowTemplateRequest. } resp, err := c.GetWorkflowTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*WorkflowTemplateClient) InstantiateInlineWorkflowTemplate ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.InstantiateInlineWorkflowTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#InstantiateInlineWorkflowTemplateRequest. } op, err := c.InstantiateInlineWorkflowTemplate(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*WorkflowTemplateClient) InstantiateInlineWorkflowTemplateOperation ¶
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 ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.InstantiateWorkflowTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#InstantiateWorkflowTemplateRequest. } op, err := c.InstantiateWorkflowTemplate(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*WorkflowTemplateClient) InstantiateWorkflowTemplateOperation ¶
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) ListOperations ¶
func (c *WorkflowTemplateClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*WorkflowTemplateClient) ListWorkflowTemplates ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" "google.golang.org/api/iterator" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListWorkflowTemplatesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListWorkflowTemplatesRequest. } it := c.ListWorkflowTemplates(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*dataprocpb.ListWorkflowTemplatesResponse) } }
Output:
Example (All) ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.ListWorkflowTemplatesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#ListWorkflowTemplatesRequest. } for resp, err := range c.ListWorkflowTemplates(ctx, req).All() { if err != nil { // TODO: Handle error and break/return/continue. Iteration will stop after any error. } // TODO: Use resp. _ = resp } }
Output:
func (*WorkflowTemplateClient) SetIamPolicy ¶
func (c *WorkflowTemplateClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*WorkflowTemplateClient) TestIamPermissions ¶
func (c *WorkflowTemplateClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" iampb "cloud.google.com/go/iam/apiv1/iampb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*WorkflowTemplateClient) UpdateWorkflowTemplate ¶
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.
Example ¶
package main import ( "context" dataproc "cloud.google.com/go/dataproc/v2/apiv1" dataprocpb "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb" ) func main() { 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_Options c, err := dataproc.NewWorkflowTemplateClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &dataprocpb.UpdateWorkflowTemplateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/dataproc/v2/apiv1/dataprocpb#UpdateWorkflowTemplateRequest. } resp, err := c.UpdateWorkflowTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type WorkflowTemplateIterator ¶
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) All ¶ added in v2.7.0
func (it *WorkflowTemplateIterator) All() iter.Seq2[*dataprocpb.WorkflowTemplate, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*WorkflowTemplateIterator) Next ¶
func (it *WorkflowTemplateIterator) Next() (*dataprocpb.WorkflowTemplate, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*WorkflowTemplateIterator) PageInfo ¶
func (it *WorkflowTemplateIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
Source Files
¶
- autoscaling_policy_client.go
- auxiliary.go
- auxiliary_go123.go
- batch_controller_client.go
- cluster_controller_client.go
- doc.go
- helpers.go
- job_controller_client.go
- longrunning.go
- node_group_controller_client.go
- session_controller_client.go
- session_template_controller_client.go
- version.go
- workflow_template_client.go