MetabaseLinkResult SetMetabaseLink(OdId tOb, SetMetabaseLinkArg tArg)
tOb. Repository connection moniker.
tArg. Operation execution parameters.
The SetMetabaseLink operation changes repository connection metadata.
The operation enables the user to change repository connection settings, to which the connection is set up. The repository connection should be opened for edit. To execute the operation, in the tOb field specify moniker of the repository object that is repository connection, and in the tArg.meta field specify updated metadata containing repository connection settings. The moniker can be obtained on executing the OpenMetabaseLink operation. The changes are saved automatically on executing the operation.
The example of changing repository connection parameters. The request contains moniker of opened repository connection instance and values of parameters to be set (automatic connection and use of credentials specified on repository connection). The response contains updated metadata.
{
"SetMetabaseLink" :
{
"tOb" :
{
"id" : "S1!M!S!ML7"
},
"tArg" :
{
"meta" :
{
"metabaseLinkParams" :
{
"loginPrompt" : "false",
"useMetabaseCredentials" : "true"
}
}
}
}
}
{
"SetMetabaseLinkResult" :
{
"id" :
{
"id" : "S1!M!S!ML7"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "7",
"@hf" : "0",
"i" : "MB_LINK",
"n" : "Repository connection",
"k" : "174241",
"c" : "8193",
"p" : "9050",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"metabaseLinkParams" :
{
"user" : "sa",
"pass" : "Qwerty1",
"logonDataExt" :
{
"driver" : "MSSQL2008",
"server" : "%METABASE_SERVER%",
"database" : "PPrepository_data",
"schema" : "dbo",
"unicode" : "0",
"authentication" : "Password",
"caseSensitive" : "0"
},
"useUnicode" : "0",
"loginPrompt" : "0",
"useMetabaseCredentials" : "1",
"useDeferredLoading" : "0"
}
}
}
}
public static MetabaseLinkResult ChangeMBLink(string moniker, bool loginPromptValue, bool useMetabaseCredentialsValue)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetMetabaseLink()
{
tArg = new SetMetabaseLinkArg()
{
meta = new MetabaseLinkMd()
{
metabaseLinkParams = new MetabaseLinkParams()
{
loginPrompt = loginPromptValue,
useMetabaseCredentials = useMetabaseCredentialsValue
}
}
},
tOb = new OdId() { id = moniker }
};
//Change parameters
var tResult = somClient.SetMetabaseLink(tSet);
return tResult;
}
See also: