/// <summary> /// Retrieves all items from the Job-Queue. /// </summary> /// <exception cref="JenkinsNetException"></exception> public JenkinsQueueItem[] GetAllItems() { try { var cmd = new QueueItemListCommand(context); cmd.Run(); return(cmd.Result); } catch (Exception error) { throw new JenkinsNetException("Failed to retrieve queue item list!", error); } }
/// <summary> /// Retrieves all items from the Job-Queue asynchronously. /// </summary> /// <param name="token">An optional token for aborting the request.</param> /// <exception cref="JenkinsNetException"></exception> public async Task <JenkinsQueueItem[]> GetAllItemsAsync(CancellationToken token = default) { try { var cmd = new QueueItemListCommand(context); await cmd.RunAsync(token); return(cmd.Result); } catch (Exception error) { throw new JenkinsNetException("Failed to retrieve queue item list!", error); } }