The Database Server Connector can be configured using the Rest API. It requires the following entities to be created:

  • Credential
  • Connection
  • Connector
  • Seed

Below are the examples of how to create the Connection and the Seed. For the Connector, please check this page.

Create Credential


Field

Required

Default

Multiple

NotesExample
typeYes-No

The value must be "db-server".

"db-server"

descriptionYes-NoName of the credential object.

"DBConnector"

propertiesYes-NoConfiguration object
"credentialType"yes-NoIt can be basic or Kerberos"basic"
"user"yes-NoThe authorized user"username"
"password"yes-NoUser password"encrypted:8DBA..."

Example

POST aspire/_api/credentials
{
    "type": "db-server",
    "description": "db-server Credential",
    "properties": {  
       "credentialType": "basic",
       "user": "username",
       "password": "encrypted:8DBA..."     
    }
}

Update Credential


Field

Required

Default

Multiple

NotesExample
idYes-NoID of the credential to update."2a5ca234-e328-4d40-bb2a-2df3e550b065"
descriptionYes-NoName of the credential object.

"DBConnector Credential"

propertiesYes-NoConfiguration object
"credentialType"Yes-NoIt can be basic or Kerberos."kerberos"
"kerberosUser"Yes-NoKerberos username."username"
"keytabFile"Yes-NoPath to the Keytab file."C:\\keytabFilePath"
"externalClasspath"No-NoThe path of the folder where other needed files are located."C:\\externamClasspath"
"hadoopResourceFiles"No-NoThe path to Hadoop files[ ]

Example 

PUT aspire/_api/credentials/2a5ca234-e328-4d40-bb2a-2df3e550b065
{
  "id": "2a5ca234-e328-4d40-bb2a-2df3e550b065",
  "type": "db-server",
  "description": "DBConnector Credential",
  "throttlePolicy": null,
  "properties": {
    "credentialType": "kerberos",
    "kerberosUser": "username",
    "keytabFile": "C:\\keytabFilePath",
    "externalClasspath": "C:\\externamClasspath",
    "hadoopResourceFiles": []
  }
}

Create Connection


Field

Required

Default

Multiple

Notes

Example

typeYes-No

The value must be db-server

"db-server"

descriptionYes-NoName of the connection object.

"MyDatabase ServerConnection"

credentialYes-NoID of the credential."f5587cee-9116-4011-b3a9-6b235b333a1b"
propertiesYes-NoConfiguration object
"serverUrl"Yes-NoThe connection stream of the server."Server_URL"
"jdbcDriverJar"Yes-NoThe path to the driver (.jar)"odbc.jar"
"specClass"YesfalseNoSelect this option in case the driver name is non-standard. false
"specClassPath"YesfalseNoSelect this option in case additional drivers need to be uploaded, and add the path of the folder which contains the additional drivers.false
"stopOnScanError"YestrueNoThe scan will be stopped as soon as an error occurs during scanning.false
"prefetchSize"No10No The number of items to be loaded in memory at a time.10
"indexContainers"NotrueNo Indexes the metadata from the databases and tables.true
"extractRowCount"NofalseNoIncludes the number of rows of the table.false
"addSchema"NofalseNoIncludes the tables structure.false
"useTableQuery"NofalseNoA specific query to extract additional data. false
"addResultSet"NofalseNoAdds the content of the tables to the job.false
"extractRows"NofalseNo Indexes all the rows in a table.false

Example

POST aspire/_api/connections
{
    "type": "db-server",
    "description": "DBserver Test Connector",
    "properties": {          
      "serverUrl": "Server_URL",
      "jdbcDriverJar": "odbc.jar",
      "specClass": false,
      "specClassPath": false,
      "stopOnScanError": false,
      "prefetchSize": 10,
      "indexContainers": true,
      "extractRowCount": false,
      "addSchema": false,
      "useTableQuery": false,
      "addResultSet": false,
      "extractRows": false
     }
}

