diff --git a/lib/service.js b/lib/service.js index 299c2a022..b3767ea22 100644 --- a/lib/service.js +++ b/lib/service.js @@ -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 Pagination and Filtering options 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;