Skip to main content

Command Execution

View as Markdown

Cancel a command 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 an execution context 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

Delete an execution context GA

POST /api/1.2/contexts/destroy

Deletes an execution context.

API scopes: command-execution

Request body

clusterIdstringRequired
contextIdstringRequired

Run a command 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 info 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

clusterIdstringRequiredquery
contextIdstringRequiredquery
commandIdstringRequiredquery

Response

idstring
statusstring

Values:

  • COMMAND_STATUS_UNSPECIFIED
  • Cancelled
  • Cancelling
  • Error
  • Finished
  • Queued
  • 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
  • image
  • images
  • table
  • text
schemaarray of object

The table schema

summarystring

The summary of the error

truncatedboolean

true if partial results are returned.

Get status GA

GET /api/1.2/contexts/status

Gets the status for an execution context.

API scopes: command-execution

Parameters

clusterIdstringRequiredquery
contextIdstringRequiredquery

Response

idstring
statusstring

Values:

  • CONTEXT_STATUS_UNSPECIFIED
  • Running
  • Pending
  • Error