From 9c81144533146931231c2a5648c3f4b732aecd73 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 7 Oct 2014 17:01:12 -0400 Subject: [PATCH] More documentation and validation for job relaunching/template launching --- awx/api/templates/api/job_relaunch.md | 3 +++ awx/api/templates/api/job_template_launch.md | 3 +++ awx/api/views.py | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 awx/api/templates/api/job_relaunch.md create mode 100644 awx/api/templates/api/job_template_launch.md diff --git a/awx/api/templates/api/job_relaunch.md b/awx/api/templates/api/job_relaunch.md new file mode 100644 index 0000000000..7e9ea316ce --- /dev/null +++ b/awx/api/templates/api/job_relaunch.md @@ -0,0 +1,3 @@ +Relaunch a job: + +Make a POST request to this resource to launch a job. If any passwords or variables are required then they should be passed in via POST data. In order to determine what values are required in order to launch a job based on this job template you may make a GET request to this endpoint. \ No newline at end of file diff --git a/awx/api/templates/api/job_template_launch.md b/awx/api/templates/api/job_template_launch.md new file mode 100644 index 0000000000..5167f2ec6b --- /dev/null +++ b/awx/api/templates/api/job_template_launch.md @@ -0,0 +1,3 @@ +Launch a Job Template: + +Make a POST request to this resource to launch a job. If any passwords or variables are required then they should be passed in via POST data. In order to determine what values are required in order to launch a job based on this job template you may make a GET request to this endpoint. \ No newline at end of file diff --git a/awx/api/views.py b/awx/api/views.py index ee2c21a9b7..27c41a2035 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -1468,6 +1468,8 @@ class JobTemplateSurveySpec(GenericAPIView): return Response(dict(error="'question_description' missing from survey element %s" % str(idx)), status=status.HTTP_400_BAD_REQUEST) if "variable" not in survey_item: return Response(dict(error="'variable' missing from survey element %s" % str(idx)), status=status.HTTP_400_BAD_REQUEST) + if "required" not in survey_item: + return Response(dict(error="'required' missing from survey element %s" % str(idx)), status=status.HTTP_400_BAD_REQUEST) idx += 1 obj.save() return Response()