2017-09-05 23 views
0

是否可以從Weblogic Server REST接口查詢已部署在服務器上的應用程序的.ear文件的名稱?怎麼樣?來自Weblogic REST接口的EAR文件名

+0

你想要什麼,你爲什麼要? – Ravi

+0

在我們的組織中,EAR文件是使用包含模塊版本(例如Module_A_ver_1_1)的名稱約定構建的。 我需要製作一個顯示每臺服務器上所有模塊的部署版本的儀表板。 –

+1

因此,您需要在weblogic上部署所有應用程序的列表。是嗎 ? – Ravi

回答

0

您可以使用WLST scipt,它可以爲您提供在特定域中部署的應用程序的列表。

下面是示例代碼:

connect('weblogic','weblogic','t3://localhost:7001') 
cd ('AppDeployments') 
myapps=cmo.getAppDeployments() 

for appName in myapps: 
     domainConfig() 
     cd ('/AppDeployments/'+appName.getName()+'/Targets') 
     mytargets = ls(returnMap='true') 
     domainRuntime() 
     cd('AppRuntimeStateRuntime') 
     cd('AppRuntimeStateRuntime') 
     for targetinst in mytargets: 
      curstate4=cmo.getCurrentState(appName.getName(),targetinst) 
      print '-----------', curstate4, '-----------', appName.getName() 

所以,一切都在WLST腳本開始從連接到WebLogic管理。然後,執行你的任務。