0

Restart ColdFusion instance via Admin API

ColdFusion
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

login
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.

tags:
ColdFusion
Sami Hoda said:
 
Nice (and dangerous)!
 
posted 1277 days ago
Add Comment Reply to: this comment OR this thread
 
Dave Shuck said:
 
I have added this to my CFEclipse snippets. Now when I need to restart the server, I simply go to the scribble pad and type:
<pre>
restart[ctrl][shift][period]
</pre>
...and hit run. Good stuff A!
 
posted 1277 days ago
Add Comment Reply to: this comment OR this thread
 
Dave Shuck said:
 
OK, so the <pre></pre> didn't do what I expected. Just disregard those. :)
 
posted 1277 days ago
Add Comment Reply to: this comment OR this thread
 
Sami Hoda said:
 
None of the links work on this entry.
 
posted 1152 days ago
Add Comment Reply to: this comment OR this thread
 
 
Thanks Sami, as you might have noticed we just migrated our blogs over to www.InstantSpot.com and as such, many links in old posts have died. After the mad rush to keep the InstantSpot.com ball rolling, I will get those links fixed asap.

Thanks,
Aaron
 
posted 1151 days ago
Add Comment Reply to: this comment OR this thread
 
duncan said:
 
broken link to runtimecfc.cfm
 
posted 342 days ago
Add Comment Reply to: this comment OR this thread
 

Search

Fuelly