Hi,
I've tried looking through the documentation and can't find anything on this.
Is there a way to return a list of all dma ids on the dataminer system.
Thanks,
Ryan
Hi Ryan,
A possible option is using the DataMiner Class Library - IDms methods. For this case you could use the method GetAgents. This method will return a collection of DMAs available in a cluster. You can get the DMA ID through the property Id (IDma properties).
IDms dms = engine.GetDms();
ICollection<IDma> dmas = dms.GetAgents();
foreach (IDma dmaAgent in dmas) {
engine.GenerateInformation("DMA ID=" + dmaAgent.Id);
}
To use the code provided by Miguel, you will need to have the option of Enable Class Library Feature and Automatically generate Class Library code under the DIS Settings.
Hy Ryan,
You can find additional information about how to work with the DataMiner Class Library in the DataMiner Automation course:
https://community.dataminer.services/courses/dataminer-automation/
You could review the topics:
– Creating automation scripts using DataMiner Integration Studio (DIS):
https://community.dataminer.services/courses/dataminer-automation/lessons/creating-automation-scripts-using-dataminer-integration-studio-dis/
– DataMiner Integration Studio (DIS) Class Library:
https://community.dataminer.services/courses/dataminer-automation/lessons/dataminer-integration-studio-dis-class-library/
Thank you both,
Will check those resources too!
Thank you Miguel, when using the IDms method
I get the error:
“The type or namespace name ‘IDms’ could not be found (are you missing a using directive or an assembly reference?)”
Also while using the GetDms method:
‘Engine’ does not contain a definition for ‘GetDms’ and no accessible extension method ‘GetDms’ accepting a first argument of type ‘Engine’ could be found (are you missing a using directive or an assembly reference?)
Currently using these two references:
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages;
What namespace do I have to reference here?