4.4.1.17 Creating a REST Target

To create a REST target:

  1. On the Catalog page, click Create New Item.
  2. Hover the mouse over Target and select REST from the submenu.
  3. On the Type Properties screen, enter the following details:
    • Name: Enter a unique name for the target. This is a mandatory field.
    • Display Name: Enter a display name for the target. If left blank, the Name field value is copied.
    • Description
    • Tags
    • Target Type: The selected target is displayed.
  4. Click Next.
  5. On the Target Details screen, enter the following details:
    • URL: Enter the REST service URL.

    • Use SSL: Select this option to enable SSL and basic authentication.

    • Trust Store File > Upload File: Click to upload the Truststore file.

    • Trust Store Password: Enter the truststore password.

      If you do not have the Truststore file and password, click Trust password to connect the REST end point.

      Note:

      The Trust Store File and Trust Store Password options allow the use of untrusted certificates for REST connections, resulting in an insecure connection.

    • Trust Anyway: Select this option to supersede the TrustStoreFile selection.

    • Custom HTTP headers: Set the custom headers for HTTP in the format key=value[,key2=value2, ....], without quotes. If the end point requires authentication, you can pass it as a custom header field.

      An example custom header would be Authorization=Basic XXXXXXXX, where XXXXXXXX is a base64-encoded string of username:password.

    • Batch processing: Select this option to process batch events as a single request. Enable this option for high throughput pipelines. For example,
      Eg: [{"address":
               { "street" : xxxxxxx }
      },{"address":
               { "street" : xxxxxxa }]
    • HTTP Method: Select this option for the REST target to send requests to REST end-point, using Http POST and PUT methods. Default is set to POST.
    • Data Format: Select a data format from the drop-down list.

  6. Click Next.
  7. On the Data Format screen, enter the shape details, based on the data format you have selected.
    • For JSON:
      • Create nested json object: Select this option to create a nested JSON object for the target. For example, if the target shape is defined as
        
        field:attribute_street, field_path:address/street. 
        }
        then output json is
        {"address":
                 { "street" : xxxxxxx }
    • For CSV:
      • CSV Predefined Format: Select one of the predefined data formats from the drop-down list. For more information, see Predefined CSV Data Formats.
      • First record as header: Select this option to use the first record as the header row.
  8. Click Next.
  9. On the Shape screen, select one of the methods to define the shape:
    • Infer Shape: Select this option to detect the shape automatically from the input data stream.

    • Select Existing Shape: Select one of the existing shapes from the drop-down list.

    • Manual Shape: Select this option to manually infer the fields from a stream or file. You can also add to, or remove fields from, an existing shape. Enter the following details:
      • For JSON:
        • Shape Name: Enter a name for the shape.
        • Clear Fields: Click to remove all the fields from the shape.
        • Key: Select key fields, based on which data is partitioned. For example, records containing the same values for the selected key fields will all be stored in the same Kafka partition.

          You can select multiple fields as key. Key selection is not mandatory.

        • Field Name: Add the necessary fields.
        • Field Path: Enter the field path.

          Note:

          • To retrieve the entire JSON payload, add a new field with path $.
          • To retrieve the content of the array, add a new field with path $[arrayField].

          In both the cases, the value returned is of type Text.

        • Field Type: Select the field data type from the drop-down list.
      • For CSV:
        • Shape Name: Enter a name for the shape.
        • Clear Fields: Click to delete all the fields in the shape.
        • Field Name: Add the necessary fields.
        • Field Type: Select the field data type from the drop-down list.
  10. Click Save.