Hi Team,
I am trying to create and update a service on a remote DMA from a protocol QAction.
According to the documentation:
- NT_SERVICE (75):
https://docs.dataminer.services/develop/api/NotifyTypes/NT_SERVICE.html - NT_SERVICE_REMOTE (282):
https://docs.dataminer.services/develop/api/NotifyTypes/NT_SERVICE_REMOTE.html
It appears that setting the dmaid inside the <Service> XML should allow creating/updating the service on another DMA.
What works
Service creation works on the remote DMA when I send:
protocol.NotifyDataMiner(75, -1, serviceXml);
with:
<Service dmaid="22889" id="-1" ...>
The service is created successfully on DMA 22889.
What does NOT work
Updating the same service (reapply) fails:
protocol.NotifyDataMiner(75, serviceID, serviceXml);
I always get:
NotifyDataMiner with 10075 failed - 0x80040239 – SL_FAILED_NOT_FOUND
This happens because the call is processed on the local DMA, and the local DMA cannot find the service ID that exists on the remote DMA.
Even though the XML contains the correct dmaid, NT_SERVICE does not seem to route the update to the remote DMA.
What is the correct supported way to create and update a service on another DMA?
Many thanks!
Mohamed Khalith
Hi Mohamed,
There is an error in the code snippet in the documentation for NT_SERVICE_REMOTE. I've created a pull request internally to update the documentation.
In this case I believe the following notification can be used
protocol.NotifyDataMiner(282 /*NT_SERVICE_REMOTE*/ , new object[] { 22889, serviceID}, serviceXml);
The format for the service ID input is as follows:
object[]
{
(int) targetDmaID,
(int) serviceID
}
For completeness you can also specify the full ID of the service in case of a migrated service:
object[]
{
(int) targetDmaID,
(uint[]) fullServiceID
{
(uint) serviceID,
(uint) serviceDmaID (this is the dataminer ID configured in the service xml)
}
}
Hi Mohamed, in the meantime the pull request for these notifications has been merged, the documentation should now be updated to reflect the information I posted.
HI Dieter Degrande,
Thanks for the clarification – that was exactly the missing piece.
After updating my call to NT_SERVICE_REMOTE using the correct input
var input = new object[] { targetDmaID, serviceID };
protocol.NotifyDataMiner(282 /* NT_SERVICE_REMOTE */, input, serviceXml);
Remote DMA service creation and update are now working correctly.
Thanks as well for sharing the corrected code snippet and everything behaves as expected now.
Regards,
Mohamed Khalith