In automation it's possible to get my element DCF interfaces. Now I'm looking how to create a DCF connection between two elements.
Hi Jens,
you can use below code using an SLNet call:
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages;public void AddExternalConnection(Engine engine, int dmaID, int ElementId, int SourceInterface, int DestinationDMA, int DestinationElement, int DestinationInterface)
{
EditConnection ec = new EditConnection(dmaID, ElementId, SourceInterface, DestinationDMA + "/" + DestinationElement, DestinationInterface, true);
ec.Action = ConnectivityEditAction.Add;
EditConnectionResponse ecr = engine.SendSLNetSingleResponseMessage(ec) as EditConnectionResponse;
}public void AddExternalConnection(Engine engine, Element source, int SourceInterface, Element destination, int DestinationInterface)
{
EditConnection ec = new EditConnection(source.DmaId, source.ElementId, SourceInterface, destination.DmaId + "/" + destination.ElementId, DestinationInterface, true);
ec.Action = ConnectivityEditAction.Add;
ec.ConnectionID = 0;
ec.HostingDataMinerID = -1;
ec.Filter = "";
EditConnectionResponse ecr = engine.SendSLNetSingleResponseMessage(ec) as EditConnectionResponse;
}
Note that this is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice. We recommend to instead always use the correct UI or automation options provided in DataMiner Automation or through our web API