Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1704,22 +1704,29 @@
* @example
*
* var savedSearch = service.savedSearches().item("MySavedSearch");
* savedSearch.history(function(err, jobs, search) {
* savedSearch.history({count: 10}, function(err, jobs, search) {
* for(var i = 0; i < jobs.length; i++) {
* console.log("Job", i, ":", jobs[i].sid);
* }
* });
*
* @param {Object} options Options for retrieving history. For a full list, see the <a href="https://docs.splunk.com/Documentation/Splunk/8.0.2/RESTREF/RESTprolog#Pagination_and_filtering_parameters" target="_blank">Pagination and Filtering options</a> in the REST API documentation.
* @param {Function} callback A function to call when the history is retrieved: `(err, job, savedSearch)`.
*
* @endpoint saved/searches/{name}/history
* @method splunkjs.Service.SavedSearch
*/
history: function(callback) {
history: function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}

callback = callback || function() {};
options = options || {};

var that = this;
return this.get("history", {}, function(err, response) {
return this.get("history", options, function(err, response) {
if (err) {
callback(err);
return;
Expand Down