(limit, offset, callback)
| 26 | } |
| 27 | |
| 28 | getScripts (limit, offset, callback) { |
| 29 | if (this.gotScripts === true) { |
| 30 | callback(null, []) |
| 31 | } else { |
| 32 | const esRequest = { |
| 33 | url: `${this.base.host}/_cluster/state/metadata?filter_path=**.stored_scripts.${this.base.index || '*'}`, |
| 34 | method: 'GET' |
| 35 | } |
| 36 | aws4signer(esRequest, this.parent).then(() => { |
| 37 | this.baseRequest(esRequest, (err, response) => { |
| 38 | this.gotScripts = true |
| 39 | const payload = [] |
| 40 | err = this.handleError(err, response) |
| 41 | if (err) { |
| 42 | return callback(err, []) |
| 43 | } |
| 44 | payload.push(this._transformMeta(response.body)) |
| 45 | callback(err, payload) |
| 46 | }) |
| 47 | }).catch(callback) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | setScripts (data, limit, offset, callback) { |
| 52 | if (this.haveSetScripts === true || data.length === 0) { |
no test coverage detected