Loader Connections

/api/admin/loaderconnections

List all loader connections

GET /api/admin/loaderconnections

Returns a list of all loader connections.

GET /api/admin/loaderconnections HTTP/1.1
Response Code Reason
200 No error

The response will be a Standard Response.

Please note that Loader Connection response has been changed as follows:

  • Type column now returns ‘fixed-length’ instead of ‘trillium’ for fixed-length connections
  • Enabled and Single Sign-On columns now returns Yes/No instead of 1/0
  • Repository Access returns ‘None’ instead of blank when no repository access has been restricted
  • Note Count column updated to return 0 when no notes are available
  • Added missing columns Created By, Created Date, Edited By, Edited Date and Note Count

The columns displayed for each loader connection are:

Human Name Column Name Description
Connection Id CONNECTION Unique identifier of the connection
Name NAME The name of the connection
Type _type The connection type
Description DESCRIPTION A description of the connection
Parameters PARAMETERS The connection parameters
Filter _defaults The default source filter
Repository Access _access Repositories with access to this loader connection
Single Sign-On _sso Is Single Sign-On used for this connection?
Enabled _enabled Available for new connections
Created By CREATED_BY User that created the connection
Created Date _created_date When the connection was created
Edited By EDITED_BY User that last edited the connection
Edited Date _edited_date When the connection was edited
Note Count _note_count Number of notes

The rows array will contain one element for each loader connections:

{
    "dataRow": [
        "1",
        "TSQ",
        "fixed-length",
        "Default TSQ file connection",
        "SCHEMA_DIRECTORY {C:/Trillium Software/MBSW/16/Data/import/schemas} DATA_DIRECTORY {C:/Trillium Software/MBSW/16/Data/import/data} SCHEMA_EXTENSIONS ddx DATA_EXTENSIONS dat",
        "*",
        "All",
        "No",
        "Yes",
        "madmin",
        "2017/03/14 16:13:23",
        "",
        "",
        "0"
    ]
    "metadata": {
        "url": "/api/admin/loaderconnections/1"
    }
}

List a specific loader connection

GET /api/admin/loaderconnections/(int: loaderConnectionID)

Returns a specific loader connection.

GET /api/admin/loaderconnections/1 HTTP/1.1

The response will be the same as shown above with a single element returned in the rows array. If the specified loader connection does not exist, rows will be empty.

Post —

POST /api/admin/loaderconnections

Allows to post various commands to manage loader connections.

JSON Parameters:
 
  • body – The request body
POST /api/admin/loaderconnections HTTP/1.1
Content-Type: application/json

{
    "command": "<loader connection command>",
    "data": {}
}

The commands that can be performed against loader connections are as follows:

Command Purpose
add Add a new loader connection
edit Edit an existing loader connection (including enable/disable loader connection)

The response depends on which operation was performed.

Command Response
add Returns status 200 - URL of the connection
edit Returns status 200 - URL of the connection

A post request may return any of the following status codes:

Response Code Reason
200 Success (URL of the connection)
400 Invalid request body (any request errors)
500 Server error

Get

The request to get a list of loader connections looks like:

POST /api/admin/loaderconnections HTTP/1.1
Content-Type: application/json

{
    "command": "get",
    "options": {
        "where": "'Connection Id' = 1"
    }
}

The request packet must contain the command element.

Add

To add a loader connection, the request may contain the fields below:

{
    "command": "add",
    "data": {
        "name": "cobolLoader",
        "type": "cobol",
        "description": "loader type cobol",
        "parameters": {
            "dataDirectory": "C:/Trillium Software/MBSW/16/Data/import/data",
            "dataExtensions": "txt csv dat",
            "schemaDirectory": "C:/Trillium Software/MBSW/16/Data/import/schemas",
            "schemaExtensions": "ddl"
        },
        "defaults": "",
        "metabaseName": [ "repository1", "repository2" ],
        "authentication": "0"
    }
}

The required fields for adding a loader connection are:

  • name
  • type
  • description
  • parameters

The type and parameters fields are mutually dependent. The data supplied within parameters field is dependent on the type of connection selected. See connection types for more information.

The other remaining fields are optional; it is possible to add a loader connection without specifying them.

The metabaseName field is used to select one or more repositories that are to be given access to this loader connection. This field can be omitted or left empty to allow all repositories to access this loader connection.

The authentication field if supplied, can only be set to 1 (Enabled) for connection type odbc or generic, otherwise it must set to 0 (Disabled).

When a new loader connection is added it will be enabled by default. If the enabled field is specified in the request, the connection will be enabled or disabled depending on the value of the field.

For example, to add an HDFS Loader Connection, use fields similar to the following:

{
    "command" : "add",
    "data": {
        "name": "HDFS Delimited",
        "type": "hdfs_delimited",
        "enabled": 1,
        "description": "Delimited HDFS Loader Connection",
        "defaults": "*",
        "metabaseName": "",
        "authentication": "0",
        "parameters": {
            "nameNodeAddress": "hdfs://hdp2-02-master.syncdi1.us.syncsort.com:8020",
            "dataDirectory": "/user/apatel/data/data1",
            "dataExtensions": "txt csv",
            "schemaDirectory": "/user/apatel/data/data1",
            "schemaExtensions": "ddl"
        }
    }
}

Edit

To edit a loader connection, the request may contain the fields below:

{
    "command": "edit",
    "data": {
        "connection": "8",
        "name": "cobolLoader1",
        "type": "cobol",
        "description": "loader type cobol",
        "parameters": {
            "dataDirectory": "C:/ProgramData/Trillium Software/MBSW/16/Data/import/data",
            "dataExtensions": "txt csv dat",
            "schemaDirectory": "C:/ProgramData/Trillium Software/MBSW/16/Data/import/schemas",
            "schemaExtensions": "ddl"
        },
        "defaults": "",
        "metabaseName": [],
        "authentication": "0"
    }
}

The required fields for editing an existing loader connection are:

  • connection
  • Any field(s) that needs to be updated

The name, type, description and parameters fields are optional; if supplied, they cannot be left empty. It is possible to edit a loader connections without specifying these fields.

The type and parameters fields are mutually dependent. The data supplied within the parameters field is dependent on the type of connection selected. See connection types for more information.

The other remaining fields are optional; it is possible to edit a connection without specifying them.

The metabaseName field is used to select one or more repositories that are to be given access to this loader connection. When editing this field can be omitted to leave previous selections unchanged or can be left empty to allow all repositories to access this loader connection.

The authentication field, if supplied, can only be set to 1 (Enabled) for connection type odbc or generic; otherwise, it must be set to 0 (Disabled).

Enable/Disable Loader Connection

To enable or disable a loader connection, the request must contain the fields below:

{
    "command": "edit",
    "data": {
        "connection": "8",
        "enabled": "1"
    }
}

The required fields for enabling or disabling an existing loader connection are:

  • connection
  • enabled

The loader connection can be enabled or disabled as follows:

  • Set enabled field to 1 to enable a loader connection
  • Set enabled field to 0 to disable a loader connection