Hi Dojo,
On our DMS we have lots of Enhanced Services, but there isn't an option to change the state of the Enhanced Service from the Hamburger Menu (Activate/Pause/Stop/Restart)
What is an easy way to restart these Enhanced Services?
Thanks
Hi Dave,
First of all, my question to you would be: why do you want to force restart an enhanced service element? Is there no other way to 'reload' items by triggering a flow on this service element instead rather then restarting? (feel free to comment).
I know you are an experienced man, so if you have a valid reason to restart or control the state of the enhanced service element, follow along with my suggestion here to use the automation-script module. In the end an enhanced service has a "hidden element" attached on the back. So via code you can get hold of the element and perform your required action.
Disclaimer: Please be careful with what you do to avoid bring your service in a stuck state. if you have doubts, please reach out to Skyline first advise on architecture & approach.
Recently we also faced a situation where we wanted to give a restart to an enhanced service element.
We created following Automation script code for it:
text based for easier copying:
string serviceName = "ThisIsMyEnhancedServiceName";
IDms dms = engine.GetDms();
IDma agent = dms.GetAgents().FirstOrDefault();
var element = agent.GetElement(serviceName);
element.Restart();
Following NuGet and usings are required:
NuGet: Skyline.DataMiner.Core.DataMinerSystem.Automation
using Skyline.DataMiner.Core.DataMinerSystem.Automation;
using Skyline.DataMiner.Core.DataMinerSystem.Common;
Hope that helps you out, please do share a bit more on the context on why you want to control the state of this service element. Maybe we can also share alternatives that suit your case even better.
KR, Thijs
And to make the cycle complete, This script could feed the "servicename" in via a script-parameter. That way you could create your own "control buttons" on the Visual overview of your service, launching this control script to execute the expected state action.