| Watch Folders and the Aspera Watch Service |
195
Creating a Push Watch Folder with the API
These instructions describe how to create a push Watch Folder by using the Watch Folder API.
You can also create and manage Watch Folders from the command line (
Creating a Push Watch Folder with
on page 165) or by using IBM Aspera Console (
IBM Aspera Console Admin Guide
).
When you create a Watch Folder, a Watch service subscription is automatically created to monitor the source
directory. In the rare case that the subscription is somehow deleted or impaired, Watch Folders automatically creates
a new subscription; however, the new subscription does not retain the file change history and all files in the source
directory are re-transferred.
Restrictions on all Watch Folders
• Only local-to-remote (push) and remote-to-local (pull) configurations are supported. Remote-to-remote and local-
to-local are not supported.
• Growing files are only supported for local sources (push Watch Folders) and must be authenticated by a transfer
user (password or SSH key file). The transfer user cannot be restricted to aspshell and the source cannot be in
object storage.
• Source file archiving is not supported if the Watch Folder source is in object storage.
• IBM Aspera Shares endpoints must have version Shares version 1.9.11 with the Watch Folder patch or a later
version.
To create a push Watch Folder with the API:
1.
Prepare your computer as described in
Getting Started with Watch Folders
on page 164.
2.
Create a Node API user and associate it with a transfer user account. The user account must have administrative
(root / sudo) privileges to interact with asperawatchfolderd.
# /opt/aspera/bin/asnodeadmin -a -u
node_username
-p
node_password
-
x
admin_user
--acl-set "admin,impersonation"
For example:
# /opt/aspera/bin/asnodeadmin -a -u watchfolder_user -p X245lskd3 -x root
--acl-set "admin,impersonation"
Adding, modifying, or deleting a node-user triggers automatic reloading of the user database and the node's
configuration and license files. For more information on the Node API, see your transfer server's administrator
guide.
3.
Verify that you correctly added the Node API user.
# /opt/aspera/bin/asnodeadmin -l
List of Node API user(s):
user system/transfer user acls
==================== ======================= ====================
node_api_user
system_user
[admin,impersonation]
For example, using the information from the example in the previous step, the output is similar to the following:
# /opt/aspera/bin/asnodeadmin -l
user system/transfer user acls
==================== ======================= ====================
watchfolder_user root [admin,impersonation]
4.
Create the Watch service and Watch Folder service.
a) Create a JSON configuration file for each service.
For the Watch Service:
{