REST V2 Connector > Mappings and mapping tasks with REST V2 Connector > REST V2 targets in mappings
  

REST V2 targets in mappings

When you select a REST V2 connection for a Target transformation, you can select an operation. The operation is based on the swagger specification file that you specify during the REST V2 connection configuration.
You can add multiple input groups into the REST target and define the primary and foreign key relationships between the multiple input groups before the mapping.

Advanced target properties

In a mapping, you can configure a target to represent a REST target. For REST target connections used in a mapping, you can configure advanced properties in the Targets page of the Mapping Task wizard.
The following table describes the advanced properties that you can configure in a Target transformation:
Property
Description
Paging Type
Specify one of the following values:
Page. Enables paging and considers the values of Page Parameter, Start Page, End Page, and End of Response Expression properties.
None. Ignores the values of Page Parameter, Start Page, End Page, and End of Response Expression properties.
Page Parameter
The name of the parameter that you want to use for the paging operation. You can use a query parameter or a path parameter.
The parameter must be of the integer type and from the request message.
Start Page
The page number that indicates the first page in the range, on which you want to perform the paging operation.
End Page
The page number that indicates the last page in the range, on which you want to perform the paging operation. The default is 10000.
Paging stops when the End Page is reached or the End of Response Expression is met.
Page Increment Factor
An integer to increment the Page Parameter. Page Increment Factor must be same as the number of records being fetched per request. If the Page Increment Parameter option is not same as the number of records being fetched per request, you might have missing or duplicate records between two calls.
End of Response Expression
Specify an expression or a string to control paging. You can observe one of the following behaviors:
  • - If you specify a string or an expression, the paging stops when the value matches with the page response. It does not parse the page that has matching end of response.
  • - If you do not specify a string or an expression, the paging stops on reaching a page that has an empty or a Null response. If an empty or a Null response is never reached, the paging stops at the default end page.
  • - If you specify both, End Page and End of Response Expression, the paging stops on whichever condition is met first.
  • - If you do not specify End Page and End of Response Expression, the paging stops on reaching an empty or a Null response. If an empty or a Null response is never reached, the paging stops at the default end page.
Override URL
Overrides the URL specified in the swagger specification. The override URL cannot have query parameters. When a path parameter is included in the Override URL, enclose the path parameter with curly brackets {}. For example:
URL specified in the swagger specification: http://invr28pers102:13080/sample/day/20170505?a:b
If you define 20170505 as a path variable with the path variable name as path1, the Override URL will be as follows: http://invr28pers102:13080/sample/day/{path1}
Cache Size for Web Service Request (KB)
Memory available for the web service request. If the web service request contains many rows or columns, you might want to increase the cache size. Default is 1024 KB.
Transaction Commit Control
Control to commit or roll back transactions based on the set of columns that pass through the transformation. Use the transaction commit control if you have a large amount of data and you want to control how it is processed.
Does not apply when you select Transformation Scope as Transaction for real-time processing.
Transformation Scope
The method in which the Secure Agent applies the transformation logic to incoming data. Default is All Input.
To process data from a real-time source, select the transformation scope as Transaction.
For a source, which is not real-time, select the transformation scope as All Input.
You can connect only one effective real-time source to a real-time target.

Input settings properties

You can enable Sorted Input under Input Settings. Sorted Input indicates that input data is presorted. Default is disabled.
Enable sorted input for better performance.
Note: When Sorted Input is enabled and the input is not sorted, the Secure Agent does not process input and the mapping fails.

REST target mapping example

You are a human resources administrator and you want to update details of an employee in Apache CouchDB.
To update employee details in CouchDB from a flat file, perform the following tasks:
    1Create a flat file connection to read data from the flat file.
    2Create a REST connection to write data to CouchDB.
    The following image shows the configured CouchDB connection:
    3Create a CouchDB mapping.
    4Add a Source transformation to include the flat file object that contains the employee details. Add the flat file connection.
    5Add a Target transformation to write the employee details to CouchDB. Perform the following tasks on the Target tab:
    1. aIn the Connection field, select the REST connection to connect to CouchDB.
    2. bIn the Operation field, select CouchDBPost as the operation.
    3. The following image shows the CouchDBPost in the list of write operations:
    4. cIn the Advanced Properties section, set the cache size and the transaction commit interval.
    6On the Field Mapping tab, select the input elements to map to the target fields.
    The following image shows all the mapped fields between the input file and the CouchDB target:
    7When you save and run the mapping in a mapping task, the Secure Agent updates the employee details in CouchDB.