/// <summary> /// Gets a Job configuration from Jenkins asynchronously. /// </summary> /// <param name="jobName">The Name of the Job to retrieve.</param> /// <param name="token">An optional token for aborting the request.</param> /// <exception cref="JenkinsNetException"></exception> public async Task<JenkinsProject> GetConfigurationAsync(string jobName, CancellationToken token = default(CancellationToken)) { try { var cmd = new JobGetConfigCommand(context, jobName); await cmd.RunAsync(token); return cmd.Result; } catch (Exception error) { throw new JenkinsNetException($"Failed to get Jenkins Job Configuration '{jobName}'!", error); } }
/// <summary> /// Gets a Job configuration from Jenkins. /// </summary> /// <param name="jobName">The Name of the Job to retrieve.</param> /// <exception cref="JenkinsNetException"></exception> public JenkinsProject GetConfiguration(string jobName) { try { var cmd = new JobGetConfigCommand(context, jobName); cmd.Run(); return cmd.Result; } catch (Exception error) { throw new JenkinsNetException($"Failed to get Jenkins Job Configuration '{jobName}'!", error); } }