Most of the times or generally we use to do Admin level settings via going to CF Admin Page
But we can also change admin Level settings through code base using CF Admin APIs
Say for example Login in CF admin, adding a datasource or to see how many threads are running in our CF server.
All these can be achieved through Admin APIs which perform all CF Administrative work.
ColdFusion Provides reach Admin API located under CF directory (<CF Directory>\cfusion\wwwroot\CFIDE\adminapi).
There are almost 18 Components in total present in CF 10
CF11(Splendor: Beta Version) adds one more which is document.cfc.
Most of the CF Administrative work we can achieve it using these admin CFCs.
Above Image shows a list of Admin APIs present in CF splendor.
As all CF admin APIs are encrypted but we can check list of methods available under each CFC by calling them.
Let’s say we have to see what are the methods present under adminsitrator.cfc
use: http://coldfusion10/CFIDE/adminapi/administrator.cfc
enter your RDS password and you can check the methods available under administrator.cfc.
To call any CF admin APIs, you have to first Log in to CF administrator:
So first we have to create objects for those CFC and call it:
So, walk over to all the Admin APIs and get familiar with It.
Hope it will help you.
Happy Coding :)
But we can also change admin Level settings through code base using CF Admin APIs
Say for example Login in CF admin, adding a datasource or to see how many threads are running in our CF server.
All these can be achieved through Admin APIs which perform all CF Administrative work.
ColdFusion Provides reach Admin API located under CF directory (<CF Directory>\cfusion\wwwroot\CFIDE\adminapi).
There are almost 18 Components in total present in CF 10
CF11(Splendor: Beta Version) adds one more which is document.cfc.
Most of the CF Administrative work we can achieve it using these admin CFCs.
Above Image shows a list of Admin APIs present in CF splendor.
As all CF admin APIs are encrypted but we can check list of methods available under each CFC by calling them.
Let’s say we have to see what are the methods present under adminsitrator.cfc
use: http://coldfusion10/CFIDE/adminapi/administrator.cfc
enter your RDS password and you can check the methods available under administrator.cfc.
To call any CF admin APIs, you have to first Log in to CF administrator:
So first we have to create objects for those CFC and call it:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
//Creating Admin Object | |
request.adminObj = createobject("component","cfide.adminapi.administrator"); | |
/*Login to Admin API (login() accepts 4 parameters adminUserId,rdsPasswordAllowed,isHashed,adminPassword. | |
adminPassword is required so you have to pass admin Password in it.*/ | |
request.adminObj.login(adminPassword); | |
/* Do all your Operations here, call other methods */ | |
//Finally Log out from Admin API | |
request.adminObj.logout(); | |
</cfscript> |
Hope it will help you.
Happy Coding :)
No comments:
Post a Comment