In automation it's possible to get my element DCF interfaces. Now I'm looking how to create a DCF connection between two elements.
The internal SLNet call as mentioned from Michiel would be the only way currently. With its own dangers of use as also mentioned.
I would generally recommend using a driver and element to manage DCF on the system. An element has access to better logging, options for caching data and more options to visualize the status of the system. A script is really just for short pieces of volatile & short-lived code.
If inter-device DCF has to be provisioned, this can be easily done using an existing driver: the Skyline Generic Provisioning driver version range 1.0.0.X. It reads in an excel file with all external connections you want to have on the system and takes care of everything for you.
There is also a DCFHelper namespace available in our protocol examples on DCF. In case you want to make/adjust your own custom protocol to manage DCF. It provides much benefit, such as keeping track of what connections the element has ownership of. This allows it to automatically clean up connections and acts as a security to avoid accidentally deleting connections the element itself has no ownership of.
There have been plans to add the DCFHelper code to the class library for a while now, it might be possible to then also release a 'lite' version for automationscript usage. It would lose some of the previously mentioned benefits though.
If adding the DcfHelper code to class library for Protocol and Automation is a popular request feel free to add a record to the Feature Suggestions on DoJo and we can see how much it is requested so we can prioritize.
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