Submit Job
Submit a job for background execution; returns immediately after acceptance.
POST
/
jobs
/
submit
cURL
curl --request POST \
--url http://127.0.0.1:{port}/jobs/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"job": {
"job_name": "hello-world",
"tasks": [
{
"name": "hello-world/hello-world"
}
],
"agents": [
{
"name": "oracle"
}
],
"environment": {
"type": "docker"
}
}
}
'from harbor import Harbor
client = Harbor()
result = client.submit_job(job={'job_name': 'hello-world',
'tasks': [{'name': 'hello-world/hello-world'}],
'agents': [{'name': 'oracle'}],
'environment': {'type': 'docker'}})
print(result)
client.close()
{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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
Required string length:
1 - 200Body
application/json
⌘I
cURL
curl --request POST \
--url http://127.0.0.1:{port}/jobs/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"job": {
"job_name": "hello-world",
"tasks": [
{
"name": "hello-world/hello-world"
}
],
"agents": [
{
"name": "oracle"
}
],
"environment": {
"type": "docker"
}
}
}
'from harbor import Harbor
client = Harbor()
result = client.submit_job(job={'job_name': 'hello-world',
'tasks': [{'name': 'hello-world/hello-world'}],
'agents': [{'name': 'oracle'}],
'environment': {'type': 'docker'}})
print(result)
client.close()
{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}
