Add job-template-create to CLI

Change-Id: I7d4bd5175efb36e85b2ba56e43f75fdc61f992c4
This commit is contained in:
Matthew Farrellee
2014-01-27 15:49:06 -05:00
parent bac7042551
commit 8abdb23f90

View File

@@ -637,10 +637,11 @@ def do_job_binary_delete(cs, args):
#
# job-template-show --name <name>|--id <id>
#
# TODO(mattf): job-template-create --name <name>
# --type <Pig|Hive|Jar>
# --mains <array of string>
# --libs <array of string>
# job-template-create --name <name>
# --type <Pig|Hive|MapReduce|Java|...>
# [--mains <array of string>]
# [--libs <array of string>]
# [--description <desc>]
#
# job-template-delete --name <name>|--id <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')