Updated on 2024-10-23 GMT+08:00

Rest Client Connection Parameters

Table 1 Rest Client connection

Parameter

Mandatory

Description

Data Connection Type

Yes

The value is fixed at Rest Client.

Name

Yes

Name of the data connection to create. Data connection names can contain a maximum of 100 characters. They can contain only letters, digits, underscores (_), and hyphens (-).

Tag

No

Attribute of the data connection to create. Tags make management easier.
NOTE:

The tag name can contain only letters, digits, and underscores (_) and cannot start with an underscore (_) or contain more than 100 characters.

Applicable Modules

Yes

Select the modules for which this connection is available. The connection can be used in the selected modules.

NOTE:
  • When the data migration job feature is enabled, you can select the DataArts Migration module. Then you can select this data connection when creating a data migration job in DataArts Factory.
  • You can use offline processing migration jobs only after apply for the trustlist membership. To use this feature, contact customer service or technical support.

Basic and Network Connectivity Configuration

Connection address prefix

Yes

This parameter is displayed when DataArts Migration is selected for Applicable Modules.

Prefix of the connection address. This prefix is automatically added when an API is called during a job test or execution. HTTPS supports only TLS 1.2.

Example: https://xxx.com/prefix

Default Header

Yes

This parameter is displayed when DataArts Migration is selected for Applicable Modules.

It specifies the default header parameter. This header is carried when an API is called. Example: {"Content-Type":"application/json"}

KMS Key

Yes

KMS key used to encrypt and decrypt the authentication information for the data source

Agent

Yes

This parameter is displayed when DataArts Migration is selected for Applicable Modules.

DataArts Studio cannot directly connect to non-fully managed services. An agent is required for DataArts Studio to communicate with non-fully managed services. A CDM cluster can function as an agent. If no CDM cluster is available, create one using the DataArts Migration incremental package.

Data Source Authentication and Other Function Configuration

Rest auth type

Yes

Authentication method. The following options are available:

  • NONE: no authentication
  • BASIC_AUTH: basic authentication

    If the data source API supports username and password authentication, you can select this authentication type and configure the username and password used for authentication. When the data source is connected, the username and password are transferred to the RESTful address through the Basic Auth protocol for authentication. The format is {"Authorization":"Basic base64(username:password)"}.

  • TOKEN_AUTH: token authentication (The token is static and never expires. Otherwise, jobs will fail if the token expires.)

    If the data source API supports token-based authentication., you can select this authentication type and set a fixed token for authentication. When the data source is connected, the token is transferred to the header for authentication. The format is {"Authorization":"Bearer <token>"}.

  • OAUTH_CODE_GRANT Oauth 2.0 (Authorization Code): Oauth2.0 authentication

    In this mode, a username and a password are used to obtain an access token, which is used to access APIs.

Username

No

This parameter is displayed when Rest auth type is BASIC_AUTH.

You can use #username to obtain the value and transfer it in the body and header.

Password

No

This parameter is displayed when Rest auth type is BASIC_AUTH.

You can use #password to obtain the value and transfer it in the body and header.

Token

No

This parameter is displayed when Rest auth type is TOKEN_AUTH.

You can use #token to obtain the value and transfer it in the body and header.

Auth request url

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

This parameter is available when Rest auth type is set to Oauth 2.0 (Authorization Code). This API supports OAuth 2.0. Authentication credentials are used to obtain a token. Before testing connections and jobs, call this API to obtain the token. In addition, the location, name, and value acquisition mode of the token carried in subsequent APIs are defined in the authentication token.

Example: https://xxx.com/auth/token

Auth request method

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

Authentication request method in OAuth 2.0 mode. The value can be GET or POST. This parameter is mandatory if Auth request url is set.

Example: GET

Auth request username

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

This parameter is mandatory for the Oauth 2.0 mode. You can use #authUsername to obtain the value of this parameter and enter it in the authHeader or authbody parameter.

Auth request password

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

This parameter is mandatory for the Oauth 2.0 mode. You can use #authPassword to obtain the value of this parameter and enter it in the authHeader or authbody parameter.

Auth request header

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

Request header for the Oauth 2.0 mode. The authentication account and password can be obtained through #authUsername and #authPassword.

Example: {"username": "#authUsername","password": "#authPassword","Content-Type":"application/json"}

Auth request body

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

Request body for the Oauth 2.0 mode. This parameter is unavailable when Auth request method is set to GET. The authentication account and password can be obtained through #authUsername and #authPassword.

Example: {"username": "#authUsername","password": "#authPassword"}

Auth request token

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

Authentication token, which can be obtained from the response body of the authentication API and carried in the connection and job test. The token can only be placed in the header. The value contains a parameter name and a parameter value. The parameter value can be a SpEL expression.

The following is an example:

The authentication response body is as follows:

{

"code" : 200,

"data" : {

"access_token" : "DSFSDFWE87WE9089W9EW9ER898WER9W89ER8",

"expired":1000

}

}

To obtain the value of access_token in Bearer <token> format, set the value of this parameter as follows:

NAME: Authentication

VALUE: 'Bearer ' + #response.data.access_token

Auth request token expired

No

This parameter is displayed when Rest auth type is OAUTH_CODE_GRANT.

Validity period of the authentication token, in seconds. The value can be an EL expression. The default value 0 indicates that the token is permanently valid.

Example 1: 300 indicates that the validity period is 300 seconds.

Example 2: #response.data.expired. Obtain the value of the expired attribute from the JSON string returned by the authentication API. The default unit is second. If the value is not of the int type, enter a validity period.