diff --git a/savannaclient/api/shell.py b/savannaclient/api/shell.py index b903ca0e..063501ce 100644 --- a/savannaclient/api/shell.py +++ b/savannaclient/api/shell.py @@ -637,10 +637,11 @@ def do_job_binary_delete(cs, args): # # job-template-show --name |--id # -# TODO(mattf): job-template-create --name -# --type -# --mains -# --libs +# job-template-create --name +# --type +# [--mains ] +# [--libs ] +# [--description ] # # job-template-delete --name |--id # @@ -661,6 +662,30 @@ def do_job_template_show(cs, args): _show_job_template(cs.jobs.get(args.id)) +@utils.arg('--name', + required=True, + help='Name of the job template') +@utils.arg('--type', + required=True, + help='Type of the job template') +@utils.arg('--main', + action='append', + default=[], + help='Id for job\'s main job-binary') +@utils.arg('--lib', + action='append', + default=[], + help='Id of job\'s lib job-binary, repeatable') +@utils.arg('--description', + default='', + help='Description of the job template') +def do_job_template_create(cs, args): + """Create a job template.""" + _show_job_template(cs.jobs.create(args.name, args.type, + args.main, args.lib, + args.description)) + + @utils.arg('--id', required=True, help='Id of a job template')