CiscoDevNet / virl2-client

Client library for the Cisco VIRL 2 Network Simulation Platform
Apache License 2.0
56 stars 18 forks source link

Is there a way to write directly to the start up config of a node? #100

Closed tamoor-jhuapl closed 1 month ago

tamoor-jhuapl commented 4 months ago

I've got a bunch of nodes up and I have a set of configs I want to write to each. How I use the API to write the start up configs to each node? The Node.config var seems to be read only.

PatrikMosko commented 4 months ago

Hi.

You can use Node.configuration setter.

You can check docstring for Node._set_configuration (virl2_client/models/node.py) to see what type of parameters you can pass to the setter. You can set main config by passing in a string param, or by setting secondary config by sending in a dict or both when multiple dicts are sent in a list.

side note: Node.config is deprecated.

rschmied commented 4 months ago

I don't think this addresses the original question. Node configurations as part of the PCL are always day0 configs and do not directly write any startup configurations. This is a job for a different tool altogether. You need something that will talk directly to the devices and push the configuration to it while it's running. Like pyATS or netmiko (among others).

Besides: this is rather a usage question and not a PCL issue -- you should ask this on the CML forum or some more general network automation forum.

tmikuska commented 1 month ago

As said, there's no work to be done, closing.