private CommandValues.GenericInfoCommandValue PrintJobInformation(QJob job) { var info = new CommandValues.GenericInfoCommandValue(); info.Uuid = job.Uuid.ToString(); info.Message = "New job created, state : " + job.State; return(info); }
public async override Task <CommandValues.GenericInfoCommandValue> Create(IConfiguration iconfig, QarnotSDK.Connection connect, CancellationToken ct) { CreateConfiguration config = iconfig as CreateConfiguration; QJob job = await this.CreateJobAsync(config, connect, ct); await this.LaunchJobAsync(job, ct); return(this.PrintJobInformation(job)); }
private async Task <QJob> CreateJobAsync(CreateConfiguration config, QarnotSDK.Connection connect, CancellationToken ct) { CLILogs.Info("create job"); QPool pool = null; if (!string.IsNullOrEmpty(config.PoolUuidOrShortname)) { pool = await connect.RetrievePoolByUuidAsync(config.PoolUuidOrShortname, ct); } QJob job = new QJob(connect, config.Name, pool, config.Shortname, config.IsDependents); if (config.MaximumWallTime.HasValue && config.MaximumWallTime.Value != default(TimeSpan)) { job.MaximumWallTime = config.MaximumWallTime.Value; } return(job); }
private async Task <QJob> LaunchJobAsync(QJob job, CancellationToken ct) { await job.SubmitAsync(cancellationToken : ct); return(job); }