I need to create a bunch of Spectrum Service models on the command line. I know how to create them using CLI but how do I set the Service Hierarchy?

Document ID : KB000057322
Last Modified Date : 14/02/2018
Show Technical Document Details

QUESTION: I need to create a bunch of Spectrum Service models on the command line. I know how to create them using CLI but how do I set the Service Hierarchy? We group them by Prod/App/Host but cannot seem to find the attribute to do this.

 

ANSWER: The Service Hierarchy is created when one Service is a Resource for another Service. Using your example, I created three different Services:

 

 

 

 

Prod

 

App

 

Host

 

 

 

For the Prod Service, I made App a resource. For the App Service, I made Host as a resource. See example below:

 

 

269042_1.png

 

After making one Service the Resource of another, the Hierarchy is automatically built. See below:

 

 

 

 

269042_2.png

 

 

 

This can be done from the command line using the Command Line Interface by associating one Service to another using the “SlmMonitors” relationship. The model handle on the left of the association will be the Service higher in the Service Hierarchy. The following is an example of the association between the “Prod” Service and the “App” Service:

 

 

 

 

> ./show associations mh=0x40034d

 

LMHandle    LMName            Relation                         RMHandle    RMName

 

0x40003d    Services          SlmContains                      0x40034d    Prod

 

You would need to use the “create association” command:

create association rel=relation lmh=left_model_handle rmh=right_model_handle

The left model handle (lmh) will be the model handle of the Service model higher in the hierarchy. The right model handle (rmh) will be the model handle of the Service model lower in the hierarchy. So in this example, if the Prod Service model handle is 0x40034d and the App Service model handle is 0x40034e, then the command would be as follows:

 

./create association rel=SlmMonitors lmh=0x40034d rmh=0x40034e

 

ADDITIONAL INFORMATION: For more information on using the Service Editor, please reference the "Service Manager User Guide" for Spectrum 9.4 and below and the "Service Manager" section of the Spectrum 10.0 document.

For more information on using the Command Line Interface (CLI), please reference the "Command Line Interface User Guide" for Spectrum 9.4 and below and the "Command Line Interface" section of the Spectrum 10.0 document.