MCPcopy
hub / github.com/elasticsearch-dump/elasticsearch-dump / getScripts

Method getScripts

lib/transports/__es__/_script.js:28–49  ·  view source on GitHub ↗
(limit, offset, callback)

Source from the content-addressed store, hash-verified

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) {

Callers 1

getMethod · 0.80

Calls 3

_transformMetaMethod · 0.95
aws4signerFunction · 0.85
handleErrorMethod · 0.80

Tested by

no test coverage detected