TableauServerUrls.Url_DatasourceConnectionsList C# (CSharp) Method

Url_DatasourceConnectionsList() private method

URL for a Datasource's connections list
private Url_DatasourceConnectionsList ( TableauServerSignIn, session, string datasourceId ) : string
session TableauServerSignIn,
datasourceId string
return string
    internal string Url_DatasourceConnectionsList(TableauServerSignIn session, string datasourceId)
    {
        throw new NotImplementedException("2015-11-16, Tableau Server does not yet have a REST API to support this call");
    }

Usage Example

Beispiel #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="serverName"></param>
    public void ExecuteRequest()
    {
        var dsConnections = new List <SiteConnection>();

        //Create a web request, in including the users logged-in auth information in the request headers
        var urlQuery   = _onlineUrls.Url_DatasourceConnectionsList(_onlineSession, _datasourceId);
        var webRequest = CreateLoggedInWebRequest(urlQuery);

        webRequest.Method = "GET";

        _onlineSession.StatusLog.AddStatus("Web request: " + urlQuery, -10);
        var response = GetWebReponseLogErrors(webRequest, "get datasources's connections list");
        var xmlDoc   = GetWebResponseAsXml(response);

        //Get all the workbook nodes
        var nsManager   = XmlHelper.CreateTableauXmlNamespaceManager("iwsOnline");
        var connections = xmlDoc.SelectNodes("//iwsOnline:connection", nsManager);

        //Get information for each of the data sources
        foreach (XmlNode itemXml in connections)
        {
            try
            {
                var connection = new SiteConnection(itemXml);
                dsConnections.Add(connection);
            }
            catch
            {
                AppDiagnostics.Assert(false, "Workbook  connections parse error");
                _onlineSession.StatusLog.AddError("Error parsing workbook: " + itemXml.InnerXml);
            }
        } //end: foreach

        _connections = dsConnections;
    }