Skip to content

Commit

Permalink
api: add job_name and prettified_cmd to create_job
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodriguez committed Jul 27, 2018
1 parent 3b207e3 commit 501c2a7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,25 @@
"format": "uuid",
"type": "string"
},
"job_name": {
"type": "string"
},
"job_type": {
"type": "string"
},
"prettified_cmd": {
"default": "",
"type": "string"
},
"shared_file_system": {
"default": true,
"type": "boolean"
}
},
"required": [
"docker_img",
"experiment"
"experiment",
"job_name"
],
"type": "object"
}
Expand Down
4 changes: 3 additions & 1 deletion reana_job_controller/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ def create_job(): # noqa
env_vars=json.dumps(job_request['env_vars']),
restart_count=job['restart_count'],
max_restart_count=job['max_restart_count'],
deleted=job['deleted'])
deleted=job['deleted'],
name=job_request['job_name'],
prettified_cmd=job_request['prettified_cmd'])
Session.add(job_db_entry)
Session.commit()
access_times = calculate_file_access_time(
Expand Down
2 changes: 2 additions & 0 deletions reana_job_controller/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class JobRequest(Schema):
"""Job request model."""

job_id = fields.UUID()
job_name = fields.Str(required=True)
cmd = fields.Str(missing='')
prettified_cmd = fields.Str(missing='')
docker_img = fields.Str(required=True)
experiment = fields.Str(required=True)
cvmfs_mounts = fields.List(fields.String(), missing=[])
Expand Down

0 comments on commit 501c2a7

Please sign in to comment.