MCPcopy Index your code
hub / github.com/Unitech/pm2 / describe

Method describe

lib/API.js:1862–1893  ·  view source on GitHub ↗

* Description * @method describeProcess * @param {} pm2_id * @return

(pm2_id, cb)

Source from the content-addressed store, hash-verified

1860 * @return
1861 */
1862 describe (pm2_id, cb) {
1863 var that = this;
1864
1865 var found_proc = [];
1866
1867 that.Client.executeRemote('getMonitorData', {}, function(err, list) {
1868 if (err) {
1869 Common.printError('Error retrieving process list: ' + err);
1870 that.exitCli(conf.ERROR_EXIT);
1871 }
1872
1873 list.forEach(function(proc) {
1874 if ((!isNaN(pm2_id) && proc.pm_id == pm2_id) ||
1875 (typeof(pm2_id) === 'string' && proc.name == pm2_id)) {
1876 found_proc.push(proc);
1877 }
1878 });
1879
1880 if (found_proc.length === 0) {
1881 Common.printError(conf.PREFIX_MSG_WARNING + '%s doesn\'t exist', pm2_id);
1882 return cb ? cb(null, []) : that.exitCli(conf.ERROR_EXIT);
1883 }
1884
1885 if (!cb) {
1886 found_proc.forEach(function(proc) {
1887 UX.describe(proc);
1888 });
1889 }
1890
1891 return cb ? cb(null, found_proc) : that.exitCli(conf.SUCCESS_EXIT);
1892 });
1893 }
1894
1895 /**
1896 * API method to perform a deep update of PM2

Callers 8

StartModuleFunction · 0.80
CLI.jsFile · 0.80
programmatic.jsFile · 0.80
watcher.jsFile · 0.80
checkFunction · 0.80
signals.jsFile · 0.80
checkFunction · 0.80

Calls 2

cbFunction · 0.85
exitCliMethod · 0.80

Tested by

no test coverage detected