cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
299
Views
0
Helpful
4
Replies

PyATS: API to SCP from the PyATS client to a device ?

dbillon
Level 1
Level 1

Hi Guys,

I am looking for an API in PyATS (or Genie, Unicon...) that would copy a file from the Linux client (where my PyATS script is running) to a router declared in the PyATS testbed.

I've found various APIs :

  • In Unicon "copy" is available ... but the copy transaction starts on the router (call regular IOS commands)
  • In PyATS "File Transfer Utilities" ... but the copy transaction happens with a server declared in the testbed (not with the devices of the testbed)

I would expect to have an API to execute something like :

scp -O myfile 1.2.3.4:bootflash:/myfile

with the credentials of the 1.2.3.4 router coming from the testbed.

Ok I could activate an FTP (or whatever) server on the client then execute the copy command from the IOS but why such a complexity ?

Did I miss something in the PyATS toolbox ?

BR, Damien.

 

4 Replies 4

balaji.bandi
Hall of Fame
Hall of Fame

i am sure you can achieve this using fastAPI+Python+Pyats - use any LLM like perplexity or google AI or chat GBT give you steps.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Yes I'm sure it would be possible to use some SSH lib to do this ... but the need is so obvious that I would have expected to have some API within PyATS for this.

Sure Python and PyATS support that SSH feature and run that commands.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

You could try the execute command https://devnetdan.com/2021/06/14/pyats-and-genie-part-2/ this you should be able to run the scp command on the local machine where your PyATS script is running.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io