Ajay,
There is an API entry point at api/customApps in the Web UI. Here is an example of stopping an app:
admin@mtcdt:/var/config# curl -X POST -H ‘Content-Type: application/json’ -d ‘{}’ 127.0.0.1/api/customApps/58a4d0d85b1b015a89000006/stop
{
“code” : 200,
“status” : “success”
}
The trick will be to get the appId -> 58a4d0d85b1b015a89000006. You can get that from the output of:
curl -s 127.0.0.1/api/customApps
which will return something like this:
{
“code” : 200,
“result” : [
{
"_id" : "58a4d0d85b1b015a89000006",
"description" : "Basic web server running on port 3000. Firewall is opened on install. node_modules is included in the tarball. Utilizes all custom app functionality including environment variables, custom status file, config file, and install scripts.",
"info" : "Listening on port 3000 as of Mon May 01 2017 18:09:18 GMT+0000 (UTC)",
"name" : "express-hello-world",
"status" : "STOPPED",
"version" : "1.4",
"versionNotes" : "Implement restart and reload in the Start script"
}
],
“status” : “success”
}
Jeff