Please keep in mind that you necessarily need to select  Index DBs and tables or Enable row extraction for the connector to work properly. Please remember that both options are exclusive, so you will not be able to use the two of them at the same time.

Update Connection


Field

Required

Default

Multiple

Notes

Example

idYes-NoID of the connection to update"89d6632a-a296-426c-adb0-d442adcab4b0",
typeYes-NoType of the connection"db-server"
descriptionNo-NoName of the connection object.

"My DBServer Connection"

throttlePolicyNo-NoID of the throttle policy that applies to this connection object."f5587cee-9116-4011-b3a9-6b235b333a1b"
propertiesYes-NoConfiguration object
"serverUrl"Yes-NoThe connection stream of the server."Server_URL"
"jdbcDriverJar"Yes-NoThe path to the driver (.jar)"odbc.jar"
"specClass"No-NoSelect this option in case the driver name is non-standard. false
"specClassPath"No-NoSelect this option in case additional drivers need to be uploaded, and add the path of the folder which contains the additional drivers.false
"stopOnScanError"YesfalseNoThe scan will be stopped as soon as an error occurs during scanning.false
"prefetchSize"Yes10No The number of items to be loaded in memory at a time.25
"indexContainers"NofalseNo Indexes the metadata from the databases and tables.true
"extractRowCount"NofalseNoIncludes the number of rows of the table.false
"addSchema"NofalseNoIncludes the tables structure.false
"useTableQuery"NofalseNoA specific query to extract additional data. false
"addResultSet"NofalseNoAdds the content of the tables to the job.false
"extractRows"NofalseNo Indexes all the rows in a table.false

Example

{
  "id": "b76ed996-2b0c-4ebc-8b0d-9a9e5821f2e3",
  "type": "db-server",
  "description": "DBServerConnector",
  "credential": "98e729c5-2a8b-4aee-aee0-c79ba38f32d3",
  "throttlePolicy": null,
  "properties": {
      "serverUrl": "Server_URL",
      "jdbcDriverJar": "odbc1.jar",
      "specClass": false,
      "specClassPath": false,
      "stopOnScanError": false,
      "prefetchSize": 25,
      "indexContainers": true,
      "extractRowCount": false,
      "addSchema": false,
      "useTableQuery": false,
      "addResultSet": false,
      "extractRows": false
  }
}

Create Connector Instance


For the creation of the Connector object using the Rest API, check this page.

Update Connector Instance


For the update of the Connector object using the Rest API, check this page.

Create Seed


Field

Required

Default

Multiple

Notes

Example

seedYes-No<seed description>"dbserver_seed"
typeYes-No

The value must be dbconnector.

"db-server"

descriptionYes-NoName of the seed object.

"My Database Server Seed"

connectorYes-NoThe ID of the connector to be used with this seed. The connector type must match the seed type."82f7f0a4-8d28-47ce-8c9d-e3ca414b0d31"
connectionYes-NoThe ID of the connection to be used with this seed. The connection type must match the seed type."602d3700-28dd-4a6a-8b51-e4a663fe9ee6"
workflowsNo[ ]YesThe IDs of the workflows that will be executed for the documents crawled.["f8c414cb-1f5d-42ef-9cc9-5696c3f0bda4"]
throttlePolicyNo-NoID of the throttle policy that applies to this connection object."f5587cee-9116-4011-b3a9-6b235b333a1b"
routingPoliciesNo[ ]YesThe IDs of the routing policies that this seed will use.["313de87c-3cb9-4fe0-a2cb-17f75ce7d0c7", "b4d2579f-1a0a-4a8b-9fd4-d42780003b36"]
tagsNo[ ]YesThe tags of the seed. These can be used to filter the seed.["tag1", "tag2"]
propertiesYes-NoConfiguration object
"seed"Yes-NoID of the seed to crawl.
"excludeFile"Yes-NoIt can be used to filter the crawled databases and tables. Add the path to the .json file where the excluded items are placed."C:\\excluded.json"
"includeFile"Yes-NoIt can be used to filter the crawled databases and tables. Add the path to the .json file where the included items are placed."C:\\included.json"

