def METHOD_NAME(request):
  if request.method != 'POST':
    raise PopupException(_('POST request required.'))
  pig_script = PigScript.objects.get(id=request.POST.get('id'))
  job_id = pig_script.dict['job_id']
  job = check_job_access_permission(request, job_id)
  check_job_edition_permission(job, request.user)
  try:
    api.get(request.fs, request.jt, request.user).METHOD_NAME(job_id)
  except RestException as e:
    raise PopupException(_("Error stopping Pig script.") % e.message)
  return watch(request, job_id)