Connectors and Connections > Data Ingestion and Replication connection properties > REST V2 connection properties
  

REST V2 connection properties

Create a REST V2 connection to interact with web service applications built on REST architecture.

Prerequisites

Before you configure a REST V2 connection, be sure to complete the prerequisites.

Connect to REST V2

Let's configure the REST V2 connection properties to interact with web service applications built on REST architecture.

Before you begin

Before you get started, be sure to complete the prerequisites.

Connection details

The following table describes the basic connection properties:
Property
Description
Connection Name
Name of the connection.
Each connection name must be unique within the organization. Connection names can contain alphanumeric characters, spaces, and the following special characters: _ . + -,
Maximum length is 255 characters.
Description
Description of the connection. Maximum length is 4000 characters.
Type
REST V2
Runtime Environment
Name of the runtime environment where you want to run tasks.
Select a Secure Agent, Hosted Agent, or serverless runtime environment.
You cannot run a streaming ingestion task on a Hosted Agent or serverless runtime environment.

Authentication types

You can configure standard, OAuth 2.0 client credentials, OAuth 2.0 authorization code, JWT bearer token, and API key authentication types to connect to a REST endpoint.
Select the required authentication method and then configure the authentication-specific parameters.

Advanced settings

The following table describes the advanced connection properties:
Property
Description
TrustStore File Path
The absolute path of the truststore file that contains the TLS certificate to establish a one-way or two-way secure connection with the REST API. Specify a directory path that is available on each Secure Agent machine.
You can also configure the truststore file name and password as a JVM option or import the certificate to the following directory:
<Secure Agent installation directory\jre\lib\security\cacerts.
For the serverless runtime environment, specify the truststore file path in the serverless agent directory.
For example, /home/cldagnt/SystemAgent/serverless/configurations/ssl_store/<cert_name>.jks
TrustStore Password
The password for the truststore file that contains the SSL certificate.
You can also configure the truststore password as a JVM option.
KeyStore File Path
The absolute path of the keystore file that contains the keys and certificates required to establish a two-way secure communication with the REST API. Specify a directory path that is available on each Secure Agent machine.
You can also configure the keystore file name and path as a JVM option or import the certificate to any directory.
For the serverless runtime environment, specify the keystore file path in the serverless agent directory.
For example, /home/cldagnt/SystemAgent/serverless/configurations/ssl_store/<cert_name>.jks
KeyStore Password
The password for the keystore file required for secure communication.
You can also configure the keystore password as a JVM option.
Proxy Type
Type of proxy.
Select one of the following options:
  • - No Proxy: Bypasses the proxy server configured in the agent or the connection properties.
  • - Platform Proxy: Considers the proxy configured in the agent.
  • - Custom Proxy: Considers the proxy configured in the connection properties.
Proxy Configuration
The format required to configure proxy.
Configure proxy using the following format:
<host>:<port>
You cannot configure an authenticated proxy server.
Advanced Fields
Enter the arguments that the agent uses when connecting to a REST endpoint.
When you specify multiple arguments, separate each argument by a semicolon.
For example,
connectiondelaytime:10000;retryattempts:5
You can specify the following arguments:
  • - ConnectionTimeout. The wait time in milliseconds to get a response from a REST endpoint. The connection ends after the connection timeout is over.
  • Default is the timeout defined in the endpoint API.
    Note: If you define both the REST V2 connection timeout and the endpoint API timeout, the connection ends at the shortest defined timeout.
  • - connectiondelaytime. The delay time in milliseconds to send a request to a REST endpoint.
  • Default is 10000.
  • - retryattempts. Number of times the connection is attempted when 400 and 500 series error codes are returned in the response.
  • Default is 3. Specify 0 to disable the retry attempts.
  • - qualifiedSchema. Determines if the schema selected is qualified or unqualified.
  • Default is false.
Note: In a streaming ingestion and replication task, only ConnectionTimeout and retryattempts are applicable.

Secure communication with TLS authentication

Configure TLS authentication to establish one-way or two-way secure communication between the Secure Agent and the REST API over TLS.
To establish one-way secure communcation, perform the following steps:
  1. 1Generate the truststore. For more information on the steps, see Generate a Truststore.
  2. 2Configure the REST V2 connection for one-way SSL. You can specify the truststore file and truststore password in the connection, or set them in the JVM options of the Secure Agent.
To establish two-way secure communcation, you must first configure one-way secure communication, and then perform the following steps:
  1. 1Generate the keystore. For more information on the steps, see Generate a Keystore.
  2. 2Configure the REST V2 connection for two-way SSL. You can specify the keystore file and keystore password in the connection, or set them in the JVM options of the Secure Agent.
If you specify keystore and truststore properties in the connection and in the JVM options, the Secure Agent processes the certificates based on the properties configured in the connection.

Generate a truststore

To generate a truststore, you need a server certificate. Get the server certificate and perform the following steps to generate the truststore:
  1. 1Import the server certificate to the following file path:
  2. <Secure Agent installation directory>\jre\lib\security\cacerts
  3. 2To generate the truststore, run the following command from the command line:
  4. keytool -importcert -alias <Specify alias name here> -file <Specify server certificate here> -keystore <Specify the name of custom truststore to be generated> -storepass <Specify password for the custom truststore>
    For example, keytool -importcert -alias RESTV2CACert -file ca.pem -keystore sampletruststore -storepass JKSTrustStorePassword
    In the example, a truststore file is generated by the name sampletruststore and password JKSTrustStorePassword.

Generate a keystore

