0

API Dataset Files

Is it possible to view the files in a dataset from the API or using the SAF_Helper DLL? I know I can create a new file, but is there a way to view the files in the dataset before creating a new file?

4 replies

null
    • smason
    • 5 mths ago
    • Reported - view

    Hi hmatuse ,

    Unfortunately, there is no function to view the files themselves. You can see views and datasets, but not the physical file.

      • hmatuse
      • 5 mths ago
      • Reported - view

      Steve Mason Thanks for the reply

    • laruer
    • 5 mths ago
    • Reported - view

    If you are willing to use PowerShell or .NET, you can get the list of HDB files from a particular dataset using the Canary Administrator WCF service. You have to create a WCF client using CanaryAdmin.exe. Below is a sample PowerShell script:

    param(
        [string]$CanaryServer,
        [string]$DataSet,
        [string]$CanaryAdminPath = "C:\Program Files\Canary\Canary Admin\CanaryAdmin.exe"
    )
    $null = [Reflection.Assembly]::LoadWithPartialName("System.ServiceModel")
    $uri = "net.tcp://$CanaryServer`:55273/admin/windows"
    $binding = New-Object System.ServiceModel.NetTcpBinding
    $binding.ReceiveTimeout = [System.TimeSpan]::FromMinutes(5)
    $binding.SendTimeout = [System.TimeSpan]::FromMinutes(5)
    $binding.Security.Transport.ClientCredentialType = [System.ServiceModel.TcpClientCredentialType]::Windows
    $endpointAddress = New-Object System.ServiceModel.EndpointAddress (New-Object Uri $uri)
    [Reflection.Assembly]::LoadFile($CanaryAdminPath) | Out-Null
    $client = [CanaryAdmin.CanaryAdminService.AdminContractClient]::new($binding, $endpointAddress)
    $errMsg = $null
    $client.GetHDBList([ref]$errMsg,$DataSet)

    You can run the script with the hostname of the Canary server and the name of the dataset. The Canary Admin tool must also be installed on the same machine for it to work. Save the content of the script to a file named Get-CanaryHDBList.ps1 and then from a PowerShell command prompt, run the following command:

    .\Get-CanaryHDBList.ps1 -CanaryServer YOURSERVERNAME -Dataset WellPumps
      • hmatuse
      • 5 mths ago
      • Reported - view

      laruer this is interesting! I will look into this later today, thank you!

Content aside

print this pagePrint this page
  • 5 mths agoLast active
  • 4Replies
  • 62Views
  • 4 Following