commandexecution

package
v0.0.1-dev.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelCommandRequest

type CancelCommandRequest struct {
	ClusterId *string
	CommandId *string
	ContextId *string
}

type CancelResponse

type CancelResponse struct {
}

type CancelWaiter

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

CancelWaiter tracks the state of the operation started by Cancel.

func (*CancelWaiter) Done

func (w *CancelWaiter) Done(ctx context.Context, opts ...call.Option) (bool, error)

Done polls once and reports whether the operation has reached a terminal state.

func (*CancelWaiter) GetClusterId

func (w *CancelWaiter) GetClusterId() string

GetClusterId returns the ClusterId value used to identify the operation.

func (*CancelWaiter) GetCommandId

func (w *CancelWaiter) GetCommandId() string

GetCommandId returns the CommandId value used to identify the operation.

func (*CancelWaiter) GetContextId

func (w *CancelWaiter) GetContextId() string

GetContextId returns the ContextId value used to identify the operation.

func (*CancelWaiter) Wait

Wait polls until the operation reaches a terminal state.

type Client

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

func NewClient

func NewClient(ctx context.Context, opts ...client.Option) (*Client, error)

func (*Client) Cancel

func (c *Client) Cancel(ctx context.Context, req CancelCommandRequest, opts ...call.Option) (*CancelWaiter, error)

Cancels a currently running command within an execution context.

The command ID is obtained from a prior successful call to __execute__.

func (*Client) Create

func (c *Client) Create(ctx context.Context, req CreateContextRequest, opts ...call.Option) (*CreateWaiter, error)

Creates an execution context for running cluster commands.

If successful, this method returns the ID of the new execution context.

func (*Client) Destroy

func (c *Client) Destroy(ctx context.Context, req DestroyContextRequest, opts ...call.Option) (*DestroyResponse, error)

Deletes an execution context.

func (*Client) Execute

func (c *Client) Execute(ctx context.Context, req ExecuteCommandRequest, opts ...call.Option) (*ExecuteWaiter, error)

Runs a cluster command in the given execution context, using the provided language.

If successful, it returns an ID for tracking the status of the command's execution.

func (*Client) GetCommandStatus

func (c *Client) GetCommandStatus(ctx context.Context, req GetCommandStatusRequest, opts ...call.Option) (*GetCommandStatusResponse, error)

Gets the status of and, if available, the results from a currently executing command.

The command ID is obtained from a prior successful call to __execute__.

func (*Client) GetContextStatus

func (c *Client) GetContextStatus(ctx context.Context, req GetContextStatusRequest, opts ...call.Option) (*GetContextStatusResponse, error)

Gets the status for an execution context.

type CommandStatus

type CommandStatus string
const (
	CommandStatus_Unspecified       CommandStatus = ""
	CommandStatus_CommandCancelled  CommandStatus = "Cancelled"
	CommandStatus_CommandCancelling CommandStatus = "Cancelling"
	CommandStatus_CommandError      CommandStatus = "Error"
	CommandStatus_CommandFinished   CommandStatus = "Finished"
	CommandStatus_CommandQueued     CommandStatus = "Queued"
	CommandStatus_CommandRunning    CommandStatus = "Running"
)

type ContextStatus

type ContextStatus string
const (
	ContextStatus_Unspecified    ContextStatus = ""
	ContextStatus_ContextRunning ContextStatus = "Running"
	ContextStatus_ContextPending ContextStatus = "Pending"
	ContextStatus_ContextError   ContextStatus = "Error"
)

type CreateContextRequest

type CreateContextRequest struct {
	// Running cluster id
	ClusterId *string
	Language  Language
}

type CreateResponse

type CreateResponse struct {
	Id *string
}

type CreateWaiter

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

CreateWaiter tracks the state of the operation started by Create.

func (*CreateWaiter) Done

func (w *CreateWaiter) Done(ctx context.Context, opts ...call.Option) (bool, error)

Done polls once and reports whether the operation has reached a terminal state.

func (*CreateWaiter) GetClusterId

func (w *CreateWaiter) GetClusterId() string

GetClusterId returns the ClusterId value used to identify the operation.

func (*CreateWaiter) GetContextId

func (w *CreateWaiter) GetContextId() string

GetContextId returns the ContextId value used to identify the operation.

func (*CreateWaiter) Wait

Wait polls until the operation reaches a terminal state.

type DestroyContextRequest

type DestroyContextRequest struct {
	ClusterId *string
	ContextId *string
}

type DestroyResponse

type DestroyResponse struct {
}

type ExecuteCommandRequest

type ExecuteCommandRequest struct {
	// Running cluster id
	ClusterId *string
	// Running context id
	ContextId *string
	Language  Language
	// Executable code
	Command *string
}

type ExecuteWaiter

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

ExecuteWaiter tracks the state of the operation started by Execute.

func (*ExecuteWaiter) Done

func (w *ExecuteWaiter) Done(ctx context.Context, opts ...call.Option) (bool, error)

Done polls once and reports whether the operation has reached a terminal state.

func (*ExecuteWaiter) GetClusterId

func (w *ExecuteWaiter) GetClusterId() string

GetClusterId returns the ClusterId value used to identify the operation.

func (*ExecuteWaiter) GetCommandId

func (w *ExecuteWaiter) GetCommandId() string

GetCommandId returns the CommandId value used to identify the operation.

func (*ExecuteWaiter) GetContextId

func (w *ExecuteWaiter) GetContextId() string

GetContextId returns the ContextId value used to identify the operation.

func (*ExecuteWaiter) Wait

Wait polls until the operation reaches a terminal state.

type GetCommandStatusRequest

type GetCommandStatusRequest struct {
	ClusterId *string
	ContextId *string
	CommandId *string
}

Request to get the status of a previously submitted command..

type GetCommandStatusResponse

type GetCommandStatusResponse struct {
	Id      *string
	Status  CommandStatus
	Results *Results
}

type GetContextStatusRequest

type GetContextStatusRequest struct {
	ClusterId *string
	ContextId *string
}

Request to retrieve the status of an execution context..

type GetContextStatusResponse

type GetContextStatusResponse struct {
	Id     *string
	Status ContextStatus
}

type Language

type Language string
const (
	Language_Unspecified Language = ""
	Language_Python      Language = "python"
	Language_Scala       Language = "scala"
	Language_Sql         Language = "sql"
	Language_R           Language = "r"
)

type ResultType

type ResultType string
const (
	ResultType_Unspecified  ResultType = ""
	ResultType_ErrorResult  ResultType = "error"
	ResultType_ImageResult  ResultType = "image"
	ResultType_ImagesResult ResultType = "images"
	ResultType_TableResult  ResultType = "table"
	ResultType_TextResult   ResultType = "text"
)

type Results

type Results struct {
	// The cause of the error
	Cause *string
	Data  json.RawMessage
	// The image data in one of the following formats:
	//
	// 1. A Data URL with base64-encoded image data:
	// `data:image/{type};base64,{base64-data}`. Example:
	// `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...`
	//
	// 2. A FileStore file path for large images: `/plots/{filename}.png`. Example:
	// `/plots/b6a7ad70-fb2c-4353-8aed-3f1e015174a4.png`
	FileName *string
	// List of image data for multiple images. Each element follows the same format
	// as file_name.
	FileNames []string
	// true if a JSON schema is returned instead of a string representation of the
	// Hive type.
	IsJsonSchema *bool
	// internal field used by SDK
	Pos        *int
	ResultType ResultType
	// The table schema
	Schema []map[string]json.RawMessage
	// The summary of the error
	Summary *string
	// true if partial results are returned.
	Truncated *bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL