Data Sync - Get List of Columns For a Table

URI

https://164.99.19.131:8443/SentinelRESTServices/datasync/tablecolumns

Supported Methods

GET

This gets a list of columns for a particular table in a destination database.

Authentication

Authentication Types
Sentinel Permissions Needed

Supported Formats

Response

URL Parameters

Required

ParameterTypeDescription
password String The password of the user.
schemaName String This is the name of the table. It should be the same as the table name passed in the <B>tableName</B> URL parameter.
tableName String This is the name of the schema of the table whose indexes are to be returned. If this parameter is not supplied, the request will find the first table that matches the tableName parameter, ignoring whatever schema the table belongs to.

Optional

ParameterTypeDefault ValueDescription
hostName String localhost Name or IP address of database system to be queried. If this parameter is missing, the default value will be "localhost".
port int 5432 Port for communicating with the database system to be queried. If this parameter is missing, the default value will be "5432".
database String SIEM The name of the database in the database system to be queried. If this parameter is missing, the default value will be "SIEM".
userName String appuser Name of the database user to login to the database system to be queried. If this parameter is missing, the default value will be "appuser".
dbPlatform String postgresql This is the platform of the database system to be queried. It may be <strong>postgresql</strong>, <strong>oracle11g</strong> or <strong>mssql2008</strong>. If this parameter is missing, the default value will be "postgresql".

Success Codes

Fault Codes

Response Data

Object type: Database table
Information about a given database table
FieldDescription
columnsThis is a nested JSON object that returns the columns for the table. Note that it contains a single internal field <B>column</B> that is an array of <B>&lt;Column&gt;</B> objects. See below for description of fields in Column objects.
schemaNameThis is the schema the table belongs to. If a <B>schemaName</B> URL parameter was passed, it should be the same. If no <B>schemaName</B> URL parameter was passed, this will return the schema name of the table that was found.
tableNameThis is the name of the table. It should be the same as the table name passed in the <B>tableName</B> URL parameter.

Response Data

Object type: Database table columns
Information about the columns for a given table
FieldDescription
columnNameName of column in the table.
columnSizeSize of column. NOTE: This only applies if the column type is a VARCHAR.
columnTypeData type of database column. Should be a java.sql.Types value (BIGINT, VARCHAR, etc.).
nullableFlag indicating whether the column can have null values. 0=Nulls not allowed, 1=Nulls allowed, 2=Unknown if nulls allowed.

Sample Request

GET /datasync/tablecolumns?hostName=164.99.19.125&port=5432&userName=appuser&password=star1111&dbPlatform=postgresql&schemaName=my_schema&tableName=my_table_name
Sample Response for application/json
Status: 200
{&#10;   "tableName": "my_table_name",&#10;   "schemaName": "my_schema",&#10;   "columns": {"column":[{&lt;Column&gt;},{&lt;Column&gt;}...]}&#10;}&#10;&#10;Column Fields&#10;{&#10;   "columnName": "msg",&#10;   "columnType": "12",&#10;   "nullable": "1",&#10;   "columnSize": "4000"&#10;}&#10;