Hi Dojo!
I'm trying to get some parameters from services (they are using a Service protocol) and I can't find the way to do it.
I thought that I did in the past using "GetParameterMessage" but it is failing with Message:
The following was returned from the script:
(Code: 0x80070005) Skyline.DataMiner.Net.Exceptions.DataMinerSecurityException: Access not allowed.
My code (4004 is the parameter ID from my service protocol):
List<Service> servicelist = engine.FindServicesInView($"{Owner.Value} Services").ToList();
foreach (Service service in servicelist)
{
GetParameterResponseMessage parameterMessageServiceStatus = engine.SendSLNetSingleResponseMessage(new GetParameterMessage(service.DmaId, service.ServiceId, 4004)) as GetParameterResponseMessage;
var status = parameterMessageServiceStatus.DisplayValue;
}
I'm running main release 10.4 CU10
Some ideas?
Thanks!!
Hi Pedro,
Since you mention that the services are using a service protocol, in the background there is an element coupled to the service.
If you wish to collect the service element parameters, the GetParameterMessage will need to point to the element behind the service instead of providing the service ID itself.
More in detail:
In the code, you are using 'service.DmaId' and 'service.ServiceId' to collect the parameter, this should most likely be replaced with:
- service.RawInfo.ServiceElement.DataMinerID
- service.RawInfo.ServiceElement.ElementID
Would it be possible to give the above change a try?
Kind regards,