SetMetabaseLink

Syntax

MetabaseLinkResult SetMetabaseLink(OdId tOb, SetMetabaseLinkArg tArg)

Parameters

tOb. Repository connection moniker.

tArg. Operation execution parameters.

Description

The SetMetabaseLink operation changes repository connection metadata.

Comments

The operation changes 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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetMetabaseLink xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>S1!M!S!ML7</id>
  </tOb>
<tArg xmlns="">
<meta>
<metabaseLinkParams>
  <loginPrompt>false</loginPrompt>
  <useMetabaseCredentials>true</useMetabaseCredentials>
  </metabaseLinkParams>
  </meta>
  </tArg>
  </SetMetabaseLink>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetMetabaseLinkResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!ML7</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="7" hf="0">
  <i>MB_LINK</i>
  <n>Repository connection</n>
  <k>174241</k>
  <c>8193</c>
  <p>9050</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>0</dirty>
<metabaseLinkParams>
  <user>sa</user>
  <pass>Qwerty1</pass>
<logonDataExt>
  <driver>MSSQL2008</driver>
  <server>%METABASE_SERVER%</server>
  <database>WAREHOUSE</database>
  <schema>dbo</schema>
  <unicode>0</unicode>
  <authentication>Password</authentication>
  <caseSensitive>0</caseSensitive>
  </logonDataExt>
  <useUnicode>0</useUnicode>
  <loginPrompt>0</loginPrompt>
  <useMetabaseCredentials>1</useMetabaseCredentials>
  <useDeferredLoading>0</useDeferredLoading>
  </metabaseLinkParams>
  </meta>
  </SetMetabaseLinkResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetMetabaseLink" :
{
"tOb" :
{
"id" : "S1!M!S!ML7"
},
"tArg" :
{
"meta" :
{
"metabaseLinkParams" :
{
"loginPrompt" : "false",
"useMetabaseCredentials" : "true"
}
}
}
}
}

JSON response:

{
"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" : "WAREHOUSE",
"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:

Working with Relational Objects of Repository