I will get a list of device IPs from postman calling a API trigger in automation script. I want to extract Resource details from the Device IP im getting. Do we have any extension methods to get?
So below are the resource details i have in hand.
- "10.130.119.34"
- "03ea386d-f8fd-4891-a2f4-b77491bca7aa"
- "Demodulator"
So the expectation is to get the element details from the information i have.
I have updated the question with extra details
Hi Baranisudha,
Please check the reply from question Is it possible to find the element using IP address with engine.FindElements() - DataMiner Dojo.
From there you will have a string with a list of dmaId/elementId separated by ';' that you can use to find the element details.
var ids = globalElementID.Split(',');
var elements = new List<Element>();
foreach (var id in ids)
{
var aux = id.Split('/');
var dmaId = Convert.ToInt32(aux[0]);
var elementId = Convert.ToInt32(aux[1]);
var element = engine.FindElement(dmaId, elementId);
elements.Add(element);
}
From there you have a list with all elements that use the provided IP, you just need your logic to return the data that you need.
i have tried this method, but i couldn’t achieve it because the Notify method is deprecated.
DMS dms = new DMS();
dms.Notify(type/*DMS_GET_ELEMENT_ID_FROM_IP*/ , subType, ipBus, null, out result);
Error message we are receiving —
Script Failure (Sky_Create_Service): (after retries) (Code: 0x80040251) Skyline.DataMiner.Net.Exceptions.DataMinerException: No Assembly found for cookie 10
(123,4): error CS0246: The type or namespace name ‘DMS’ could not be found (are you missing a using directive or an assembly reference?)
But I have referenced DMS.
Is not a problem the Notify to be deprecated.
Can you add C:Skyline DataMinerFilesInterop.SLDms.dll to DLL references of your script? Add using Interop.SLDms; in the code?
Yes this works. Thank you!!
hi
Could you elaborate on how the resource is linked with the IP and what details you would need from the resource? Perhaps adding a screenshot to your question might give a hint.