《不想编码的工程师的可编程性技能.pdf》由会员分享,可在线阅读,更多相关《不想编码的工程师的可编程性技能.pdf(66页珍藏版)》请在三个皮匠报告上搜索。
1、#CiscoLive#CiscoLiveHank Preston,Principal Engineer Learning and Certifications ccie 38336|devnet expert 20220001hfprestonBRKOPS-1237Programmability Skills for Engineers Who Dont Want to Code 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveEnter your personal notes hereCis
2、co Webex App Questions?Use Cisco Webex App to chat with the speaker after the sessionFind this session in the Cisco Live Mobile AppClick“Join the Discussion”Install the Webex App or go directly to the Webex spaceEnter messages/questions in the Webex spaceHowWebex spaces will be moderated by the spea
3、ker until June 9,2023.1234https:/ 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicBRKOPS-12373 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveIBOOPS-1214Agenda 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicSpreadsheet driven automationA
4、w CRUD,we gotta talk a little about APIsSource of Truth,it doesnt have to be you anymorepyATS-How to no-code and automate networksAnsible the Hammer of Network AutomationBRKOPS-12375Spreadsheet driven automation 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicStory Time with HankBRK
5、OPS-12377 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLive“Network Engineering Runs on Spreadsheets”BRKOPS-12378 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveDevice Configuration Standardcrypto isakmp policy 10encryption aeshash sha256authenti
6、cation pre-sharegroup 14crypto ipsec transform-set esp-aes esp-sha256-hmaccrypto isakmp key address access-list permit ip crypto map 10 ipsec-isakmpset peer set transform-set match address interface crypto map BRKOPS-12379 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveCr
7、eating the Access List Configuration!Site 1 Access Listaccess-list permit ip !Site 1 Access Listaccess-list 100 permit ip 10.98.128.0 0.0.3.255 172.28.11.0 0.0.0.255BRKOPS-123710 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveCreating the Access List Configuration!Site 2
8、Access Listaccess-list permit ip !Site 2 Access Listaccess-list 100 permit ip 172.28.11.0 0.0.0.255 10.98.128.0 0.0.3.255 BRKOPS-123711 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveUsing CONCAT Function in Excel to Create StringsFill in the blank configuration creationO
9、nce formulas created,”fill down”for other rows/sitesHelp info on CONCAT Function=CONCAT(access-list 100 permit ip,VPNsSide 1 Inside,VPNsSide 1 Mask,VPNsSide 2 Inside,VPNsSide 2 Mask)BRKOPS-123712 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveCONCAT your CONCATs for Full
10、ConfigsCommon Config ElementsPer VPN Configurations=CONCAT(Common Info!$C$2,Common Info!$C$3,B2,D2,C2,E2)Tip!Dont forget to add spaces and new lines where neededBRKOPS-123713Demo!2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicOther Useful FunctionsMID Pull characters out of a strin
11、gREPLACE Change characters in a string FIND Locate a character in a string TRIM Remove white space RAND/RANDBETWEEN Provide a random numberLots more!BRKOPS-123715 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicWhy should I care?Business runs on spreadsheets not just networking Form
12、ulas are WAY faster and consistent than manualDouble check,then triple check results!But be careful you dont go too farBRKOPS-123716Aw CRUD,we gotta talk a little about APIs 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicIn the beginning Humans were the only usersBRKOPS-123718 2023
13、 Cisco and/or its affiliates.All rights reserved.Cisco PublicIn the beginning Humans were the only usersUser asks for data or takes action by interacting with UISoftware displays results in User Interface(UI)BRKOPS-123719 2022 Cisco and/or its affiliates.All rights reserved.Cisco PublicWhat exactly
14、IS an API?“Its a way for two pieces of software to talk to each other”BRKOPS-123720 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicNow software talks to softwareMySoftware SystemYour Software SystemSoftware asks for data by interacting with APISoftware returns results via API BRKOP
15、S-123721APIs arent scary you already use them 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveDesigned for Humans so more a UI than APIbut.Network Management SystemsExpect ScriptsParamiko/NetmikoNAPALMCommand Line Interface(CLI)#!/usr/bin/expect-fsend conf tnexpect(config)
16、#send”hostname my_switchnexpect(config)#send ntp server 10.10.10.101nexpect(config)#send ip domain-name domain.intranexpect(config)#send endnexpect#send write memnexpect#BRKOPS-123723 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public“designed as a programmatic interface between manag
17、ement applications and devices”Simple Network Management Protocol(SNMP)https:/tools.ietf.org/html/rfc3535BRKOPS-123724 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveAPI framework for simple web services Another use for the HTTP protocolPopular due to performance,scale,si
18、mplicity,and reliabilityRepresentational State Transfer(REST)BRKOPS-123726 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicRESTCONFBRKOPS-123727 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveThe URI:What are you Requesting?Server or HostResolves to the I
19、P and port to connect toResourceThe location of the data or object of interest on the serverServer or HostResourcehttps:/router- data returnedBased on YANG modelBRKOPS-123728 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveHTTP Methods:What to do?HTTP VerbHTTP VerbTypicalT
20、ypical Purpose(CRUD)Purpose(CRUD)DescriptionDescriptionPOSTPOSTCreateCreateUsed to create a new object,or resource.Example:Add new book to libraryGETGETReadReadRetrieve resource details from the system.Example:Get list of books from the libraryPUTPUTUpdateUpdateTypically used to replace or update a
21、resource.Can be used to modify or create.Example:Update the borrower details for a bookDELETEDELETEDeleteDeleteRemove a resource from the system.Example:Delete a book from the library.BRKOPS-123729Demo!2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicWhy should I care?IT System Integ
22、rationsUnderstand and work with automation peers Evaluate APIs from your products and vendorsAPIs are cool,add it to your resume!BRKOPS-123731 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicResourcesREST API Fundamentals Learning Module on DevNetIntroduction to RESTCONF Learning La
23、b on DevNetBRKOPS-123732Source of Truth,it doesnt have to be you anymore 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicHow does automation work?Lookup Desired StateCompare to Current StateDo SomethingBRKOPS-123734 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicHo
24、w does automationnetwork network engineeringengineering work?Lookup Desired StateCompare to Current StateDo SomethingBRKOPS-123735 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveIP Addresses Interface settings VLANs Software Versions Credentials Serial/Asset NumbersNeighb
25、orsWhat types of data make up“Desired State”Cables/Circuits Management Access Status Standards Application/Service Details Host Details BRKOPS-123736 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicWhere is the data found?In your head In someone elses head On a spreadsheet On a netw
26、ork diagramText docs and notes appsPaper notes and scrap paper Within the networkBRKOPS-123737 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLive 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLive 2023 Cisco and/or its affiliates.All rights reserved.
27、Cisco Public#CiscoLiveDevice Installation Workflow with Source of TruthAdd Gear to Source of Truth(SoT)Install,Cable,Power on GearDHCP Provides IP and Deployment ServerContact Deployment Server(DS)DS renders bootstrap config from SoTDS sends bootstrap config Gear applies bootstrap configDS/Gear upda
28、tes SoT with statusBRKOPS-123740 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicCommon Automation Source of Truth OptionsCSV Files YAML/JSON Files Git Repositories APIs into Other ApplicationsIPAM/DCIM Secret ManagementService Desk/CDBBRKOPS-123741 2023 Cisco and/or its affiliates.
29、All rights reserved.Cisco Public#CiscoLive 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public”Single”Source of Truth Realities“Single”is a fantasyGoal should be”single per domain”IPAM,DCIM,Secrets,etcIt takes discipline to maintain Culture change-“Document First”Go in phases and celeb
30、rate success BRKOPS-123743pyATS How to no-code and automate networks 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public“Could you get me this info from all of the devices in the network?”2023 Cisco and/or its affiliates.All rights reserved.Cisco Public“Could you get me this info from
31、all of the devices in the network?”Serial NumbersInterface statusRouting table ARP/MAC tables LogsEtcEtcetcBRKOPS-123746 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveWe all have our cheats BRKOPS-123747 2023 Cisco and/or its affiliates.All rights reserved.Cisco Publicpy
32、ats parse show ip route-testbed-file testbed.yaml-output output/ip_routes100%|1/1 00:0000:00,1.89it/s+=+|Genie Parse Summary for rtr1|+=+|Connected to rtr1|-Log:output/ip_routes/connection_rtr1.txt|-|Parsed command show ip route|-Parsed structure:output/ip_routes/rtr1_show-ip-route_parsed.txt|-Devic
33、e Console:output/ip_routes/rtr1_show-ip-route_console.txt|-|100%|1/1 00:0000:00,2.00it/s+=+|Genie Parse Summary for rtr2|+=+|Connected to rtr2|-Log:output/ip_routes/connection_rtr2.txt|-|Parsed command show ip route|-Parsed structure:output/ip_routes/rtr2_show-ip-route_parsed.txt|-Device Console:out
34、put/ip_routes/rtr2_show-ip-route_console.txt|-|100%|1/1 00:00 Lots of examples Broad network automation use casesBRKOPS-123753 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicAnsible,it isnt“code”its just YAML-name:Side 2 Configloop:vpns.list loop_control:label:item.vpn_name Side 2v
35、ars:vpn_name:item.vpn_name preshared_key:item.preshared_key source_network:item.side_2_inside source_mask:item.side_2_mask destination_network:item.side_1_inside destination_mask:item.side_1_mask tunnel_destination:item.side_1_public_ip tunnel_interface:item.side_2_outside ansible.builtin.template:s
36、rc:ios-vpn.j2dest:configs/item.vpn_name-side2-config.txtBRKOPS-123754 2022 Cisco and/or its affiliates.All rights reserved.Cisco PublicAnother approach to the Spreadsheet Driven AutomationMaybe Im ready to try something newBRKOPS-123755 2023 Cisco and/or its affiliates.All rights reserved.Cisco Publ
37、ic#CiscoLiveCSVCSVCLICLIBRKOPS-123756Demo!2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicAnsible can do much moreApply configurations directly to devicesComplex workflowsManage network,compute,storage,cloud,etc at once BRKOPS-123758 2023 Cisco and/or its affiliates.All rights reser
38、ved.Cisco PublicResourcesAnsible on DevNetAnsible Core DocsReading from CSVUsing Jinja TemplatesJinja Template DocumentationDemo Example CodeBRKOPS-123759 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicIn closing In closing ProgrammabilityNothing to be afraid of!60 2023 Cisco and/o
39、r its affiliates.All rights reserved.Cisco PublicBRKOPS-1237 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicWhat did we cover?Spreadsheet driven automationAw CRUD,we gotta talk a little about APIsSource of Truth,it doesnt have to be you anymorepyATS-How to no-code and automate netw
40、orksAnsible the Hammer of Network AutomationBRKOPS-123761 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveHank PrestonStay in touch:Webex/Email:Twitter:hfprestonBlogs:https:/ 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLiveFill out your session s
41、urveys!Attendees who fill out a minimum of four session surveys and the overall event survey will get Cisco Live-branded socks(while supplies last)!These points help you get on the leaderboard and increase your chances of winning daily and grand prizesAttendees will also earn 100 points in the Cisco
42、 Live Challenge for every survey completed.BRKOPS-123763 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicContinue your educationVisit the Cisco Showcase for related demosBook your one-on-oneMeet the Engineer meetingAttend the interactive education with DevNet,Capture the Flag,and Wa
43、lk-in LabsVisit the On-Demand Library for more sessions at www.CiscoL you#CiscoLive 2023 Cisco and/or its affiliates.All rights reserved.Cisco Public#CiscoLive66Gamify your Cisco Live experience!Get points Get points for attending this session!for attending this session!Open the Cisco Events App.Click on Cisco Live Challenge in the side menu.Click on View Your Badges at the top.Click the+at the bottom of the screen and scan the QR code:How:123466 2023 Cisco and/or its affiliates.All rights reserved.Cisco PublicBRKOPS-1237#CiscoLive