OpItemKey SemanticLayerSetPattern(string mon, SemanticLayerPatternArg tArg)
mon. Moniker for working with preconfigured DBMS connection templates.
tArg. Settings of created/changed preconfigured DBMS connection template.
The SemanticLayerSetPattern operation creates or changes preconfigured DBMS connection template.
To execute the operation, in the mon field specify moniker of opened data model instance with the !Patterns postfix. To create a new template, in the tArg.index field specify empty value and in the tArg.connectionParams and tArg.name fields specify DVBMS connection settings and name of created template.
To change the existing template, in the tArg.index field specify its key, and in the tArg.connectionParams field specify new connection settings. The moniker can be obtained on executing the OpenSemanticLayer operation.
The operation results in the key of the created template or the 0 value if the existing template was changed.
Below is the example of creating a new preconfigured DBMS connection template. The request contains moniker for working with preconfigured templates and connection settings. The response contains key of the created preconfigured template.
{
"SemanticLayerSetPattern" :
{
"mon" : "KPACNCCOCDBDGOAEFDJDAIBAMJFFBCDEDJLPICPCMCFDIKCG!M!S!PLDNOFGCOCDBDGOAEMEKOCGKLAEFDMALEOIGKKCECKAAGLFHC!Patterns",
"tArg" :
{
"connectionParams" :
{
"user" : "User",
"pass" : "Password",
"logonDataExt" :
{
"driver" : "MSSQL2012ODBC",
"server" : "DBServer",
"database" : "Repository"
}
},
"name" : "Connection template"
}
}
}
{
"SemanticLayerSetPatternResult" :
{
"k" : "358700"
}
}
public static OpItemKey SemanticLayerSetPattern(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SemanticLayerSetPattern()
{
tArg = new SemanticLayerPatternArg()
{
index = null,
name = "Connection template",
connectionParams = new ConnectionParams()
{
logonDataExt = new MbLogonDataExt()
{
database = "Repository",
driver = "MSSQL2012ODBC",
server = "DBServer"
},
user = "User",
pass = "Password"
}
},
// Moniker for working with preconfigured templates
mon = moniker + "!Patterns"
};
// Create a new preconfigured DBMS connection template
var result = somClient.SemanticLayerSetPattern(tSet);
return result;
}
See also: