listSparkJobs(options?)
List your Spark job scripts with pagination.
Parameters
Number of scripts to return per page.
Number of scripts to skip for pagination.
Return type: ListSparkJobsResult
| Field | Type | Description |
|---|---|---|
scripts | string[] | Script names for the current page |
hasMore | boolean | Whether more scripts are available |
submitSparkJob(options)
Submit a Spark job for execution. Returns a run ID that you can use with getRun() to poll status.
Parameters
Job namespace.
Job name.
Name of the script to execute.
Arguments to pass to the script.
Machine type for the Spark driver.
Machine type for Spark executors.
Number of executors (1-20).
Tags applied to the job.
Tags applied to this run.
Machine types
TheSparkMachineType enum covers compute-optimized (c), balanced (b), and memory-optimized (m) options:
| Type | vCPUs | Category |
|---|---|---|
spark.1.c / spark.1.b / spark.1.m | 1 | Compute / Balanced / Memory |
spark.2.c / spark.2.b / spark.2.m | 2 | Compute / Balanced / Memory |
spark.4.c / spark.4.b / spark.4.m | 4 | Compute / Balanced / Memory |
spark.8.c / spark.8.b / spark.8.m | 8 | Compute / Balanced / Memory |
spark.16.c / spark.16.b / spark.16.m | 16 | Compute / Balanced / Memory |
submitSparkJobAndWait(options)
Submit a Spark job and poll until it reaches a terminal state (COMPLETE, FAIL, or ABORT). Throws an error if the timeout is exceeded.
submitSparkJob parameters plus:
Milliseconds between status polls.
Maximum time to wait in milliseconds before throwing a timeout error.
getRun(runId)
Get the current status of a run. Use this to poll a job submitted with submitSparkJob().
Return type: RunResponse
| Field | Type | Description |
|---|---|---|
id | string | Run ID |
state | string | Current state (COMPLETE, FAIL, ABORT, etc.) |
started_at | string | ISO timestamp when the run started |
queued_at | string | ISO timestamp when the run was queued |
scheduled_at | string | ISO timestamp when the run was scheduled |
ended_at | string | ISO timestamp when the run ended |
duration | number | Run duration in seconds |
error | unknown | Error details if the run failed |
tags | Tag[] | Array of { key, value, source } objects |
job | object | Job info with id, name, namespace |
pipeline | object | Pipeline info with id, name, namespace |