Skip to content

Commit 381f8aa

Browse files
Doc string added for new methods
1 parent 5fa52e6 commit 381f8aa

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

lib/service.js

+46
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,22 @@
13971397
return req;
13981398
},
13991399

1400+
/**
1401+
* It's an asynchronous version of fetch(options, callback) function.
1402+
*
1403+
* Refreshes the resource by fetching the object from the server and
1404+
* loading it.
1405+
*
1406+
* @param {Object} options A dictionary of collection filtering and pagination options:
1407+
* - `count` (_integer_): The maximum number of items to return.
1408+
* - `offset` (_integer_): The offset of the first item to return.
1409+
* - `search` (_string_): The search query to filter responses.
1410+
* - `sort_dir` (_string_): The direction to sort returned items: “asc” or “desc”.
1411+
* - `sort_key` (_string_): The field to use for sorting (optional).
1412+
* - `sort_mode` (_string_): The collating sequence for sorting returned items: “auto”, “alpha”, “alpha_case”, or “num”.
1413+
*
1414+
* @method splunkjs.Service.Collection
1415+
*/
14001416
fetchAsync: async function(options) {
14011417
options = options || {};
14021418
if (!options.count) {
@@ -3107,6 +3123,15 @@
31073123
return req;
31083124
},
31093125

3126+
/**
3127+
* Fetch a configuration file.
3128+
*
3129+
* @param {String} file A name for configuration file.
3130+
* @return file, if exists or null
3131+
*
3132+
* @endpoint properties
3133+
* @method splunkjs.Service.Configurations
3134+
*/
31103135
getConfFile: async function(filename) {
31113136
var that = this;
31123137

@@ -3133,6 +3158,16 @@
31333158
return fetchedFile;
31343159
},
31353160

3161+
/**
3162+
* Fetch a configuration stanza.
3163+
*
3164+
* @param {String} file A configuration file.
3165+
* @param {String} stanza A configuration stanza.
3166+
* @return stanza, if exists or null
3167+
*
3168+
* @endpoint properties
3169+
* @method splunkjs.Service.Configurations
3170+
*/
31363171
getStanza: async function(file, stanza) {
31373172
// 1. check if the stanza exists
31383173
var fetchedStanza = file.item(stanza);
@@ -3145,6 +3180,17 @@
31453180
}
31463181
},
31473182

3183+
/**
3184+
* Creates/Updates a configuration file and stanza.
3185+
*
3186+
* @param {String} filename A name for this configuration file to be created/updated.
3187+
* @param {String} stanzaName A name for the stanza to be created/updated.
3188+
* @param {String} keyValueMap A key-value map of properties to be put under the stanza.
3189+
* @param {Function} callback A function to call with the new configuration file.
3190+
*
3191+
* @endpoint properties
3192+
* @method splunkjs.Service.Configurations
3193+
*/
31483194
createAsync: async function (filename, stanzaName, keyValueMap, callback) {
31493195
callback = callback || function() {};
31503196
var that = this;

0 commit comments

Comments
 (0)