Тёмный

Python Skills and Techniques for Network Engineers, Part 1 

Cisco DevNet
Подписаться 36 тыс.
Просмотров 55 тыс.
50% 1

Season 2, Talk 1 of NetDevOps Live! looks at several tips and techniques for crafting better network automation code with Python. Full details at bit.ly/2OK35TR
Presenter: Hank Preston / hfpreston
Topics Covered - Time Links
- Agenda 1:00
- Better Code Style / Sharing 3:59
- The Sh-Bang Line 4:11
- Doc Strings 6:43
- Demo: Sh-Bang and Doc Strings 8:42
- requirements.txt 11:10
- Coding Style and Linting with Flake8 12:39
- Black and White Code Formatters 15:37
- Demo: Linting and Code Formatting 17:00
- Short look at licenses 19:07
- More Reusable Code 20:45
- Functions 21:01
- Modules 23:39
- Demo: Functions and Modules 26:09
- Packages 29:10
- Demo: Packages 31:50
- Classes and Objects 35:29
- Demo: Objects 38:48
- More Robust Code 40:11
- Try... Except... 40:21
- Test, don't assume 44:40
- Demo: Exception Handling 46:10
- Simple Command Line Tools with argparse 48:24
- Environment Variables 50:08
- Demo: CLI and ENV 52:05
- Summing Up 54:49
- Webinar Resources 55:21
- Code Exchange Challenge 56:06
- Contact Info 57:01
Episode Description:
You're writing Python code to solve your network configuration and operational challenges. You've mastered libraries like Netmiko, ncclient, and requests. You can manipulate XML, JSON and YAML like a pro. You've saved yourself and your organization hours with your work, but you're still a bit embarrassed by your code... Don't worry, you are not alone.
Most network engineers didn't start as developers, we kinda just learned as we went, hacking together something that "worked". In this session you'll learn simple coding skills and techniques that you can use today to make your code something you'll be proud to share and show off.
NetDevOps Live! is produced by Cisco DevNet. Details can be found at developer.cisco.com/netdevops... and follow NetDevOps Live! on Twitter at / netdevopslive

Наука

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@bigevilbeard
@bigevilbeard 5 лет назад
This was a great session Hank!
@AD-wg5bg
@AD-wg5bg 4 года назад
Learning so much... as i go through :)! Thanks Hank.
@wairisson
@wairisson Год назад
Great presentation Hank, thanks for sharing your knowledge with us!
@jjbb7010
@jjbb7010 4 года назад
This is awesome delivery and tutorial thanks Hank
@rajeshreddyn3080
@rajeshreddyn3080 5 лет назад
Hank, Really enjoyed all the way.. and appreciate your efforts. Please do Pyang sessions in depth, that will be definitely useful. It will definitely help in NSO and yang implementation in real time. hope you will do this .. thanks alot
@CainanParker
@CainanParker 5 лет назад
Unix System Resoucres ;) Great video and some really helpful detail delivered at a nice pace!
@theccieguy
@theccieguy 5 месяцев назад
Thanks, Hank. I needed this.
@patoco817
@patoco817 5 лет назад
So much great stuff in this presentation. I have only been coding in python right at a year now. Network engineer to start trying to steam roll my way into DevOps! I have seen linters thrown around in forums all the time but never really knew what they did or how to use them, so thanks for that!. Another great add was the environment variables.. As most i struggled with how to handle my network creds in a script with out actually putting them in my scripts (Learned Linux at the same time as learning python). After a lot of searches I finally came to the environ variables!! Wish I could comment on every aspect of this video, but would read all that lol.. Anyways, thanks for all the great info!
@HankPreston
@HankPreston 5 лет назад
Thanks os much for the comments Patrick, glad you found it helpful! Be sure to register for the upcoming episodes as well. bit.ly/2OK35TR
@siddcfc
@siddcfc 5 лет назад
So much to learn this being an network engineer..yet trying to catch this up !! Will be helpful if someone dictate where to start from
@aminebouaita9202
@aminebouaita9202 3 года назад
Efficient talk, thank you sir
@defaultroute
@defaultroute 2 года назад
This is AWESOME. Wishing I'd been on this 2 years ago.
@mandeepmails
@mandeepmails 2 года назад
DItto!
@fgbmfitrinidadandtobago9033
@fgbmfitrinidadandtobago9033 3 года назад
Much appreciated. Please note example1.py will not work on Windows since the module os.getuid() does not exist in module os for Windows on Python3
@ParthPatel-jn6io
@ParthPatel-jn6io 3 года назад
Where can we get code for cisco live netdevops series to practice ?
@karthikkumaresan1091
@karthikkumaresan1091 4 года назад
informative session but I was hoping to get something about real networking, like libraries to exchange data between machines, networking services, TCP/IP, etc..
@ejnixon
@ejnixon 5 лет назад
Thanks for this, enjoyed the video and picked up some good info from you. Do you have examples on organizing code for CLI scraping sessions using netmiko,paramiko etc? I have been playing with python for 6 months, and I still find it quite tedious and very frustrating. I wish we had API available in our environment, but I'm not so lucky :). I have written a script to take user input for a IP address, and find out what switch and port the host is connected to when in an extended OTV data center environment. It solves the problem of where does my host really live, without doing manual traceroute, arp, OTV route mac lookups every time. The challenge I face is, the script takes 30 seconds to run, due to the nature of netmiko having to wait for responses before continuing on with the next part of the script. i'm looking for ways to help speed that up, but i'm not sure if it's possible with CLI scraping?
@HankPreston
@HankPreston 5 лет назад
Glad you enjoyed the video/session. There's a lot in your question, too much to really cover in a comment like this but a couple of thoughts. You could look at async to allow your code to do more than one thing at once, but there are complexities in there. Also, if you are on Nexus, you could see if NX-API CLI options respond faster than CLI.
@ejnixon
@ejnixon 5 лет назад
@@HankPreston Unfortunately, we are on 6.2.x code on 7k, I believe the API requires 7.x . . I validated that the feature was not available on a device :(
@AndreThompson2000
@AndreThompson2000 3 года назад
Much appreciated. Please note example1.py will not work on Windows since the module os.getuid() does not exist in module os for Windows on Python3
Далее
Picking your First Network Automation Project Close
52:44
Иран и Израиль. Вот и всё
19:43
Просмотров 1,3 млн
Smart Sigma Kid #funny #sigma #memes
00:26
Просмотров 4,8 млн
Lecture 1: Introduction to CS and Programming Using Python
1:03:30
Python For Network Engineers - 1hr crash course
59:15
Python Socket Programming Tutorial for Beginners
1:58:28
Useful Python Libraries for Network Engineers
56:48
Просмотров 63 тыс.
How Senior Programmers ACTUALLY Write Code
13:37
Просмотров 1,5 млн
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Просмотров 1,6 млн