Transferring files to and from a collective member or registered host with REST calls
You can perform routed file transfer operations from a collective controller to a collective member or to a registered host of a collective by invoking REST APIs. The operations include downloading files from a remote location, uploading files to a remote location, and deleting files in a remote location. Use the GET, POST, or DELETE REST APIs. The file transfer operations occur within an IBM JMX REST Connector.
Before you begin
To perform file transfer operations from a collective controller to a member server, the server must be joined as a member to the collective. See Configuring a Liberty collective.
To perform file transfer operations to a host computer, the host must be registered with the collective controller. See Registering host computers with a Liberty collective.
Procedure
Example
myServerA
on the host myTarget.com
with a user directory of
C:/server/wlp:- Set the member server routing context as HTTP
headers.
com.ibm.websphere.jmx.connector.rest.routing.hostName=myTarget.com com.ibm.websphere.jmx.connector.rest.routing.serverName=myServerA com.ibm.websphere.jmx.connector.rest.routing.serverUserDir=C:/server/wlp
- Invoke a GET call to download the
file.
GET https://myTarget.com:9443//IBMJMXConnectorREST/file/C%3A%2Ftemp%2FmyFile.txt
myTarget.com
:- Set the registered host routing context as an HTTP
header.
com.ibm.websphere.jmx.connector.rest.routing.hostName=myTarget.com
- Invoke a GET call to download the
file.
GET https://myTarget.com:9443//IBMJMXConnectorREST/file/C%3A%2Ftemp%2FmyFile.txt
myServerA
on the host myTarget.com
with a user directory of
C:/server/wlp:- Set the member server routing context as HTTP
headers.
com.ibm.websphere.jmx.connector.rest.routing.hostName=myTarget.com com.ibm.websphere.jmx.connector.rest.routing.serverName=myServerA com.ibm.websphere.jmx.connector.rest.routing.serverUserDir=C:/server/wlp
- Invoke a GET call to download the
${server.config.dir}/server.xml
file.
GET https://myTarget.com:9443//IBMJMXConnectorREST/file/%24{server.config.dir}%2Fserver.xml
What to do next
Get status or details on the REST call. See Getting status on a REST call for multiple registered hosts.