실행 취소
curl --request POST \
--url https://api.example.com/v1/runs/{run_id}/cancelimport requests
url = "https://api.example.com/v1/runs/{run_id}/cancel"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/runs/{run_id}/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.example.com/v1/runs/{run_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v1/runs/{run_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/runs/{run_id}/cancel")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/runs/{run_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"namespace": "<string>",
"app_name": "<string>",
"app_version": "<string>",
"build_id": "<string>",
"run_kind": "<string>",
"state": {},
"input": {},
"progress": {
"done": 123,
"total": 123,
"status_text": "<string>"
},
"dataset_id": "<string>",
"partial": true,
"cancel_requested": true,
"triggered_by": "<string>",
"upstream_ref": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"first_started_at": "<string>",
"finished_at": "<string>",
"usage": {
"metrics": {},
"duration_ms": 123
},
"billing": {
"events": [
{
"event": "<string>",
"label": "<string>",
"qty": 123,
"unit_price": 123,
"amount": 123,
"unit_size": 123,
"raw_qty": 123
}
],
"total": 123,
"currency": "<string>",
"charged": true
},
"error": {
"code": "<string>",
"category": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123,
"item_index": 123,
"details": [
{}
]
},
"sample_records": [
{}
],
"warnings": [
{
"code": "<string>",
"event": "<string>",
"detail": {},
"count": 123,
"updated_at": "<string>"
}
]
}Runs & Results
실행 취소
취소 신호를 보내고 현재 실행 객체 반환.
POST
/
v1
/
runs
/
{run_id}
/
cancel
실행 취소
curl --request POST \
--url https://api.example.com/v1/runs/{run_id}/cancelimport requests
url = "https://api.example.com/v1/runs/{run_id}/cancel"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/runs/{run_id}/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.example.com/v1/runs/{run_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/v1/runs/{run_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/runs/{run_id}/cancel")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/runs/{run_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"run_id": "<string>",
"namespace": "<string>",
"app_name": "<string>",
"app_version": "<string>",
"build_id": "<string>",
"run_kind": "<string>",
"state": {},
"input": {},
"progress": {
"done": 123,
"total": 123,
"status_text": "<string>"
},
"dataset_id": "<string>",
"partial": true,
"cancel_requested": true,
"triggered_by": "<string>",
"upstream_ref": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"first_started_at": "<string>",
"finished_at": "<string>",
"usage": {
"metrics": {},
"duration_ms": 123
},
"billing": {
"events": [
{
"event": "<string>",
"label": "<string>",
"qty": 123,
"unit_price": 123,
"amount": 123,
"unit_size": 123,
"raw_qty": 123
}
],
"total": 123,
"currency": "<string>",
"charged": true
},
"error": {
"code": "<string>",
"category": "<string>",
"message": "<string>",
"retryable": true,
"retry_after": 123,
"item_index": 123,
"details": [
{}
]
},
"sample_records": [
{}
],
"warnings": [
{
"code": "<string>",
"event": "<string>",
"detail": {},
"count": 123,
"updated_at": "<string>"
}
]
}POST https://api-datahub.octoparse.com/v1/runs/{run_id}/cancel
인증: API 키 필요(Authorization: Bearer <API Key>).
취소 신호를 보내고 실행기 응답을 짧게(최대 5초) 기다린 뒤 현재 실행 객체를 반환. 큐 중이면 즉시 중지. 실행 중은 보통 수 초 내 협조 중지하나 최종 상태는 실행 조회로 확인.
소유권은 실행 상세와 같음: 본인 시작 실행만 취소 가능. 취소 후 종료는 실행 조회로 확인.
요청
경로 파라미터
string
필수
실행 id.
요청 예시
curl -X POST \
-H "Authorization: Bearer $OCTOPARSE_API_KEY" \
"https://api-datahub.octoparse.com/v1/runs/run_c62bc0fb8df2/cancel"
응답
200 성공
{
"data": {
"run_id": "run_c62bc0fb8df2",
"namespace": "carol",
"app_name": "probe-b",
"app_version": "0.1.0",
"build_id": null,
"run_kind": "production",
"state": "SUCCEEDED",
"input": {
"product": "p-now"
},
"progress": {
"done": 20,
"total": null,
"status_text": null
},
"dataset_id": "ds_0bd5345d13d0",
"partial": false,
"cancel_requested": false,
"triggered_by": "api",
"upstream_ref": null,
"created_at": "2026-09-15T07:45:40.411993+00:00",
"started_at": "2026-09-15T07:45:40.419610+00:00",
"first_started_at": "2026-09-15T07:45:40.419610+00:00",
"finished_at": "2026-09-15T07:45:40.822250+00:00",
"usage": {
"metrics": {
"records_collected": 20
},
"duration_ms": 402
},
"billing": {
"events": [
{
"event": "record",
"label": "One record",
"qty": 20.0,
"unit_price": 0.001,
"amount": 0.02,
"unit_size": null,
"raw_qty": null
}
],
"total": 0.02,
"currency": "USD",
"charged": true
},
"error": null,
"sample_records": null,
"warnings": []
}
}
data로 감쌉니다. 필드:
string
필수
—
string
—
string
—
string
—
string
—
string
—
enum
필수
값:
PENDING / QUEUED / RUNNING / SUCCEEDED / PARTIALLY_SUCCEEDED / FAILED / CANCELLED / EXPIRED.object
—
string
—
boolean
—
boolean
취소 요청 후 정리 중이면
true(협조 중지/부분 결과 회수). 종료 시 항상 false(서버 정규화). state에서 유도 불필요.string
—
string
—
string
—
string
—
string
워커가 처음 실행을 가져온 시각.
started_at과 달리 재시도에 덮어쓰지 않아 벽시계 기준: queued = first_started_at - created_at, 총 벽시간 = finished_at - first_started_at. started_at으로 queued를 구하면 이전 시도를 대기로 오산. 미할당만 null.string
—
object
object[]
—
오류
| HTTP | code | category | 설명 |
|---|---|---|---|
| 401 | unauthorized | forbidden | API 키 누락 또는 무효. |
| 404 | run-not-found | not_found | 실행 없거나 현재 계정 시작 아님. |
| 409 | run-terminal | invalid_input | 실행 이미 종료, 취소 불가. |
{"error": {code, category, message, retryable}}입니다. 오류 참고.
클라이언트 라이브러리
run = client.cancel("run_c62bc0fb8df2")
print(run["state"], run["partial"])
const run = await client.cancel("run_c62bc0fb8df2");
console.log(run.state, run.partial);