cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1127
Views
0
Helpful
1
Replies

NSO: How do I apply device template while deploying service

xianshen
Cisco Employee
Cisco Employee

I'm writing NSO service package using Java with template.

There have been several device-templates stored in NSO CDB.

I'd like to configure devices by applying device-template in the service.

Is there any way to implement it in Java or config-template?

 

Thanks,

Steven

1 Accepted Solution

Accepted Solutions

lmanor
Cisco Employee
Cisco Employee

In order to apply a device template from the service create code, you would need to execute the apply-template action.  Generally speaking, initiating an action from within the service create is not a good idea since the action will attempt to start a new transaction within your already executing transaction for the service create.

 

A way to do this is to convert your device-template to a config-template (simple process outlined in the 'Create a Config-template from a Device-template' section in the NSO Development guide) and then simply provide the parameter variables and apply the config-template from your service.

 

-Larry

View solution in original post

1 Reply 1

lmanor
Cisco Employee
Cisco Employee

In order to apply a device template from the service create code, you would need to execute the apply-template action.  Generally speaking, initiating an action from within the service create is not a good idea since the action will attempt to start a new transaction within your already executing transaction for the service create.

 

A way to do this is to convert your device-template to a config-template (simple process outlined in the 'Create a Config-template from a Device-template' section in the NSO Development guide) and then simply provide the parameter variables and apply the config-template from your service.

 

-Larry