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?
book
Article ID: 57322
calendar_today
Updated On:
Products
Spectrum
Issue/Introduction
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.
Environment
Release: Any Component:
Resolution
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:
After making one Service the Resource of another, the Hierarchy is automatically built. See below:
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:
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
Please reference the "Service Manager" section of the documentation for more information.
Please reference the "Command Line Interface" section of the documentation for more information.