Hi,
I want to retrieve the polling iip port' for an element in automation.
Retreiving the ip address is easy enough but we have some elements that use http (ip port 80) while others have https enabled (using ip port 443) and I need to address these differently from automation.
So I would like to be able to find out what port tcp_ip requests are being issued on for a specific element.
Thans in advance for your support.
Hi Hans,
You can achieve this by making use of the Class Library
IDms myDms = engine.GetDms();
IDmsElement myElement = myDms.GetElement("element name");
foreach (var connection in myElement.Connections)
{
if (connection is HttpConnection httpConnection)
{
engine.Log(httpConnection.TcpConfiguration.RemotePort);
}
}
or by using the Engine class
Element myElement = engine.FindElement("element name");
foreach (var connection in myElement.RawInfo.PortInfo)
{
engine.Log(connection.PollingIPPort);
}
Hi Hans, you can access these classes by adding below references.
using Skyline.DataMiner.Library.Automation;
using Skyline.DataMiner.Library.Common;
Hoi Jens,
not working I am afraid.
I added below line in the ‘DLL references’:
C:Skyline DataMinerFilesSkyline.DataMiner.Common.dll
and used ‘using Skyline.DataMiner.Common;’
but still no good…
Hi Hans, are you using Automation as a solution in VS? If so, would it be possible to verify your DIS settings so that a) Class Library feature is enabled and b) Class Library code is generated automatically as mentioned in https://docs.dataminer.services/develop/TOOLS/DIS/Reference/DIS_settings.html#class-library?
Hello Hans,
If you already have protocols that use NuGet packages the easiest way to include these DLL references is by adding these paths (or similar, based on the version) where you’ve added the reference you mentioned:
C:Skyline DataMinerProtocolScriptsDllImportslc.lib.automation1.3.0.2libnet462SLC.Lib.Automation.dll
C:Skyline DataMinerProtocolScriptsDllImportslc.lib.common1.3.0.2libnet462SLC.Lib.Common.dll
1.3.0.2 is the version I was using in this case.
In case you don’t have this you can also try and Generate the class library from DIS using Visual Studio as Jens has mentioned. Keep in mind that the first suggestion is the current suggestion for new automation scripts.
Hope this helps.
Thanks Jens for the prompt reply. How do I refer to this class in an automation script (c#) ?