When using the ClassLibrary to figure out which elements have already been provisioned on the DMS:
IDms myDms = protocol.GetDms();
var allElements = myDms.GetElements();
Can someone tell me if this API call will then also list the elements that were created on a DataMiner that is temporarily unavailable? (for example when restarting one of the DataMiner Agents in a DMS, or Failover is ongoing, or a planned server maintenance is ongoing on some of the agents)
The scenario that I would like to cover is as follows:
Imagine a manager element or script is responsible to provision elements according to a repository list, and this sync-action happens on a timely based manner. I need to be sure that the API call to list the already created elements in the DMS will not wrongly assume elements don't exist in the case of an unavailable DataMiner agent. Since that could mean the script or connector would try to recreate the same element again (now on another "active" agent).
In case this API call would only list the elements of the current active Agents, what would be the best solution for my use-case?
Can we detect first if all agents are up & running? Or are there other best practices you can think off?
Thanks!
Hi Thijs,
First of all, since you are talking about element provisioning, my first approach will be to use existing functionality provided by IDP. There are Process Automation activities that you could use to provision, update (re-apply), and delete elements.
That being said, after performing a small test I could find the following:
- When an DMA in a cluster is stopped, the method GetElements() will still return all the elements in the cluster. The state of the elements hosted in the not-running DMA is Stopped
- Before to perform any element provisioning you could check the state of the agents by using the method GetAgents(). This method will return all the DMAs in a cluster, regardless the state. You could use the property State to determine if an agent is running. The only problem I could find is that there is an exception when retrieving the agent name of a non-running agent. However, you could retrieve without problems the DMA ID and state of the agents
Awesome! Thanks Miguel. This is exactly the info I was looking for.
The question is related to an existing setup where the project already headed in a certain direction. I do agree IDP is the way forward for standard discovery and provisioning of the infrastructure monitoring along with the large features-set of IDP.