Create or Update a File
/mmc/api/servers/<myServerId>/files/<myFile.xml> resource, when called with the HTTP POST operation, creates or updates a file on the server. If the file does not exist, then the resource creates a new file. If the file already exists, then the resource updates the file with the new data. The file location is relative to the directory in which Mule is installed.
If you want to be sure that you are updating an existing file, and not creating a new file, then use this resource with the PUT command instead. When invoked with the PUT command, the resource only updates an existing file and does not create a new file.
Specify the server URL and file path using the form
<path> is the path to the file you want to create or update and
73d89173-290e-4cb3-a61c-e11deb74767d is the server id. The request body contains the new data for the file.
The following example shows how to invoke this resource with the POST command to either update or create the
1 (curl example)curl --basic -u admin:admin -v --header "Content-Type: application/octet-stream" --data-binary "@localMyconfig.xml" http://localhost:8080/mmc/api/servers/'local$d6f9cf62-f09c-4bf6-9d73-a16fec39dffc'/files/logs/myconfig.xmlPOST http://localhost:8080/mmc/api/servers/local$d6f9cf62-f09c-4bf6-9d73-a16fec39dffc/files/myconfig.xmlContent-Type: application/octet-stream ...file data...