CUCM Serviceability API
Reference: https://developer.cisco.com/site/sxml/
- The batch file requires command line program CURL - download and put in the Script Folder or add to the Windows PATH environment variable
- Download Win 32 bit version here
- Note CURL requires Microsoft Visual C++ Redistributable
- RestartTVS.txt
@echo off : Author: Gerard O'Rourke : Date: 19/06/2018 SET FOLDER=C:\X-Support\Scripts\ SET LOGFILE=%FOLDER%\curl.log SET CUCMPUB=10.123.123.123 SET CUCMUSER=myAppAdminUser SET CUCMPW=myAppAdminpassword SET SOAPACTION="SOAPAction: \"soapDoControlServices\"" SET SOAPXMLFILE=%FOLDER%\soapRestartTVS.xml SET SOAP-ENDPOINT=https://%CUCMPUB%:8443/controlcenterservice2/services/ControlCenterServices FOR /f "tokens=1-4 delims=/ " %%A IN ('date /t') DO ( set nday=%%A set nmonth=%%B set nyear=%%C ) set SORTDATE=%nyear%%nmonth%%nday% FOR /f "tokens=1-2 delims=: " %%A IN ('time /t') DO ( set hour=%%A set min=%%B ) set SORTTIME=%hour%%min% set TIMESTAMP=%sortdate%-%sorttime% echo. >> %LOGFILE% echo ************************************ >> %LOGFILE% REM echo Timestamp: %TIMESTAMP% >> %LOGFILE% curl -k -u %CUCMUSER%:%CUCMPW% --header "Content-Type: text/xml;charset=UTF-8" --header %SOAPACTION% --data @%SOAPXMLFILE% %SOAP-ENDPOINT% >> %LOGFILE% ping 127.0.0.1 -n 10 >NUL
The SOAP File Reference in above
- soapRestartTVS.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap"> <soapenv:Header/> <soapenv:Body> <soap:soapDoControlServices> <soap:ControlServiceRequest> <soap:NodeName>myCUCMServer</soap:NodeName> <soap:ControlType>Restart</soap:ControlType> <soap:ServiceList> <soap:item>Cisco Trust Verification Service</soap:item> </soap:ServiceList> </soap:ControlServiceRequest> </soap:soapDoControlServices> </soapenv:Body> </soapenv:Envelope>