Example 

{
  "seed": "dbserver_seed",
  "type": "db-server",
  "description": "DBSeed",
  "connector": "a320a91c-2a48-4402-a5f1-c7d2fa913ba2",
  "connection": "b76ed996-2b0c-4ebc-8b0d-9a9e5821f2e3",
  "workflows": [
    "f51f5162-faaf-43dc-aa89-3b872160f504"
  ],
  "tags": [],
  "properties": {
    "seed": "dbserver_seed",
    "excludeFile": "C:\\excluded.json",
    "includeFile": "C:\\included.json"
  }
}

Update Seed


Field

Required

Default

Multiple

Notes

Example

IDYes-NoID of the seed to update."2f287669-d163-4e35-ad17-6bbfe9df3778"
seedNo-No<seed description>
descriptionNo-NoName of the seed object.

"MyDatabase ServerSeed"

connectorNo-NoThe ID of the connector to be used with this seed. The connector type must match the seed type."82f7f0a4-8d28-47ce-8c9d-e3ca414b0d31"
connectionNo-NoThe ID of the connection to be used with this seed. The connection type must match the seed type."602d3700-28dd-4a6a-8b51-e4a663fe9ee6"
workflowsNo[ ]YesThe IDs of the workflows that will be executed for the documents crawled.["f8c414cb-1f5d-42ef-9cc9-5696c3f0bda4"]
workflows.addNo[ ]YesThe IDs of the workflows to add.["f8c414cb-1f5d-42ef-9cc9-5696c3f0bda4"]
workflows.removeNo[ ]YesThe IDs of the workflows to remove.["f8c414cb-1f5d-42ef-9cc9-5696c3f0bda4"]
throttlePolicyNo-NoID of the throttle policy that applies to this connection object."f5587cee-9116-4011-b3a9-6b235b333a1b"
routingPoliciesNo[ ]YesThe IDs of the routing policies that this seed will use.["313de87c-3cb9-4fe0-a2cb-17f75ce7d0c7", "b4d2579f-1a0a-4a8b-9fd4-d42780003b36"]
routingPolicies.addNo[ ]YesThe IDs of the routingPolicies to add.["b4d2579f-1a0a-4a8b-9fd4-d42780003b36"]
routingPolicies.removeNo[ ]YesThe IDs of the routingPolicies to remove.["313de87c-3cb9-4fe0-a2cb-17f75ce7d0c7"]
tagsNo[ ]YesThe tags of the seed. These can be used to filter the seed["tag1", "tag3"]
tags.addNo[ ]YesThe tags to add["tag4"]
tags.removeNo[ ]YesThe tags to remove["tag2"]
propertiesYes-NoConfiguration object
"seed"Yes-NoID of the seed to crawl."2f287669-d163-4e35-ad17-6bbfe9df3778"
"excludeFile"Yes-NoIt can be used to filter the crawled databases and tables. Add the path to the .json file where the excluded items are placed."C:\\excluded_new.json"
"includeFile"Yes-NoIt can be used to filter the crawled databases and tables. Add the path to the .json file where the included items are placed."C:\\included_new.json"

Example 

PUT aspire/_api/seeds/2f287669-d163-4e35-ad17-6bbfe9df3778
{
  "id": "2f287669-d163-4e35-ad17-6bbfe9df3778",
  "type": "db-server",
  "seed": "dbserver_seed",
  "connector": "a320a91c-2a48-4402-a5f1-c7d2fa913ba2",
  "description": "DBSeed",
  "throttlePolicy": null,
  "connection": "b76ed996-2b0c-4ebc-8b0d-9a9e5821f2e3",
  "workflows": [
    "f51f5162-faaf-43dc-aa89-3b872160f504"
  ],
  "tags": [],
  "properties": {
    "seed": "dbserver_seed",
    "excludeFile": "exclude_new.json",
    "includeFile": "include_new.json"
  }
}
  • No labels