Data Sync - Create Destination Table SQL

URI

https://164.99.19.131:8443/SentinelRESTServices/datasync/tablesql

Supported Methods

POST

This creates the SQL that would be used to create a destination table to sync events to. This allows the caller to preview the SQL that would be used. The SQL for any indexes will also be returned, as well as the SQL to create the sync status table, if requested.

Authentication

Authentication Types
Sentinel Permissions Needed

Supported Formats

Request

Response

URL Parameters

Required

ParameterTypeDescription
password String The password of the user.

Optional

ParameterTypeDefault ValueDescription
hostName String localhost Name or IP address of database system where the destination table would be created. If this parameter is missing, the default value will be "localhost".
port int 5432 Port for communicating with the database system where the destination table would be created. If this parameter is missing, the default value will be "5432".
database String SIEM The name of the database in the database system where the destination table would be created. 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 where the destination table would be created. If this parameter is missing, the default value will be "appuser".
dbPlatform String postgresql This is the platform of the database system where the destination table would be created. 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

Request Data

Object type: Table Sql creation
Information on what table sql to create
FieldRequiredDescription
columnsfalseThis is a nested JSON object that specifies the table 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.
okToCreateSyncStateTablefalseThis is a flag that indicates whether to return the SQL for creating a sync state table in the destination database.
tablefalseThis is a nested JSON <B>&lt;Table&gt;</B> object that specifies the destination table that would be created. See below for description of fields in Table objects.
tableIndexesfalseThis is a nested JSON object that specifies the indexes for the table. Note that it contains a single internal field <B>tableIndex</B> that is an array of <B>&lt;Table Index&gt;</B> objects. See below for description of fields in Table Index objects. This field is optional. If missing, no indexes will be created.

Request Data

Object type: Table Sql columns creation
Information on what table fields sql to create
FieldRequiredDescription
indexSpacefalseName of the tablespace in the destination database where the table indexes (if any) are to be created. NOTE: If this field is missing, tablespace specification for indexes will not be included in the returned SQL.
schemaNamefalseName of the schema for the destination table that would be created. NOTE: This is an optional field. It will not be included in the returned SQL if omitted.
tableNamefalseName of the destination table that would be created.
tableSpacefalseName of the tablespace in the destination database where the destination table would be created. NOTE: If this field is missing, tablespace specification for the table will not be included in the returned SQL.

Request Data

Object type: Table Sql columns creation
Information on what table columns sql to create
FieldRequiredDescription
columnNamefalseName of column in the destination table that would be created.
columnSizefalseSize of database column. NOTE: This only applies if the database column is a VARCHAR.
columnTypefalseData type of database column. Should be a java.sql.Types value (BIGINT, VARCHAR, etc.).
nullablefalseFlag indicating whether database column can have null values. 0=Nulls not allowed, 1=Nulls allowed, 2=Unknown if nulls allowed.

Request Data

Object type: Table Sql index columns creation
Information on what table index columns sql to create
FieldRequiredDescription
indexColumnsfalseThis is a nested JSON object that specifies the index columns. Note that it contains a single internal field indexColumn that is an array of <Index Column> objects. See below for description of fields in Index Column objects.
indexNamefalseName of index to be created for the destination table.
uniquefalseFlag (true or false) indicating whether the index is a unique index.

Request Data

Object type: Table Sql index creation
Information on the index columns sql to create
FieldRequiredDescription
columnNamefalseName of index to be created for the destination table.
sortSequencefalseValue indicating whether the column values are to be sorted in ascending or descending order. A value of "A" should be used for ascending, and a value of "D" should be used for descending. This may be omitted if neither ascending or descending is applicable.

Response Data

Object type: Create Table SQL
SQL statement that matches the requested create table request
FieldDescription
valueThis field contains the SQL statement that would be used to create the table, as well as any SQL statements that would be used to create indexes for the table. Also, it will include the SQL needed to create the sync status table if the okToCreateSyncStateTable field is "true" in the request.

Sample Request

POST /datasync/table?hostName=164.99.19.125&port=5432&userName=appuser&password=star1111&dbPlatform=postgresql
{&#10;   "table": {&lt;Table&gt;},&#10;   "columns": {"column":[{&lt;Column&gt;},{&lt;Column&gt;}...]},&#10;   "tableIndexes": {"tableIndex":[{&lt;Table Index&gt;},{&lt;Table Index&gt;}...]},&#10;   "okToCreateSyncStateTable": "true",&#10;}&#10;Table Fields&#10;{&#10;   "schemaName": "my_schema",&#10;   "tableName": "my_event_table",&#10;   "tableSpace": "tablespace1",&#10;   "indexSpace": "tablespace2",&#10;}&#10;Column Fields&#10;{&#10;   "columnName": "msg",&#10;   "columnType": "12",&#10;   "nullable": "1",&#10;   "columnSize": "4000"&#10;}&#10;Table Index Fields&#10;{&#10;   "indexName": "evt_id_index",&#10;   "indexColumns": {"indexColumn":[{&lt;Index Column&gt;},{&lt;Index Column&gt;}...]},&#10;   "unique": "true"&#10;}&#10;Index Column Fields&#10;{&#10;   "columnName": "evt_id",&#10;   "sortSequence": "A"&#10;}&#10;
Sample Response for application/json
Status: 200
{&#10;"value": "CREATE TABLE my_event_Table ....."&#10;}&#10;