Connection-level Interface Management
All currently available connection-level interface templates are listed in the CliTemplates
system table. It has the following fields:
Column Name | Type | Description |
---|---|---|
| biginteger | Template ID |
name | string | Template name |
createScript | string | CLI script which creates a data source/resource adapter |
dropScript | string | CLI script which removes a data source/resource adapter |
hiddenProps | string | Comma-separated list of properties that will be stored encrypted |
creationDate | timestamp | Template creation date |
lastModifiedDate | timestamp | Template last modification date |
creator | string | Name of the user who created the template |
modifier | string | Name of the user who last modified the template |
translator | string | Translator name |
SYSADMIN.addCliTemplate
This procedure adds a new CLI template with a specified name.
CREATE FOREIGN PROCEDURE addCliTemplate(IN name string NOT NULL, IN createScript string NOT NULL, IN dropScript string NOT NULL, IN hiddenProps string, OUT id biginteger NOT NULL RESULT)
Example
CALL "SYSADMIN.addCliTemplate"(
"name" => 'mongodb2'/* Optional */,
"properties" => '
property "host" {default "localhost"}
property "server" { default "localhost"; }
property "port" { type "int"; default "27017" }
property "database" { required; quoted }
property "authSource" { quoted }
property "readMode" { quoted }
property "options" { quoted }
property "login" {}
property "password" { quoted; hidden }
'/* Optional */,
"createScript" => '{
param ra pool size "0" "100";
start ra "dv-connector-mongodb.rar" "com.datavirtuality.dv.core.resource.adapter.mongodb.MongoDbManagedConnectionFactory";
ifset (host) {
param ra "server" host;
} else {
param ra server;
}
param ra port;
param ra database;
ifset (authSource)
param ra authSource;
ifset (readMode)
param ra readMode;
ifset (options)
param ra options;
ifset (login)
param ra login;
ifset (login)
param ra password;
enable ra;
}'/* Optional */,
"dropScript" => '{ remove ds; }'/* Optional */,
"translator" => 'mongodb'/* Optional */
);;
SYSADMIN.editCliTemplate
This procedure edits a CLI template with a specified id assigning it a new name
, createScript
, and dropScript
. name
, createScript
, and dropScript
may be set to NULL
. Properties that should be stored encrypted can be specified by providing them as a comma-separated list via hiddenProps
.
Arguments set to NULL
will not be changed during the call.
CREATE FOREIGN PROCEDURE editCliTemplate(IN id biginteger NOT NULL, IN name string, IN createScript string, IN dropScript string, IN hiddenProps string)
Example
CALL "SYSADMIN.editCliTemplate"(
"id" => 9/* Mandatory */,
"name" => 'mongodb2'/* Optional */,
"properties" => '
property "host" {default "localhost"}
property "server" { default "localhost"; }
property "port" { type "int"; default "27017" }
property "database" { required; quoted }
property "authSource" { quoted }
property "readMode" { quoted }
property "options" { quoted }
property "login" {}
property "password" { quoted; hidden }
'/* Optional */,
"createScript" => '{
param ra pool size "0" "100";
start ra "dv-connector-mongodb.rar" "com.datavirtuality.dv.core.resource.adapter.mongodb.MongoDbManagedConnectionFactory";
ifset (host) {
param ra "server" host;
} else {
param ra server;
}
param ra port;
param ra database;
ifset (authSource)
param ra authSource;
ifset (readMode)
param ra readMode;
ifset (options)
param ra options;
ifset (login)
param ra login;
ifset (login)
param ra password;
enable ra;
}'/* Optional */,
"dropScript" => '{ remove ds; }'/* Optional */,
"translator" => 'mongodb'/* Optional */
);;
SYSADMIN.dropCliTemplate
This procedure drops a CLI template with the specified id.
CREATE FOREIGN PROCEDURE dropCliTemplate(IN id biginteger NOT NULL)
SYSADMIN.resetCliTemplates
This procedure restores default templates.
CREATE FOREIGN PROCEDURE resetCliTemplates()