I was experimenting with the ColdFusion Admin API just to find out what it would take to restart ColdFusion programatically. Turns out it is very simple!
<cfscript>
adminObj = createObject(“component”,”cfide.adminapi.administrator”);
adminObj.login(“ColdFusion Password”);
// Instantiate the serverInstance object.
myServer = createObject(“component”,”cfide.adminapi.serverInstance”);myServer.restartInstance(“InstanceName”);
</cfscript>
Or maybe you want to enable/disable Robust Debugging?
myDebugging = createObject(“component”,”cfide.adminapi.debugging”);
myDebugging.setDebugProperty(“enableRobustExceptions”,true);
Cool huh?
Available Admin API objects:
| administrator.cfc | Contains basic Administrator functionality, including login, logout, the Migration Wizard, and the Setup Wizard. You must call the
method before calling any other methods in the Administrator API. |
| base.cfc | Base object for all other Administrator API CFCs. |
| datasource.cfc | Add, modify, and delete ColdFusion data sources. |
| debugging.cfc | Manage debug settings. |
| eventgateway.cfc | Manage event gateways. |
| extensions.cfc | Manage custom tags, mappings, CFXs, applets, CORBA, and web services. |
| mail.cfc | Manage ColdFusion mail settings. |
| runtime.cfc | Manage runtime settings for fonts, cache, charts, configuration, and other settings. |
| security.cfc | Manage passwords, RDS, and sandbox security. |
| serverinstance.cfc | Start, stop, and restart JRun servers. This CFC only works when running the multiserver configuration. |
