Cancel job execution
curl --request DELETE \
--url https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"cluster": "<string>",
"completedAt": "<string>",
"createdAt": "<string>",
"deletedAt": "<string>",
"expiredAt": "<string>",
"id": "exec-abc123",
"job": "data-processing-job",
"startedAt": "<string>",
"updatedAt": "<string>",
"workspace": "my-workspace"
},
"spec": {
"envOverride": "{\"MY_VAR\": \"***\", \"BATCH_SIZE\": \"***\"}",
"memoryOverride": 2048,
"parallelism": 5,
"taskCount": 12,
"tasks": [
{
"conditions": [
{
"executionReason": "<string>",
"message": "<string>",
"reason": "<string>",
"severity": "<string>",
"state": "<string>",
"type": "<string>"
}
],
"metadata": {
"completedAt": "<string>",
"createdAt": "<string>",
"name": "task-0",
"scheduledAt": "<string>",
"startedAt": "<string>",
"updatedAt": "<string>"
},
"spec": {
"maxRetries": 3,
"timeout": "30m"
},
"status": "unspecified"
}
],
"tasksRef": "<string>",
"timeout": 3600
},
"stats": {
"cancelled": 0,
"failure": 1,
"retried": 2,
"running": 1,
"success": 8,
"total": 10
},
"status": "queued",
"tasks": [
{
"conditions": [
{
"executionReason": "<string>",
"message": "<string>",
"reason": "<string>",
"severity": "<string>",
"state": "<string>",
"type": "<string>"
}
],
"metadata": {
"completedAt": "<string>",
"createdAt": "<string>",
"name": "task-0",
"scheduledAt": "<string>",
"startedAt": "<string>",
"updatedAt": "<string>"
},
"spec": {
"maxRetries": 3,
"timeout": "30m"
},
"status": "unspecified"
}
]
}jobs
Cancel job execution
Cancels a running job execution. Tasks already in progress will complete, but no new tasks will be started. The execution status changes to ‘cancelling’ then ‘cancelled’.
DELETE
/
jobs
/
{jobId}
/
executions
/
{executionId}
Cancel job execution
curl --request DELETE \
--url https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blaxel.ai/v0/jobs/{jobId}/executions/{executionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"metadata": {
"cluster": "<string>",
"completedAt": "<string>",
"createdAt": "<string>",
"deletedAt": "<string>",
"expiredAt": "<string>",
"id": "exec-abc123",
"job": "data-processing-job",
"startedAt": "<string>",
"updatedAt": "<string>",
"workspace": "my-workspace"
},
"spec": {
"envOverride": "{\"MY_VAR\": \"***\", \"BATCH_SIZE\": \"***\"}",
"memoryOverride": 2048,
"parallelism": 5,
"taskCount": 12,
"tasks": [
{
"conditions": [
{
"executionReason": "<string>",
"message": "<string>",
"reason": "<string>",
"severity": "<string>",
"state": "<string>",
"type": "<string>"
}
],
"metadata": {
"completedAt": "<string>",
"createdAt": "<string>",
"name": "task-0",
"scheduledAt": "<string>",
"startedAt": "<string>",
"updatedAt": "<string>"
},
"spec": {
"maxRetries": 3,
"timeout": "30m"
},
"status": "unspecified"
}
],
"tasksRef": "<string>",
"timeout": 3600
},
"stats": {
"cancelled": 0,
"failure": 1,
"retried": 2,
"running": 1,
"success": 8,
"total": 10
},
"status": "queued",
"tasks": [
{
"conditions": [
{
"executionReason": "<string>",
"message": "<string>",
"reason": "<string>",
"severity": "<string>",
"state": "<string>",
"type": "<string>"
}
],
"metadata": {
"completedAt": "<string>",
"createdAt": "<string>",
"name": "task-0",
"scheduledAt": "<string>",
"startedAt": "<string>",
"updatedAt": "<string>"
},
"spec": {
"maxRetries": 3,
"timeout": "30m"
},
"status": "unspecified"
}
]
}Authorizations
OAuth2ApiKeyAuth
Response
successful operation
Job execution
Was this page helpful?