Stop Job Run
curl --request PUT \
--url https://api.dispersed.com/v1/job-runs/{uuid}/cancel \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Cancelled by user"
}
'import requests
url = "https://api.dispersed.com/v1/job-runs/{uuid}/cancel"
payload = { "reason": "Cancelled by user" }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Cancelled by user'})
};
fetch('https://api.dispersed.com/v1/job-runs/{uuid}/cancel', 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.dispersed.com/v1/job-runs/{uuid}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Cancelled by user'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dispersed.com/v1/job-runs/{uuid}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Cancelled by user\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.dispersed.com/v1/job-runs/{uuid}/cancel")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Cancelled by user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dispersed.com/v1/job-runs/{uuid}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Cancelled by user\"\n}"
response = http.request(request)
puts response.read_body{
"object": "job_run",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"node_urls": [
{
"hostname": "<string>",
"port": 123,
"protocol": "<string>",
"description": "<string>",
"tls": false
}
],
"assigned_at_ms": 123,
"duration_ms": 123,
"max_timeout_start_ms": 123,
"billing_rule": "<string>",
"hourly_rate_usd": 123,
"job_snapshot": {
"title": "<string>",
"uuid": "<string>"
},
"uuid": "<string>",
"prepared_at_ms": 123,
"started_at_ms": 123,
"ended_at_ms": 123,
"max_timeout_run_ms": 123,
"timeout_run_at_ms": 123,
"timeout_start_at_ms": 123,
"prep_hourly_rate_usd": 123,
"last_billed_at": "2023-11-07T05:31:56Z",
"next_billing_at": "2023-11-07T05:31:56Z",
"cancelled_reason": "<string>",
"failed_reason": "<string>",
"logs": "<string>",
"container_access_tokens": [],
"job_uuid": "<string>",
"job": "<string>",
"image_size_bytes": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}Job Runs
Stop Job Run
PUT
/
v1
/
job-runs
/
{uuid}
/
cancel
Stop Job Run
curl --request PUT \
--url https://api.dispersed.com/v1/job-runs/{uuid}/cancel \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Cancelled by user"
}
'import requests
url = "https://api.dispersed.com/v1/job-runs/{uuid}/cancel"
payload = { "reason": "Cancelled by user" }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Cancelled by user'})
};
fetch('https://api.dispersed.com/v1/job-runs/{uuid}/cancel', 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.dispersed.com/v1/job-runs/{uuid}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Cancelled by user'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dispersed.com/v1/job-runs/{uuid}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Cancelled by user\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.dispersed.com/v1/job-runs/{uuid}/cancel")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Cancelled by user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dispersed.com/v1/job-runs/{uuid}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Cancelled by user\"\n}"
response = http.request(request)
puts response.read_body{
"object": "job_run",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"node_urls": [
{
"hostname": "<string>",
"port": 123,
"protocol": "<string>",
"description": "<string>",
"tls": false
}
],
"assigned_at_ms": 123,
"duration_ms": 123,
"max_timeout_start_ms": 123,
"billing_rule": "<string>",
"hourly_rate_usd": 123,
"job_snapshot": {
"title": "<string>",
"uuid": "<string>"
},
"uuid": "<string>",
"prepared_at_ms": 123,
"started_at_ms": 123,
"ended_at_ms": 123,
"max_timeout_run_ms": 123,
"timeout_run_at_ms": 123,
"timeout_start_at_ms": 123,
"prep_hourly_rate_usd": 123,
"last_billed_at": "2023-11-07T05:31:56Z",
"next_billing_at": "2023-11-07T05:31:56Z",
"cancelled_reason": "<string>",
"failed_reason": "<string>",
"logs": "<string>",
"container_access_tokens": [],
"job_uuid": "<string>",
"job": "<string>",
"image_size_bytes": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"timestamp": "<string>",
"details": []
}
}Path Parameters
Body
application/json
Example:
"Cancelled by user"
Response
Job run cancelled
Available options:
job_run Available options:
ASSIGNED, PREPARING, RUNNING, COMPLETED, CANCELLING, CANCELLED, FAILING, FAILED Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I