-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
603 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
{ | ||
"parameters": {}, | ||
"definitions": { | ||
"Job": { | ||
"properties": { | ||
"cmd": { | ||
"type": "string" | ||
}, | ||
"max_restart_count": { | ||
"format": "int32", | ||
"type": "integer" | ||
}, | ||
"cvmfs_mounts": { | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"experiment": { | ||
"type": "string" | ||
}, | ||
"restart_count": { | ||
"format": "int32", | ||
"type": "integer" | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"docker_img": { | ||
"type": "string" | ||
}, | ||
"job_id": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"cmd", | ||
"cvmfs_mounts", | ||
"docker_img", | ||
"experiment", | ||
"job_id", | ||
"max_restart_count", | ||
"restart_count", | ||
"status" | ||
], | ||
"type": "object" | ||
}, | ||
"JobRequest": { | ||
"properties": { | ||
"env_vars": { | ||
"type": "object" | ||
}, | ||
"cmd": { | ||
"type": "string" | ||
}, | ||
"experiment": { | ||
"type": "string" | ||
}, | ||
"shared_file_system": { | ||
"type": "boolean" | ||
}, | ||
"cvmfs_mounts": { | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"docker_img": { | ||
"type": "string" | ||
}, | ||
"job_id": { | ||
"format": "uuid", | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"docker_img", | ||
"experiment" | ||
], | ||
"type": "object" | ||
} | ||
}, | ||
"tags": [], | ||
"swagger": "2.0", | ||
"paths": { | ||
"/jobs": { | ||
"get": { | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"examples": { | ||
"application/json": { | ||
"jobs": { | ||
"2e4bbc1d-db5e-4ee0-9701-6e2b1ba55c20": { | ||
"cmd": "sleep 1000", | ||
"max_restart_count": 3, | ||
"restart_count": 0, | ||
"cvmfs_mounts": [ | ||
"atlas-condb", | ||
"atlas" | ||
], | ||
"experiment": "atlas", | ||
"docker_img": "busybox", | ||
"job_id": "2e4bbc1d-db5e-4ee0-9701-6e2b1ba55c20", | ||
"status": "started" | ||
}, | ||
"1612a779-f3fa-4344-8819-3d12fa9b9d90": { | ||
"cmd": "sleep 1000", | ||
"max_restart_count": 3, | ||
"restart_count": 0, | ||
"cvmfs_mounts": [ | ||
"atlas-condb", | ||
"atlas" | ||
], | ||
"experiment": "atlas", | ||
"docker_img": "busybox", | ||
"job_id": "1612a779-f3fa-4344-8819-3d12fa9b9d90", | ||
"status": "succeeded" | ||
} | ||
} | ||
} | ||
}, | ||
"schema": { | ||
"items": { | ||
"$ref": "#/definitions/Job" | ||
}, | ||
"type": "array" | ||
}, | ||
"description": "Job list." | ||
} | ||
}, | ||
"description": "Get all Jobs" | ||
}, | ||
"post": { | ||
"operationId": "create_job", | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"400": { | ||
"description": "Invalid request - probably malformed JSON" | ||
}, | ||
"201": { | ||
"examples": { | ||
"application/json": { | ||
"job_id": "cdcf48b1-c2f3-4693-8230-b066e088c6ac" | ||
} | ||
}, | ||
"schema": { | ||
"properties": { | ||
"job_id": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"description": "The Job has been created." | ||
}, | ||
"500": { | ||
"description": "Internal error - probably the job could not be allocated" | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"required": true, | ||
"in": "body", | ||
"schema": { | ||
"$ref": "#/definitions/JobRequest" | ||
}, | ||
"name": "job", | ||
"description": "Information needed to instantiate a Job" | ||
} | ||
], | ||
"summary": "This resource is expecting JSON data with all the necessary\ninformation of a new job.", | ||
"description": "Create a new Job.", | ||
"consumes": [ | ||
"application/json" | ||
] | ||
} | ||
}, | ||
"/jobs/{job_id}": { | ||
"get": { | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"examples": { | ||
"application/json": { | ||
"job": { | ||
"cmd": "sleep 1000", | ||
"max_restart_count": 3, | ||
"restart_count": 0, | ||
"cvmfs_mounts": [ | ||
"atlas-condb", | ||
"atlas" | ||
], | ||
"experiment": "atlas", | ||
"docker_img": "busybox", | ||
"job_id": "cdcf48b1-c2f3-4693-8230-b066e088c6ac", | ||
"status": "started" | ||
} | ||
} | ||
}, | ||
"schema": { | ||
"$ref": "#/definitions/Job" | ||
}, | ||
"description": "The Job." | ||
}, | ||
"404": { | ||
"description": "The Job does not exist." | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"required": true, | ||
"name": "job_id", | ||
"description": "ID of the Job", | ||
"type": "string" | ||
} | ||
], | ||
"description": "Get a Job by its id" | ||
} | ||
} | ||
}, | ||
"info": { | ||
"title": "reana-job-controller", | ||
"description": "REANA Job Controller API", | ||
"version": "0.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,4 @@ | ||
REST API | ||
======== | ||
|
||
GET /jobs | ||
--------- | ||
|
||
.. autofunction:: reana_job_controller.app.get_jobs | ||
|
||
POST /jobs | ||
---------- | ||
|
||
.. autofunction:: reana_job_controller.app.create_job | ||
|
||
GET /jobs/<job_id> | ||
------------------ | ||
|
||
.. autofunction:: reana_job_controller.app.get_job | ||
.. openapi:: openapi.json |
Oops, something went wrong.