Description

This function removes a Ruby application.

Examples 




https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=RoR&cpanel_jsonapi_func=removeapp&appname=Test



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Delete the Ruby app "Test"
$delete_rubyapp = $cpanel->api2(
    'RoR', 'removeapp',
 array(
        'appname' => 'Test',
 )  
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Delete the Ruby app "Test"
my $delete_rubyapp = $cpliveapi->api2(
    'RoR', 'removeapp',
{ 
        'appname' => 'Test',
   }
);

 




cpapi2 --user=username RoR removeapp appname=Test



{
  "cpanelresult": {
    "apiversion": 2,
    "error": "!!! PID file log\/mongrel.pid does not exist.  Not running?\nmongrel::stop reported an error. Use mongrel_rails mongrel::stop -h to get help.\n",
    "func": "removeapp",
    "data": [
      {
        "statusmsg": "App Removed",
        "env": "development",
        "status": 1,
        "loadonboot": "0",
        "name": "Test",
        "path": "/rails_apps/Test",
        "port": "12001"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "RoR"
  }
}



Parameters

ReturnTypeDescriptionPossible valuesExample
appnamestring

Required

The Ruby application's name.

A valid string.

Test

Returns

ReturnTypeDescriptionPossible valuesExample
statusmsgstringRuby's status.
  • remove ok
  • error
remove ok
envstringWhether the application used the production or development environment.
  • production
  • development
development
statusBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1
loadonbootBooleanWhether to load the function on system boot.
  • 1 — Load on boot.
  • 0 — Do not load on boot.
0
namestringThe application's name.A valid string.Test
pathstringThe application's path.A valid path.
/rails_apps/Test
portintegerThe application's port number.A positive integer.12001
reasonstring

A reason for failure.

This function only returns a reason value if it failed.


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1