Reputation: 633
I have a custom made WSO2 ESB connector. I want to automate the installation of this connector. The documentation explains how to enable the connector using the management console. Is there also a commandline interface to manage/enable connectors?
Thanks!
Upvotes: 1
Views: 394
Reputation: 5946
You can enable / disable a connector with an admin service (webService) called MediationLibraryAdminService
To see it's WSDL : https://localhost:9443/services/MediationLibraryAdminService?wsdl
(you must edit repository/conf/carbon.xml and change HideAdminServiceWSDLs to false : <HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>
)
Sample request to enable a connector "MyConnector" in a package "my.package" :
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.synapse/xsd">
<soap:Header/>
<soap:Body>
<xsd:updateStatus>
<xsd:libQName>{my.package}MyConnector</xsd:libQName>
<xsd:libName>MyConnector</xsd:libName>
<xsd:packageName>my.package</xsd:packageName>
<xsd:status>enabled</xsd:status>
</xsd:updateStatus>
</soap:Body>
You can call this service in command line with curl : save above request in a file named request.xml and type this command line with curl 7.40 :
curl --basic -u admin:admin -H "Content-Type: application/soap+xml" -k -d @request.xml https://192.168.0.33:9443/services/MediationLibraryAdminService.MediationLibraryAdminServiceHttpsSoap12Endpoint
Upvotes: 3