Cancel Job
Cancel a job. Set soft=true to let running rollouts finish.
POST
/
jobs
/
{job_id}
/
cancel
cURL
curl --request POST \
--url http://127.0.0.1:{port}/jobs/{job_id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"soft": false
}'from harbor import Harbor
client = Harbor()
result = client.cancel_job("JOB_ID", soft=True)
print(result)
client.close()
{
"job": {
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"state": "queued",
"rollouts": {
"n_total": 1,
"n_queued": 0,
"n_running": 0,
"n_paused": 0,
"n_cancelling": 0,
"n_cancelled": 0,
"n_finished": 0
},
"n_retries": 0,
"n_errors": 0,
"agent_names": [
"<string>"
],
"model_names": [
"<string>"
],
"model_providers": [
"<string>"
],
"reasoning_efforts": [
"<string>"
],
"sources": [
"<string>"
],
"rewards": {},
"usage": {
"n_input_tokens": {
"sum": 123,
"count": 0
},
"n_cached_input_tokens": {
"sum": 123,
"count": 0
},
"n_output_tokens": {
"sum": 123,
"count": 0
},
"cost_usd": {
"sum": 123,
"count": 0
}
},
"lock_uri": "<string>",
"config": {
"job_name": "<string>",
"jobs_dir": "jobs",
"n_attempts": 1,
"install_only": false,
"skip_credential_checks": false,
"timeout_multiplier": 1,
"agent_timeout_multiplier": 123,
"verifier_timeout_multiplier": 123,
"agent_setup_timeout_multiplier": 123,
"environment_build_timeout_multiplier": 123,
"debug": false,
"n_concurrent_trials": 4,
"quiet": false,
"retry": {
"max_retries": 0,
"include_exceptions": [
"<string>"
],
"exclude_exceptions": [
"<string>"
],
"wait_multiplier": 1,
"min_wait_sec": 1,
"max_wait_sec": 60
},
"override_error_policy": {},
"environment": {
"type": "docker",
"import_path": "<string>",
"force_build": false,
"delete": true,
"stream": false,
"cpu_enforcement_policy": "auto",
"memory_enforcement_policy": "auto",
"override_cpus": 123,
"override_memory_mb": 123,
"override_storage_mb": 123,
"override_gpus": 123,
"override_tpu": {
"type": "<string>",
"topology": "<string>"
},
"mounts": [
{
"type": "bind",
"source": "<string>",
"target": "<string>",
"read_only": true,
"bind": {
"create_host_path": false,
"selinux": "z"
},
"volume": {
"subpath": "<string>"
},
"image": {
"subpath": "<string>"
}
}
],
"extra_docker_compose": [
"<string>"
],
"env": {},
"kwargs": {},
"extra_allowed_hosts": [
"<string>"
]
},
"verifier": {
"override_timeout_sec": 123,
"max_timeout_sec": 123,
"include_logs": [
"<string>"
],
"exclude_logs": [
"<string>"
],
"env": {},
"import_path": "<string>",
"kwargs": {},
"disable": false,
"extra_allowed_hosts": [
"<string>"
]
},
"metrics": [
{
"type": "mean",
"kwargs": {}
}
],
"agents": [
{
"name": "<string>",
"import_path": "<string>",
"model_name": "<string>",
"base_url": "<string>",
"model_api_key_name": "<string>",
"model_api_format": "openai_chat_completions",
"skip_model_parsing": false,
"n_concurrent": 2,
"concurrency_group": "<string>",
"skills": [
"<string>"
],
"override_timeout_sec": 123,
"override_setup_timeout_sec": 123,
"max_timeout_sec": 123,
"resume_trajectory": false,
"load_trajectory": "<string>",
"extra_allowed_hosts": [
"<string>"
],
"include_logs": [
"<string>"
],
"exclude_logs": [
"<string>"
],
"kwargs": {},
"env": {},
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"headers": {}
}
]
}
],
"user_agent": {
"bridge": {
"kind": "acp",
"prompt_path": "<string>",
"kwargs": {}
},
"name": "<string>",
"import_path": "<string>",
"model_name": "<string>",
"base_url": "<string>",
"model_api_key_name": "<string>",
"model_api_format": "openai_chat_completions",
"skip_model_parsing": false,
"n_concurrent": 2,
"concurrency_group": "<string>",
"skills": [
"<string>"
],
"override_timeout_sec": 123,
"override_setup_timeout_sec": 123,
"max_timeout_sec": 123,
"resume_trajectory": false,
"load_trajectory": "<string>",
"extra_allowed_hosts": [
"<string>"
],
"include_logs": [
"<string>"
],
"exclude_logs": [
"<string>"
],
"kwargs": {},
"env": {},
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"headers": {}
}
],
"user_persona_path": "<string>",
"user_prompt_template_path": "<string>"
},
"datasets": [
{
"path": "<string>",
"name": "<string>",
"version": "<string>",
"ref": "<string>",
"registry_url": "<string>",
"registry_path": "<string>",
"repo": "<string>",
"overwrite": false,
"download_dir": "<string>",
"task_names": [
"<string>"
],
"exclude_task_names": [
"<string>"
],
"n_tasks": 123
}
],
"tasks": [
{
"path": "<string>",
"git_url": "<string>",
"git_commit_id": "<string>",
"name": "<string>",
"ref": "<string>",
"overwrite": false,
"download_dir": "<string>",
"source": "<string>"
}
],
"artifacts": [
"<string>"
],
"extra_instruction_paths": [
"<string>"
],
"extra_instructions": [
"<string>"
],
"source_jobs": [
{
"action": "regrade",
"type": "local",
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "<string>"
}
]
},
"session_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Required only when the server has HARBOR_API_KEY configured.
Headers
Path Parameters
Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
⌘I
cURL
curl --request POST \
--url http://127.0.0.1:{port}/jobs/{job_id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"soft": false
}'from harbor import Harbor
client = Harbor()
result = client.cancel_job("JOB_ID", soft=True)
print(result)
client.close()
{
"job": {
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"state": "queued",
"rollouts": {
"n_total": 1,
"n_queued": 0,
"n_running": 0,
"n_paused": 0,
"n_cancelling": 0,
"n_cancelled": 0,
"n_finished": 0
},
"n_retries": 0,
"n_errors": 0,
"agent_names": [
"<string>"
],
"model_names": [
"<string>"
],
"model_providers": [
"<string>"
],
"reasoning_efforts": [
"<string>"
],
"sources": [
"<string>"
],
"rewards": {},
"usage": {
"n_input_tokens": {
"sum": 123,
"count": 0
},
"n_cached_input_tokens": {
"sum": 123,
"count": 0
},
"n_output_tokens": {
"sum": 123,
"count": 0
},
"cost_usd": {
"sum": 123,
"count": 0
}
},
"lock_uri": "<string>",
"config": {
"job_name": "<string>",
"jobs_dir": "jobs",
"n_attempts": 1,
"install_only": false,
"skip_credential_checks": false,
"timeout_multiplier": 1,
"agent_timeout_multiplier": 123,
"verifier_timeout_multiplier": 123,
"agent_setup_timeout_multiplier": 123,
"environment_build_timeout_multiplier": 123,
"debug": false,
"n_concurrent_trials": 4,
"quiet": false,
"retry": {
"max_retries": 0,
"include_exceptions": [
"<string>"
],
"exclude_exceptions": [
"<string>"
],
"wait_multiplier": 1,
"min_wait_sec": 1,
"max_wait_sec": 60
},
"override_error_policy": {},
"environment": {
"type": "docker",
"import_path": "<string>",
"force_build": false,
"delete": true,
"stream": false,
"cpu_enforcement_policy": "auto",
"memory_enforcement_policy": "auto",
"override_cpus": 123,
"override_memory_mb": 123,
"override_storage_mb": 123,
"override_gpus": 123,
"override_tpu": {
"type": "<string>",
"topology": "<string>"
},
"mounts": [
{
"type": "bind",
"source": "<string>",
"target": "<string>",
"read_only": true,
"bind": {
"create_host_path": false,
"selinux": "z"
},
"volume": {
"subpath": "<string>"
},
"image": {
"subpath": "<string>"
}
}
],
"extra_docker_compose": [
"<string>"
],
"env": {},
"kwargs": {},
"extra_allowed_hosts": [
"<string>"
]
},
"verifier": {
"override_timeout_sec": 123,
"max_timeout_sec": 123,
"include_logs": [
"<string>"
],
"exclude_logs": [
"<string>"
],
"env": {},
"import_path": "<string>",
"kwargs": {},
"disable": false,
"extra_allowed_hosts": [
"<string>"
]
},
"metrics": [
{
"type": "mean",
"kwargs": {}
}
],
"agents": [
{
"name": "<string>",
"import_path": "<string>",
"model_name": "<string>",
"base_url": "<string>",
"model_api_key_name": "<string>",
"model_api_format": "openai_chat_completions",
"skip_model_parsing": false,
"n_concurrent": 2,
"concurrency_group": "<string>",
"skills": [
"<string>"
],
"override_timeout_sec": 123,
"override_setup_timeout_sec": 123,
"max_timeout_sec": 123,
"resume_trajectory": false,
"load_trajectory": "<string>",
"extra_allowed_hosts": [
"<string>"
],
"include_logs": [
"<string>"
],
"exclude_logs": [
"<string>"
],
"kwargs": {},
"env": {},
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"headers": {}
}
]
}
],
"user_agent": {
"bridge": {
"kind": "acp",
"prompt_path": "<string>",
"kwargs": {}
},
"name": "<string>",
"import_path": "<string>",
"model_name": "<string>",
"base_url": "<string>",
"model_api_key_name": "<string>",
"model_api_format": "openai_chat_completions",
"skip_model_parsing": false,
"n_concurrent": 2,
"concurrency_group": "<string>",
"skills": [
"<string>"
],
"override_timeout_sec": 123,
"override_setup_timeout_sec": 123,
"max_timeout_sec": 123,
"resume_trajectory": false,
"load_trajectory": "<string>",
"extra_allowed_hosts": [
"<string>"
],
"include_logs": [
"<string>"
],
"exclude_logs": [
"<string>"
],
"kwargs": {},
"env": {},
"mcp_servers": [
{
"name": "<string>",
"transport": "sse",
"url": "<string>",
"command": "<string>",
"args": [
"<string>"
],
"headers": {}
}
],
"user_persona_path": "<string>",
"user_prompt_template_path": "<string>"
},
"datasets": [
{
"path": "<string>",
"name": "<string>",
"version": "<string>",
"ref": "<string>",
"registry_url": "<string>",
"registry_path": "<string>",
"repo": "<string>",
"overwrite": false,
"download_dir": "<string>",
"task_names": [
"<string>"
],
"exclude_task_names": [
"<string>"
],
"n_tasks": 123
}
],
"tasks": [
{
"path": "<string>",
"git_url": "<string>",
"git_commit_id": "<string>",
"name": "<string>",
"ref": "<string>",
"overwrite": false,
"download_dir": "<string>",
"source": "<string>"
}
],
"artifacts": [
"<string>"
],
"extra_instruction_paths": [
"<string>"
],
"extra_instructions": [
"<string>"
],
"source_jobs": [
{
"action": "regrade",
"type": "local",
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "<string>"
}
]
},
"session_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}
