public JobRepositoryTests()
 {
     sandbox = new FileSandbox(new EmptyFileLocator());
     repository = JobRepositoryFactory.Create(with =>
     {
         with.Location = sandbox.Directory;
     });
 }
Exemple #2
0
        public JobsModule(JobRepository jobs, JobExecutionRepository executions)
            : base("/api/jobs")
        {
            this.jobs = jobs;
            this.executions = executions;

            Get["/"] = parameters => HandleGetAllJobs();
            Post["/"] = parameters => HandlePostJob(this.Bind<DynamicDictionary>());
            Get["/{job}"] = parameters => HandleGetJob(parameters.job);
            Patch["/{job}"] = parameters => HttpStatusCode.OK;
            Delete["/{job}"] = parameters => HttpStatusCode.OK;

            Get["/{job}/versions"] = parameters => HttpStatusCode.OK;
            Get["/{job}/versions/{version}"] = parameters => HttpStatusCode.OK;
            Delete["/{job}/versions/{version}"] = parameters => HttpStatusCode.OK;

            Get["/{job}/schedule"] = parameters => HttpStatusCode.OK;
            Patch["/{job}/schedule"] = parameters => HttpStatusCode.OK;

            Get["/{job}/executions"] = parameters => HttpStatusCode.OK;
            Get["/{job}/executions/newest"] = parameters => HttpStatusCode.OK;
            Get["/{job}/executions/{execution}"] = parameters => HttpStatusCode.OK;
        }