The Insert action inserts items into a repository.
Type: asynchronous
| Parameter | Description | Required |
|---|---|---|
ConnectorGroup
|
The name of the connector group to send the request to. This must match the name you specified when you configured the ConnectorGroupRouter processor in your dataflow. |
Yes |
Documents
|
XML that describes how to insert the item(s). Each item to insert is represented by a <documents>
<document file_part_name="file_part">
<IDENTIFIER>
<reference>/opt/files/file.txt</reference>
<type>File</type>
<property name="..." value="..." />
<property name="..." value="..." />
</IDENTIFIER>
</document>
</documents>
The The
|
Yes |
The following example uses the command-line tool cURL to send an insert action.
This example uses a File System Connector Group to insert a file into the file system. The file to insert is file.txt in the current working directory.
curl http://host:10000/action=Insert -F ConnectorGroup=FileSystem
-F "Documents=<documents.xml"
-F "file_part=@file.txt"
In this example, the XML that describes where to insert the item is read from the file documents.xml in the current working directory. This file might contain the following XML:
<documents>
<document file_part_name="file_part">
<IDENTIFIER>
<reference>/opt/files/file.txt</reference>
<type>File</type>
</IDENTIFIER>
</document>
</documents>
Notice that the value of the file_part_name attribute matches the name of the part, in the request, that contains the file to insert. The connector inserts the file into the file system at the location /opt/files/file.txt.
This is an asynchronous action, so you receive a token in response to the request. You can use the QueueInfo action to see the result of the action, including the identifiers of successfully inserted documents.
|
|