|
1392 | 1392 | "invalidJobAgent", |
1393 | 1393 | "invalidIntegration", |
1394 | 1394 | "externalRunNotFound", |
1395 | | - "successful" |
| 1395 | + "successful", |
| 1396 | + "queued" |
1396 | 1397 | ], |
1397 | 1398 | "type": "string" |
1398 | 1399 | }, |
|
6312 | 6313 | "summary": "Upsert a job agent" |
6313 | 6314 | } |
6314 | 6315 | }, |
| 6316 | + "/v1/workspaces/{workspaceId}/job-agents/{jobAgentId}/jobs": { |
| 6317 | + "get": { |
| 6318 | + "description": "Returns the jobs assigned to a job agent, optionally filtered by status.", |
| 6319 | + "operationId": "listJobAgentJobs", |
| 6320 | + "parameters": [ |
| 6321 | + { |
| 6322 | + "description": "ID of the workspace", |
| 6323 | + "in": "path", |
| 6324 | + "name": "workspaceId", |
| 6325 | + "required": true, |
| 6326 | + "schema": { |
| 6327 | + "type": "string" |
| 6328 | + } |
| 6329 | + }, |
| 6330 | + { |
| 6331 | + "description": "ID of the job agent", |
| 6332 | + "in": "path", |
| 6333 | + "name": "jobAgentId", |
| 6334 | + "required": true, |
| 6335 | + "schema": { |
| 6336 | + "type": "string" |
| 6337 | + } |
| 6338 | + }, |
| 6339 | + { |
| 6340 | + "description": "Filter jobs by status", |
| 6341 | + "in": "query", |
| 6342 | + "name": "status", |
| 6343 | + "required": false, |
| 6344 | + "schema": { |
| 6345 | + "$ref": "#/components/schemas/JobStatus" |
| 6346 | + } |
| 6347 | + }, |
| 6348 | + { |
| 6349 | + "description": "Include the dispatch context on each job. It can be large, so it is omitted by default.", |
| 6350 | + "in": "query", |
| 6351 | + "name": "includeDispatchContext", |
| 6352 | + "required": false, |
| 6353 | + "schema": { |
| 6354 | + "default": false, |
| 6355 | + "type": "boolean" |
| 6356 | + } |
| 6357 | + }, |
| 6358 | + { |
| 6359 | + "description": "Maximum number of items to return", |
| 6360 | + "in": "query", |
| 6361 | + "name": "limit", |
| 6362 | + "required": false, |
| 6363 | + "schema": { |
| 6364 | + "default": 50, |
| 6365 | + "maximum": 1000, |
| 6366 | + "minimum": 1, |
| 6367 | + "type": "integer" |
| 6368 | + } |
| 6369 | + }, |
| 6370 | + { |
| 6371 | + "description": "Number of items to skip", |
| 6372 | + "in": "query", |
| 6373 | + "name": "offset", |
| 6374 | + "required": false, |
| 6375 | + "schema": { |
| 6376 | + "default": 0, |
| 6377 | + "minimum": 0, |
| 6378 | + "type": "integer" |
| 6379 | + } |
| 6380 | + } |
| 6381 | + ], |
| 6382 | + "responses": { |
| 6383 | + "200": { |
| 6384 | + "content": { |
| 6385 | + "application/json": { |
| 6386 | + "schema": { |
| 6387 | + "properties": { |
| 6388 | + "items": { |
| 6389 | + "items": { |
| 6390 | + "$ref": "#/components/schemas/Job" |
| 6391 | + }, |
| 6392 | + "type": "array" |
| 6393 | + }, |
| 6394 | + "limit": { |
| 6395 | + "description": "Maximum number of items returned", |
| 6396 | + "type": "integer" |
| 6397 | + }, |
| 6398 | + "offset": { |
| 6399 | + "description": "Number of items skipped", |
| 6400 | + "type": "integer" |
| 6401 | + }, |
| 6402 | + "total": { |
| 6403 | + "description": "Total number of items available", |
| 6404 | + "type": "integer" |
| 6405 | + } |
| 6406 | + }, |
| 6407 | + "required": [ |
| 6408 | + "items", |
| 6409 | + "total", |
| 6410 | + "limit", |
| 6411 | + "offset" |
| 6412 | + ], |
| 6413 | + "type": "object" |
| 6414 | + } |
| 6415 | + } |
| 6416 | + }, |
| 6417 | + "description": "Paginated list of items" |
| 6418 | + }, |
| 6419 | + "400": { |
| 6420 | + "content": { |
| 6421 | + "application/json": { |
| 6422 | + "schema": { |
| 6423 | + "$ref": "#/components/schemas/ErrorResponse" |
| 6424 | + } |
| 6425 | + } |
| 6426 | + }, |
| 6427 | + "description": "Invalid request" |
| 6428 | + }, |
| 6429 | + "404": { |
| 6430 | + "content": { |
| 6431 | + "application/json": { |
| 6432 | + "schema": { |
| 6433 | + "$ref": "#/components/schemas/ErrorResponse" |
| 6434 | + } |
| 6435 | + } |
| 6436 | + }, |
| 6437 | + "description": "Resource not found" |
| 6438 | + } |
| 6439 | + }, |
| 6440 | + "summary": "List jobs for a job agent" |
| 6441 | + } |
| 6442 | + }, |
| 6443 | + "/v1/workspaces/{workspaceId}/job-agents/{jobAgentId}/jobs/{jobId}/claim": { |
| 6444 | + "post": { |
| 6445 | + "description": "Atomically claims a queued job for the job agent, transitioning it to in progress. Returns 409 if the job is no longer available to claim.", |
| 6446 | + "operationId": "claimJob", |
| 6447 | + "parameters": [ |
| 6448 | + { |
| 6449 | + "description": "ID of the workspace", |
| 6450 | + "in": "path", |
| 6451 | + "name": "workspaceId", |
| 6452 | + "required": true, |
| 6453 | + "schema": { |
| 6454 | + "type": "string" |
| 6455 | + } |
| 6456 | + }, |
| 6457 | + { |
| 6458 | + "description": "ID of the job agent", |
| 6459 | + "in": "path", |
| 6460 | + "name": "jobAgentId", |
| 6461 | + "required": true, |
| 6462 | + "schema": { |
| 6463 | + "type": "string" |
| 6464 | + } |
| 6465 | + }, |
| 6466 | + { |
| 6467 | + "description": "ID of the job", |
| 6468 | + "in": "path", |
| 6469 | + "name": "jobId", |
| 6470 | + "required": true, |
| 6471 | + "schema": { |
| 6472 | + "type": "string" |
| 6473 | + } |
| 6474 | + } |
| 6475 | + ], |
| 6476 | + "responses": { |
| 6477 | + "200": { |
| 6478 | + "content": { |
| 6479 | + "application/json": { |
| 6480 | + "schema": { |
| 6481 | + "$ref": "#/components/schemas/Job" |
| 6482 | + } |
| 6483 | + } |
| 6484 | + }, |
| 6485 | + "description": "Job claimed" |
| 6486 | + }, |
| 6487 | + "400": { |
| 6488 | + "content": { |
| 6489 | + "application/json": { |
| 6490 | + "schema": { |
| 6491 | + "$ref": "#/components/schemas/ErrorResponse" |
| 6492 | + } |
| 6493 | + } |
| 6494 | + }, |
| 6495 | + "description": "Invalid request" |
| 6496 | + }, |
| 6497 | + "404": { |
| 6498 | + "content": { |
| 6499 | + "application/json": { |
| 6500 | + "schema": { |
| 6501 | + "$ref": "#/components/schemas/ErrorResponse" |
| 6502 | + } |
| 6503 | + } |
| 6504 | + }, |
| 6505 | + "description": "Resource not found" |
| 6506 | + }, |
| 6507 | + "409": { |
| 6508 | + "content": { |
| 6509 | + "application/json": { |
| 6510 | + "schema": { |
| 6511 | + "$ref": "#/components/schemas/ErrorResponse" |
| 6512 | + } |
| 6513 | + } |
| 6514 | + }, |
| 6515 | + "description": "Job is not available to claim" |
| 6516 | + } |
| 6517 | + }, |
| 6518 | + "summary": "Claim a job" |
| 6519 | + } |
| 6520 | + }, |
6315 | 6521 | "/v1/workspaces/{workspaceId}/jobs": { |
6316 | 6522 | "get": { |
6317 | 6523 | "description": "Returns a list of jobs.", |
|
0 commit comments