cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1034
Views
0
Helpful
5
Replies

How to create service model for adding a device

kbarve
Cisco Employee
Cisco Employee

I referred to Create a device using REST

But I would like to create a service model for adding a device. Is it possible?

1 Accepted Solution

Accepted Solutions

Adding the device using a service is no problem, the challenge is usually to get SSH keys and sync from the device, this cannot be done from the service create code.

Creating an "add device" action might be an easier approach, unless you want the service semantics.

View solution in original post

5 Replies 5

alam.bilal
Cisco Employee
Cisco Employee

From NSO's perspective, there aren't any restrictions. A service can be modeled in YANG and then mapped to other models [device/service].

What is the intended value-add of the above described service?

Adding the device using a service is no problem, the challenge is usually to get SSH keys and sync from the device, this cannot be done from the service create code.

Creating an "add device" action might be an easier approach, unless you want the service semantics.

kbarve
Cisco Employee
Cisco Employee

Thanks for the reply.

Will give a try to create a service model.

Please note that Fredrik was very careful to say "action".... as opposed to "service"....

if you need to do this in NSO (as compared with any other approaches mentioned), you should do it as an "action" -- not as a service...

cheers

gregg

alam.bilal
Cisco Employee
Cisco Employee

Another option is to first map your service to create the device entry.

Then kick off your action that Fredrik mentioned (to fetch SSH keys and sync-from) via a kicker instance watching over your service.