Skip to main content

Command Execution

View as Markdown

Cancel GA

POST /api/1.2/commands/cancel

Cancels a currently running command within an execution context.

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

API scopes: command-execution

Request body

clusterIdstring
commandIdstring
contextIdstring

Create GA

POST /api/1.2/contexts/create

Creates an execution context for running cluster commands.

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

API scopes: command-execution

Request body

clusterIdstring

Running cluster id

languagestring

Values: LANGUAGE_UNSPECIFIED, PYTHON, SCALA, SQL, R

Response

idstring

Destroy GA

POST /api/1.2/contexts/destroy

Deletes an execution context.

API scopes: command-execution

Request body

clusterIdstring
contextIdstring

Execute GA

POST /api/1.2/commands/execute

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.

API scopes: command-execution

Request body

clusterIdstring

Running cluster id

contextIdstring

Running context id

languagestring

Values: LANGUAGE_UNSPECIFIED, PYTHON, SCALA, SQL, R

commandstring

Executable code

Response

idstring

Get Command Status GA

GET /api/1.2/commands/status

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.

API scopes: command-execution

Parameters

clusterIdstringquery
contextIdstringquery
commandIdstringquery

Response

idstring
statusstring

Values: COMMAND_STATUS_UNSPECIFIED, COMMAND_CANCELLED, COMMAND_CANCELLING, COMMAND_ERROR, COMMAND_FINISHED, COMMAND_QUEUED, COMMAND_RUNNING

resultsobject
Show child attributesHide child attributes
causestring

The cause of the error

dataobject
fileNamestring

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

fileNamesarray of string

List of image data for multiple images. Each element follows the same format as file_name.

isJsonSchemaboolean

true if a JSON schema is returned instead of a string representation of the Hive type.

posint32

internal field used by SDK

resultTypestring

Values: RESULT_TYPE_UNSPECIFIED, ERROR_RESULT, IMAGE_RESULT, IMAGES_RESULT, TABLE_RESULT, TEXT_RESULT

schemaarray of object

The table schema

summarystring

The summary of the error

truncatedboolean

true if partial results are returned.

Get Context Status GA

GET /api/1.2/contexts/status

Gets the status for an execution context.

API scopes: command-execution

Parameters

clusterIdstringquery
contextIdstringquery

Response

idstring
statusstring

Values: CONTEXT_STATUS_UNSPECIFIED, CONTEXT_RUNNING, CONTEXT_PENDING, CONTEXT_ERROR