MCPcopy
hub / github.com/Unitech/pm2 / _pingRoot

Method _pingRoot

modules/pm2-io-agent/src/InteractorDaemon.js:235–250  ·  view source on GitHub ↗

* Ping root url to retrieve node info * @private * @param {Function} cb invoked with where Object is the response sended by the server

(cb)

Source from the content-addressed store, hash-verified

233 * @param {Function} cb invoked with <Error, Object> where Object is the response sended by the server
234 */
235 _pingRoot (cb) {
236 const data = this.getSystemMetadata()
237
238 this.httpClient.open({
239 url: this.opts.ROOT_URL + '/api/node/verifyPM2',
240 method: 'POST',
241 data: {
242 public_id: this.opts.PUBLIC_KEY,
243 private_id: this.opts.SECRET_KEY,
244 data: data
245 },
246 headers: {
247 'User-Agent': `PM2 Agent v${pkg.version}`
248 }
249 }, cb)
250 }
251
252 /**
253 * Ping root to verify retrieve and connect to the km endpoint

Callers 2

_verifyEndpointMethod · 0.95

Calls 2

getSystemMetadataMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected