Viewing or modifying your SQL DI server settings by using the REST API
You can use the SQL Data Insights (SQL DI) REST API to modify and manage the application server settings.
Procedure
- In your REST API client, start a new HTTPS request in JSON format.
See https://<SQLDI-IPAddress>:<SQLDI-PortNumber>/swagger or Db2 SQL Data Insights REST APIs for a full list of SQL DI REST API endpoints, options, descriptions, and examples.
- If you have not done so, generate a
bearer
authentication token.Specify the tokenTTL option so that you can use the token for the current request before it expires. See Generating an authentication token with SQL DI REST API for instructions.
- If needed, view the default SQL DI server settings by creating a new HTTPS GET request in JSON format:
- In the request header, specify the
Authorization
parameter. - Send the new GET request to the following address:
GET https://<SQLDI-IPAddress>:<SQLDI-PortNumber>/sqldi/v2/settings/default
If your request is successful, you will receive a response like the following example:
{ "settings": { "BASE10_CLUSTER_THREADS": "2", "LOAD_CTL_TEMPLATE": "TEMPLATE SORTIN DSN &JO..&ST..SORTIN.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) TEMPLATE SORTOUT DSN &JO..&ST..SORTOUT.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) TEMPLATE MAP1 DSN &JO..&ST..MAP1.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) LOAD DATA INDDN SYSCLIEN WORKDDN(SORTIN,SORTOUT) MAPDDN(MAP1) REPLACE LOG(NO) REUSE NOCOPYPEND UNICODE CCSID(1208)", "MAX_QUERY_RECORDS": "1000", "SPARK_DRIVER_CORES": "1", "SPARK_DRIVER_MEMORY": "2G", "SPARK_EXECUTOR_CORES": "1", "SPARK_EXECUTOR_MEMORY": "2G", "TRAINING_THREADS": "12" } }
- In the request header, specify the
- If needed, modify the SQL DI server settings by creating a new HTTPS PATCH request in JSON format:
- In the request header, specify the
Authorization
parameter. - In the request body, update the settings of the following options if needed.
{ "settings": { "SPARK_DRIVER_CORES": "1", "SPARK_EXECUTOR_MEMORY": "2G", "BASE10_CLUSTER_THREADS": "2", "SPARK_DRIVER_MEMORY": "2G", "LOAD_CTL_TEMPLATE": "TEMPLATE SORTIN DSN &JO..&ST..SORTIN.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) TEMPLATE SORTOUT DSN &JO..&ST..SORTOUT.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) TEMPLATE MAP1 DSN &JO..&ST..MAP1.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) LOAD DATA INDDN SYSCLIEN WORKDDN(SORTIN,SORTOUT) MAPDDN(MAP1) REPLACE LOG(NO) REUSE NOCOPYPEND UNICODE CCSID(1208)", "TRAINING_THREADS": "12", "SPARK_EXECUTOR_CORES": "1", "MAX_QUERY_RECORDS": "1000" } }
- Send the new POST request to the following address:
PATCH https://<SQLDI-IPAddress>:<SQLDI-PortNumber>/sqldi/v2/settings
If your request is successful, you will receive a response like the following example:
SQL DI settings were saved successfully.
- In the request header, specify the
- If needed, view the current SQL DI server settings by creating a new HTTPS GET request in JSON format:
- In the request header, specify the
Authorization
parameter. - Send the new GET request to the following address:
GET https://<SQLDI-IPAddress>:<SQLDI-PortNumber>/sqldi/v2/settings
If your request is successful, you will receive a response like the following example:
{ "settings": { "BASE10_CLUSTER_THREADS": "2", "LOAD_CTL_TEMPLATE": "TEMPLATE SORTIN DSN &JO..&ST..SORTIN.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) TEMPLATE SORTOUT DSN &JO..&ST..SORTOUT.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) TEMPLATE MAP1 DSN &JO..&ST..MAP1.T&TIME. UNIT SYSALLDA SPACE(100,100) CYL DISP(NEW,DELETE,DELETE) VOLUMES(DUMP04) LOAD DATA INDDN SYSCLIEN WORKDDN(SORTIN,SORTOUT) MAPDDN(MAP1) REPLACE LOG(NO) REUSE NOCOPYPEND UNICODE CCSID(1208)", "MAX_QUERY_RECORDS": "1000", "SPARK_DRIVER_CORES": "1", "SPARK_DRIVER_MEMORY": "2G", "SPARK_EXECUTOR_CORES": "1", "SPARK_EXECUTOR_MEMORY": "2G", "TRAINING_THREADS": "12" } }
- In the request header, specify the