Data Sync - Create Destination Table

URI

https://164.99.19.131:8443/SentinelRESTServices/datasync/table

Supported Methods

POST

This creates a destination table to sync events to.

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 is to 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 is to 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 is to 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 is to be created. If this parameter is missing, the default value will be "appuser". NOTE: This user should have sufficient rights to create a table.
dbPlatform String postgresql This is the platform of the database system where the destination table is to 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 to create
FieldRequiredDescription
columnsfalseThis is a nested JSON object that specifies the table columns to be created 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 it is ok to also create a sync state table in the destination database. If "true", the sync state table will only be created if it does not already exist.
tablefalseThis is a nested JSON <B>&lt;Table&gt;</B> object that specifies the destination table that is to be created. See below for description of fields in Table objects.
tableIndexesfalseThis is a nested JSON object that specifies the indexes to be created 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 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, the default tablespace will be used.
schemaNamefalseName of the schema for the destination table that is to be created. NOTE: This is an optional field. It will default to the schema of the database user specified in the "userName" URL parameter.
tableNamefalseName of the destination table that is to be created.
tableSpacefalseName of the tablespace in the destination database where the destination table is to be created. NOTE: If this field is missing, the default tablespace will be used.

Request Data

Object type: Table Sql columns creation
Information on what table columns to create
FieldRequiredDescription
columnNamefalseName of column in the destination table that is to 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 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 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 status
Details on the table creation
FieldDescription
schemaNameThis is the schema the destination table was created in.
tableNameThis is the destination table name that was created.

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;   "schemaName": "my_schema",&#10;   "tableName": "my_event_table",&#10;}&#10;