Hello everyone.
I am trying to create a new element using the IDms and ElementConfiguration classes from an automation Script, although I have been able to set almost everything, I haven't figure out how can I set this values
So, is there a way to set this configuration using the mentioned classes?
This is the code that I am using, is basically the snippet to create an element.
// Create the element
IDms dms = engine.GetDms();
IDma agent = dms.GetAgent(DmaHostID);
IDmsProtocol protocol = dms.GetProtocol(ProtocolDropdown.Selected, sProductionVersion);
IUdp port = new Udp(IPAddress.Text, 161);
ISnmpV2Connection snmpv2 = new SnmpV2Connection
{
UdpConfiguration = port,
DeviceAddress = IPAddress.Text,
GetCommunityString = GetCommunityStringCCAP.Text,
SetCommunityString = SetCommunityStringCCAP.Text,
Timeout = new TimeSpan(0, 0, 0, 110),
Retries = iRetries,
ElementTimeout = new TimeSpan(0, 0, 0, 120),
};
ElementConfiguration configuration = new ElementConfiguration(dms, ElementName.Text, protocol, new List<IElementConnection> { snmpv2 });
configuration.Description = ElementName.Text;
configuration.Views.Add(dms.GetView(iViewID));
DmsElementId id = agent.CreateElement(configuration);
Thank you !!
Hi Esteban,
Those settings are currently not supported in the class library, if you wan to contribute you can add them yourself.
See how to Class library development | DataMiner Docs