Skip to content

Commit

Permalink
Add support for specifying tags in a job
Browse files Browse the repository at this point in the history
  • Loading branch information
plars committed Jan 25, 2024
1 parent ffdf3b7 commit c376630
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/reference/job-schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The following table lists the key elements that a job definition file should con
- String
- /
- Name of the job queue to which you want to submit the job. This field is mandatory.
* - ``tags``
- List of strings
- /
- | (Optional) List of tags that you want to associate with the job.
| Tags can be used to search for jobs with the search API.
* - ``global_timeout``
- integer
- | 14400
Expand Down
1 change: 1 addition & 0 deletions server/src/api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Job(Schema):
job_id = fields.String(required=False)
parent_job_id = fields.String(required=False)
name = fields.String(required=False)
tags = fields.List(fields.String(), required=False)
job_queue = fields.String(required=True)
global_timeout = fields.Integer(required=False)
output_timeout = fields.Integer(required=False)
Expand Down
2 changes: 1 addition & 1 deletion server/tests/test_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_home(mongo_app):

def test_add_job_good(mongo_app):
"""Test that adding a new job works"""
job_data = {"job_queue": "test"}
job_data = {"job_queue": "test", "tags": ["foo", "bar"]}
# Place a job on the queue
app, _ = mongo_app
output = app.post("/v1/job", json=job_data)
Expand Down

0 comments on commit c376630

Please sign in to comment.