The Dynamic Model is an extension of the Managed Object Definition Language (MODEL).In this topic, you can find information about creating a dynamic model file in groovy.

A Model file in Groovy consists of the following:
  • Domain: The domain to which a particular model file belongs. The domain is provided by adding the keyword domain followed by the domainName. Following is the list of supported domains and the corresponding domainName:
    Domain Domain Name
    Network/IP/INCHARGE Network
    Storage vm
    Multicast Mcast_Main
    Voip Voip_Main
    MPLS MPLS_Main
    NPM BGP
    SAM esm_sam
    To create a domain groovy, you can use the following code syntax:
    domain('Network') {
    
    }
  • DomainClass: A domain class represents either a new class is added to the Model or a class to which new attributes or relationships are added. The following code syntax provides a new domainClass DM_Printer is added with the UnitaryComputersystem as a base class:
    domainClass('dm_Printer', UnitaryComputerSystem) {
    }
  • Attributes: Adding attributes to a domainclass is defined by the stored keyword. The groovy dynamic model represents the topology view. Every attribute in the MODEL (mdl) file, irrespective of whether it is a computed, propagated, refined, instrumented, or stored attribute is defined in the groovy model as a stored attribute.
    The following example adds attributes to the earlier provided DM_Printer class:
    domainClass('NwtworkPrinter',UnitaryComputerSystem) {
    		stored DispName 
    		 
    	}
  • Relationships: A new relationship can be added in the Groovy model to an existing or new domainClass. There are two ways in which a relationship can be added to a new domainClass:
    domainClass('NwtworkPrinter',UnitaryComputerSystem) {
    		//Relationship specifying a relationName and A targetclass  
    		relationship(ConnectionTo, Router) 
    }
    domainClass('NwtworkPrinter',UnitaryComputerSystem) {
                //Relationship specifying a relationName,targetclass and inverserelationship
    		relationship(ConnectionTo, Switch,ConnectionBy)  
    	}
Following is the example of a Groovy file:
def Model = {
     domain('Network') {
domainClass('DM_Printer',UnitaryComputerSystem) {
		stored DispName 
		relationship(ConnectionTo, Router) 
	}

      }
}