|
1397 | 1397 | return req;
|
1398 | 1398 | },
|
1399 | 1399 |
|
| 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 | + */ |
1400 | 1416 | fetchAsync: async function(options) {
|
1401 | 1417 | options = options || {};
|
1402 | 1418 | if (!options.count) {
|
|
3107 | 3123 | return req;
|
3108 | 3124 | },
|
3109 | 3125 |
|
| 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 | + */ |
3110 | 3135 | getConfFile: async function(filename) {
|
3111 | 3136 | var that = this;
|
3112 | 3137 |
|
|
3133 | 3158 | return fetchedFile;
|
3134 | 3159 | },
|
3135 | 3160 |
|
| 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 | + */ |
3136 | 3171 | getStanza: async function(file, stanza) {
|
3137 | 3172 | // 1. check if the stanza exists
|
3138 | 3173 | var fetchedStanza = file.item(stanza);
|
|
3145 | 3180 | }
|
3146 | 3181 | },
|
3147 | 3182 |
|
| 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 | + */ |
3148 | 3194 | createAsync: async function (filename, stanzaName, keyValueMap, callback) {
|
3149 | 3195 | callback = callback || function() {};
|
3150 | 3196 | var that = this;
|
|
0 commit comments