Creates a new job and initialises it with the default cxml file which must be modified before launch.
@param jobname name of the new job
@return engine state and a list of registered jobs
358429
public EngineResult createNewJob(String jobname) {
        HttpPost postRequest = new HttpPost(baseUrl);
        List<NameValuePair> nvp = new LinkedList<NameValuePair>();
        nvp.add(new BasicNameValuePair("action", "create"));
        nvp.add(new BasicNameValuePair("createpath", jobname));
        StringEntity postEntity = null;
        try {
            postEntity = new UrlEncodedFormEntity(nvp);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        postEntity.setContentType("application/x-www-form-urlencoded");
        postRequest.addHeader("Accept", "application/xml");
        postRequest.setEntity(postEntity);
        return engineResult(postRequest);
    }
693814
public static DefaultJobSpecScheduleImpl createImmediateSchedule(JobSpec jobSpec,
                                                                   Runnable jobRunnable) {
    return new DefaultJobSpecScheduleImpl(jobSpec, jobRunnable,
                                          Optional.of(System.currentTimeMillis()));
  }
1152658
public void setJobName (final String jobName)
  {
    if (jobName == null || jobName.trim ().length () == 0)
    {
      throw new IllegalArgumentException ("Job name cannot be null or empty.");
    }

    m_sJobName = jobName;
  }
215022
public FsJob read(String jobname) throws IOException {
        return FsJobParser.fromJson(readFile(jobname, FILENAME));
    }
797506
public static StepExecutionItem createJobRef(
            final String jobIdentifier,
            final String[] args,
            final boolean nodeStep,
            final StepExecutionItem handler,
            final boolean keepgoingOnSuccess,
            final String nodeFilter,
            final Integer nodeThreadcount,
            final Boolean nodeKeepgoing,
            final String nodeRankAttribute,
            final Boolean nodeRankOrderAscending,
            final String label,
            final Boolean nodeIntersect,
            final String project,
            final Boolean failOnDisable,
            final Boolean importOptions,
            final String uuid,
            final Boolean useName
    )
    {

        return new JobReferenceItem(
                label,
                jobIdentifier,
                args,
                nodeStep,
                handler,
                keepgoingOnSuccess,
                nodeKeepgoing,
                nodeFilter,
                nodeThreadcount,
                nodeRankAttribute,
                nodeRankOrderAscending,
                nodeIntersect,
                project,
                failOnDisable,
                importOptions,
                uuid,
                useName
        );
    }
904935
public static JobMetrics get(String jobName, String jobId) {
    return get(new JobState(jobName, jobId));
  }
134411
private static JobConf createJobConf(Configuration conf) {
    JobConf jobconf = new JobConf(conf, DistRaid.class);
    jobName = NAME + " " + dateForm.format(new Date(RaidNode.now()));
    jobconf.setUser(RaidNode.JOBUSER);
    jobconf.setJobName(jobName);
    jobconf.setMapSpeculativeExecution(false);
    RaidUtils.parseAndSetOptions(jobconf, SCHEDULER_OPTION_LABEL);

    jobconf.setJarByClass(DistRaid.class);
    jobconf.setInputFormat(DistRaidInputFormat.class);
    jobconf.setOutputKeyClass(Text.class);
    jobconf.setOutputValueClass(Text.class);

    jobconf.setMapperClass(DistRaidMapper.class);
    jobconf.setNumReduceTasks(0);
    return jobconf;
  }
1066811
public int run(String jobName, String[] args) {
        int status = -1;

        try {
            Class<? extends SimpleJobTool> clazz = jobMap.get(jobName);
            if (clazz == null) {
                log.error("Tool " + jobName + " class not found.");
                return status;
            }
            status =  ToolRunner.run(clazz.newInstance(), args);
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e);
        }

        return status;
    }
359896
public Job getJob(String name) {
        //FIXME: Check for null of jobs? Can that happen?
        return jobs.stream()
            .map(SET_CLIENT(this.client))
            .filter(item -> item.getName().equals(name))
            .findAny()
            .orElseThrow(() -> new IllegalArgumentException("Job with name " + name + " does not exist."));
    }
1293859
@Bean
  public JobFactory<FileIngestJobExecution> fileIngestJobFactory() {
    return new JobFactory<FileIngestJobExecution>() {
      @Override
      public Job createJob(FileIngestJobExecution fileIngestJobExecution) {
        final String targetEntityId = fileIngestJobExecution.getTargetEntityId();
        final String url = fileIngestJobExecution.getUrl();
        final String loader = fileIngestJobExecution.getLoader();
        String dataExplorerURL = menuReaderService.findMenuItemPath("dataexplorer");
        fileIngestJobExecution.setResultUrl(
            format("{0}?entity={1}", dataExplorerURL, targetEntityId));
        return progress ->
            fileIngester.ingest(
                targetEntityId, url, loader, fileIngestJobExecution.getIdentifier(), progress);
      }
    };
  }
160847
synchronized public String addJob(Job aJob) {
    String id = this.getNextJobID();
    aJob.setJobID(id);
    aJob.setState(Job.WAITING);
    this.addToQueue(aJob);
    return id;	
  }
1350969
@Nonnull
  public TriggerBuilder <T> forJob (@Nonnull final IJobDetail jobDetail)
  {
    final JobKey k = jobDetail.getKey ();
    if (k.getName () == null)
      throw new IllegalArgumentException ("The given job has not yet had a name assigned to it.");
    m_aJobKey = k;
    return this;
  }
659483
public static JobContext create(AlluxioConfiguration alluxioConf) {
    JobContext context = new JobContext();
    context.init(alluxioConf);
    return context;
  }
788115
@POST
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public CreateJobResponse post(@Valid final Job job,
                                @RequestUser final String username) {
    final Job.Builder clone = job.toBuilder()
        .setCreatingUser(username)
        .setCreated(clock.now().getMillis())
        // If the job had a hash coming in, preserve it
        .setHash(job.getId().getHash());
    final Job actualJob = clone.build();
    final Collection<String> errors = jobValidator.validate(actualJob);
    final String jobIdString = actualJob.getId().toString();
    if (!errors.isEmpty()) {
      throw badRequest(new CreateJobResponse(INVALID_JOB_DEFINITION, ImmutableList.copyOf(errors),
          jobIdString));
    }
    try {
      model.addJob(actualJob);
    } catch (JobExistsException e) {
      throw badRequest(new CreateJobResponse(JOB_ALREADY_EXISTS, ImmutableList.<String>of(),
          jobIdString));
    }
    log.info("created job: {}", actualJob);
    return new CreateJobResponse(CreateJobResponse.Status.OK, ImmutableList.<String>of(),
        jobIdString);
  }
314436
public JenkinsServer updateJob(String jobName, String jobXml) throws IOException {
        return this.updateJob(jobName, jobXml, true);
    }
1341018
def add_job(self, job_name, job_id=None):
        
        logger.debug('Creating a new job named {0}'.format(job_name))
        if not self._name_is_available(job_name):
            raise DagobahError('name %s is not available' % job_name)

        if not job_id:
            job_id = self.backend.get_new_job_id()
            self.created_jobs += 1

        self.jobs.append(Job(self,
                             self.backend,
                             job_id,
                             job_name))

        job = self.get_job(job_name)
        job.commit()
222514
public Job getJob(String jobName) {
    // [START ]
    Job job = bigquery.getJob(jobName);
    if (job == null) {
      // job was not found
    }
    // [END ]
    return job;
  }