To generate a keystore, you need a client certificate and a client private key. Get the client certificate and client private key, and then perform the following steps to generate the keystore:
  1. 1Import the certificate to the following file path:
  2. <Secure Agent installation directory>\jre\lib\security\cacerts
  3. 2To generate the keystore, run the following command from the command line:
  4. openssl pkcs12 -export -in <Specify client certificate here> -inkey <Specify client private key here> -name "<Specify any name here>" -passout pass:<Specify password for the keystore to be generated> -out <Specify name for the keystore with p12 extension>
    For example, openssl pkcs12 -export -in /home/samplefolder/certs/client-cert.pem -inkey /home/samplefolder/certs/client-key.pem -name "restclient" -passout pass:PKCSKeyStorePassword -out samplekeystore.p12
    In the example, a keystore file by the name samplekeystore.p12 is generated in the PKCS12 format.
    To convert the keystore file from .p12 format to .jks format, run the following command from the command line:
    keytool -importkeystore -srckeystore <Specify name of the p12 keystore file> -srcstoretype pkcs12 -srcstorepass <Specify password for generated p12 keystore file> -destkeystore <Specify name for the JKS keystore file> -deststoretype JKS -deststorepass <Specify password for the JKS keystore file>
    Note: Ensure that the password specified in -srcstorepass must be the same as the -deststorepass.
    For example, keytool -importkeystore -srckeystore samplekeystore.p12 -srcstoretype pkcs12 -srcstorepass PKCSKeyStorePassword -destkeystore keystore -deststoretype JKS -deststorepass PKCSKeyStorePassword
    In the example, a keystore file is generated by the name samplekeystore and password PKCSKeyStorePassword.

Configuring one-way or two-way secure communication

You can configure a connection for one-way or two-way SSL.

Configuring the connection for one-way SSL

You can either specify the name of the truststore file and truststore password in the TrustStore File Name and TrustStore Password fields in the connection properties. Alterntaively, you can set the truststore file name and truststore password in the JVM options in the Secure Agent properties.
  1. 1Click Administrator > Runtime Environments, and select an agent.
  2. 2Select Type as DTM under System Configuration Details.
  3. 3Add the following JVM options:

Configuring the connection for two-way SSL

You can either specify the name of the keystore file and keystore password in the KeyStore File Name and KeyStore Password connection properties. Alternatively, you can set the keystore file and keystore password in the JVM options in the Secure Agent properties.
To use two-way SSL, you must first configure one-way SSL, and then perform the following steps to configure two-way SSL:
  1. 1Click Administrator > Runtime Environments, and select an agent.
  2. 2Select Type as DTM under System Configuration Details.
  3. 3Add the following JVM options:

Secure communication in a serverless runtime environment

When you use the serverless runtime environment, you can configure TLS authentication and establish one-way or two-way secure communication with the REST API.
Ensure that the certificates are in the .jks format.
To configure a secure REST V2 connection using the serverless runtime environment, complete the following prerequisite tasks to add the TLS certificates to the serverless runtime location:
  1. 1Create the following structure for the serverless agent configuration in AWS:
  2. <Supplementary file location>/serverless_agent_config
  3. 2For one-way secure communication, add the truststore certificates and for the two-way secure communication, add the truststore and keystore certificates in the Amazon S3 bucket in the following location in your AWS account:
  4. <Supplementary file location>/serverless_agent_config/SSL
  5. 3Copy the following code snippet to a text editor:
  6. version: 1
    agent:
    agentAutoApply:
    general:
    sslStore:
    - fileCopy:
    sourcePath: SSL/<RESTV2_trustStore_cert_name>.jks
    - fileCopy:
    sourcePath: SSL/<RESTV2_keyStore_cert_name>.jks
    where the source path is the directory of the certificate files in AWS.
  7. 4Ensure that the syntax and indentations are valid, and then save the file as serverlessUserAgentConfig.yml in the following AWS location:
  8. <Supplementary file location>/serverless_agent_config
    When the .yml file runs, the SSL certificates are copied from the AWS location to the serverless agent directory.
  9. 5In the REST V2 connection properties, specify the following certificate path in the serverless agent directory in the TrustStore File Path and KeyStore File Path fields:
  10. /home/cldagnt/SystemAgent/serverless/configurations/ssl_store/<cert_name>.jks

Swagger specification file in a serverless runtime environment

To configure a swagger file in a serverless runtime environment, be sure to complete the prerequisites.
In the serverless runtime environment, you can configure a swagger file in one of the following ways:
To configure a swagger file in a serverless runtime environment, complete the following prerequisite tasks to add the swagger file to the serverless runtime location:
  1. 1Create the following structure for the serverless agent configuration in AWS or Azure:
  2. <Supplementary file location>/serverless_agent_config
  3. 2Add the swagger specification file in the Amazon S3 bucket or Azure container in the following location in your AWS or Azure account:
  4. <Supplementary file location>/serverless_agent_config/restv2
    1. aCopy the following code snippet to a text editor:
    2. version: 1
      agent:
      dataIntegrationServer:
      autoApply:
      restv2:
      swaggers:
      - fileCopy:
      sourcePath: restv2/<swagger_file_name1>.json
      - fileCopy:
      sourcePath: restv2/<swagger_file_name2>.json
      where the source path is the directory path of the swagger files in AWS or Azure.
  5. 3Ensure that the syntax and indentations are valid, and then save the file as serverlessUserAgentConfig.yml in the following AWS or Azure location:
  6. <Supplementary file location>/serverless_agent_config
    When the .yml file runs, the SSL certificates are copied from the AWS or Azure location to the serverless agent directory.
  7. 4In the REST V2 connection properties, specify the following swagger path in the serverless agent directory in the Swagger File Path field:
  8. /home/cldagnt/SystemAgent/serverless/configurations/restv2/<swagger_file_name>.json

Rules and guidelines for runtime environment

Consider the following guidelines when you run tasks in different runtime environments:

Rules and guidelines for a REST V2 connection

Consider the following rules and guidelines for a Rest V2 connection: