Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
REST API
Piotr Wojciechowski (CCIE #25543)
www.it-playground.pl
ABOUT ME
¢ Senior Network Engineer MSO at VeriFone Inc.
¢ Independent Network Architect and IT Consul...
www.it-playground.pl
ABOUT CCIE.PL
¢ The biggest Cisco community in Europe
¢ Over 8300 users, over 21000 topics, over 1560...
www.it-playground.pl
AGENDA
¢ The idea of programming network devices
¢ What is REST API
¢ JSON
¢ REST API on Cisco ASA
¢ ...
www.it-playground.pl
THE IDEA OF PROGRAMMING NETWORK DEVICES
www.it-playground.pl
WHY WE ARE TALKING ABOUT THIS?
¢ Lets look at hot topics
on Cisco Live
— San Diego 2012
¢ Fabric
¢ Ne...
www.it-playground.pl
WHY WE ARE TALKING ABOUT THIS?
¢ Lets look at hot topics
on Cisco Live
— San Diego 2012
¢ Fabric
¢ Ne...
www.it-playground.pl
THE IDEA OF PROGRAMMING NETWORK DEVICES
www.it-playground.pl
THE IDEA OF PROGRAMMING NETWORK DEVICES
Func CreatePathSrcDstPort()
Func AddACLEntry() Func GetACL()
...
www.it-playground.pl
THE IDEA OF PROGRAMMING NETWORK DEVICES
Func CreatePathSrcDstPort()
Func AddACLEntry() Func GetACL()
...
www.it-playground.pl
THE IDEA OF PROGRAMMING NETWORK DEVICES
Func CreatePathSrcDstPort()
Func AddACLEntry() Func GetACL()
...
www.it-playground.pl
THE IDEA OF PROGRAMMING NETWORK DEVICES
Func CreatePathSrcDstPort()
Func AddACLEntry() Func GetACL()
...
www.it-playground.pl
WHERE WE ARE? WHERE ARE WE GOING?
www.it-playground.pl
WHAT IS REST API
www.it-playground.pl
WHAT IS REST API
¢ API - Application Programming Interface
— It’s set of rules describing how one app...
www.it-playground.pl
WHAT IS REST API
¢ What kind of APIs do you already know? How many you use every day
without even kno...
www.it-playground.pl
WHAT IS REST API
¢ REST - Representational State Transfer
— Communicates over HTTP
— Use HTTP methods...
www.it-playground.pl
WHAT IS REST API
HTTP GET
HTML
Data should be displayed
by web browser for user
www.it-playground.pl
{
“kind”: “object#Version”,
“selfLink”: “/api/monitoring/device/version”,
“upTimeinSeconds”: 7800,
“d...
www.it-playground.pl
WHAT IS REST API
Client Request API Service Call
API Service ResponseClient Action
GET, PUT, etc
JSON...
www.it-playground.pl
REST API CLIENTS
¢ Anything that can execute HTTP methods and parse response can be
used as REST API ...
www.it-playground.pl
REST API METHODS
¢ REST API is used to perform operations on firewall. Parameters and
responses are e...
www.it-playground.pl
REST API REQUEST
https://172.16.1.64/api/controller/restconf/config?id=100
Server identification
Reso...
www.it-playground.pl
REST API RESPONSE
¢ If operation is performed successfully we will see one of following codes
— 200 S...
www.it-playground.pl
REST API RESPONSE
¢ In case of errors following codes are expected
— 400 Bad Request – in situation w...
www.it-playground.pl
REST API
www.it-playground.pl
REST API AUTHENTICATION
¢ None – resource is public, anybody can place call
¢ Basic HTTP – username a...
www.it-playground.pl
JSON
www.it-playground.pl
JSON STANDARD
¢ Douglas Crockford originally specified the JSON format in the early
2000s
¢ Three sta...
www.it-playground.pl
WHAT IS JSON?
¢ All operations requires common and well defined structure for
exchanging data
¢ JSON ...
www.it-playground.pl
WHAT IS JSON?
¢ JSON is defined in RFC4627
¢ JSON is predefined MIME type identified by application/j...
www.it-playground.pl
WHAT IS JSON?
¢ Each value is represented as a pair separated by colon. First part is
string represen...
www.it-playground.pl
PARSING JSON STRUCTURES
¢ I have JSON object, what to do with it?
— Nothing
¢ The output is human-rea...
www.it-playground.pl
PARSING JSON STRUCTURES
¢ It’s not hard, but…
— We need to know the structure!
— We need to know what...
www.it-playground.pl
JSON
¢ JSON Test
— http://www.jsontest.com
— Testing platform for services utilizing JSON including s...
www.it-playground.pl
REST API ON CISCO ASA
www.it-playground.pl
REST API ON CISCO ASA
REST	Client
Web	Server
REST	Daemon REST	Agent
JSON	over	HTTPS
JSON	over	HTTPS
C...
www.it-playground.pl
REST API ON CISCO ASA
REST	Client
Web	Server
REST	Daemon REST	Agent
JSON	over	HTTPS
JSON	over	HTTPS
C...
www.it-playground.pl
REST API ON CISCO ASA
REST	Client
Web	Server
REST	Daemon REST	Agent
JSON	over	HTTPS
JSON	over	HTTPS
C...
www.it-playground.pl
REST API ON CISCO ASA
¢ How to run REST API on ASA
— It’s already built-in in ASAv, just need to acti...
www.it-playground.pl
REST API ON CISCO ASA
¢ Debugging
asav-1# debug rest-api ?
agent Rest-API Agent
cli Rest-API cli hand...
www.it-playground.pl
REST API ON CISCO ASA
¢ Documentation
— Cisco ASA REST API Quick Start Guide -
http://www.cisco.com/c...
www.it-playground.pl
REST API ON CISCO ASA
www.it-playground.pl
TOOLS I USE
www.it-playground.pl
REST CLIENT
¢ REST API Client is required for testing API calls and responses
— You can easily test d...
www.it-playground.pl
REST CLIENT
¢ POSTMAN
www.it-playground.pl
CODE EDITOR - ATOM
¢ Cross-platform editing
¢ Highly customizable
— Plug-ins
— Themes
¢ Package manag...
www.it-playground.pl
CODE EDITOR - XCODE
¢ Native
Swift/Objective-C
IDE
¢ Easy to work with
¢ UI Designer
¢ Simulator
¢ Sm...
www.it-playground.pl
PROGRAMMING LANGUAGE
¢ Why Perl?
— I don’t know Python (so far!)
— I had some experience with Perl
¢ ...
www.it-playground.pl
TOPOLOGY
¢ Simulation in Cisco VIRL
¢ Details at: http://blog.it-playground.pl/2016/11/14/cisco-asa-r...
www.it-playground.pl
TOPOLOGY
www.it-playground.pl
EXAMPLE #1 – CHECK END-TO-END ROUTING
www.it-playground.pl
EXAMPLE #1 – CHECK END-TO-END ROUTING
¢ How we can get routing information in REST API?
— If this is ...
www.it-playground.pl
EXAMPLE #1 – CHECK END-TO-END ROUTING
www.it-playground.pl
EXAMPLE #1 – CHECK END-TO-END ROUTING
¢ How we can get routing information
in REST API?
— We can exec...
www.it-playground.pl
EXAMPLE #1 – CHECK END-TO-END ROUTING
¢ Easy to parse text in perl
www.it-playground.pl
EXAMPLE #1 – CHECK END-TO-END ROUTING
CODE EXAMPLES IN PERL AND DEMO
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
¢ Script written in node.js
— Simple http server listening on port 8...
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
¢ Node.js
— JavaScript runtime built on Chrome's V8 JavaScript engin...
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
¢ Every chunk of retreived data is placed in table
¢ Done in asynchr...
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
¢ JSON objects are parsed
using internal library
¢ Parsing starts wh...
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
www.it-playground.pl
EXAMPLE #2 – DISPLAY ACL OBJECTS
CODE EXAMPLES IN NODE.JS AND DEMO
EXAMPLE #3 – CHECK ASA VERSION ON ...
www.it-playground.pl
RESOURCES
www.it-playground.pl
MORE RESOURCES
¢ Visit my pages for more detailed information on presented scripts
— REST API tutoria...
www.it-playground.pl
QUESTIONS?
www.it-playground.pl
THANK YOU FOR JOINING THIS SESSION
Upcoming SlideShare
Loading in …5
×

PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowanie urządzeń sieciowych

104 views

Published on

YouTube: https://www.youtube.com/watch?v=TThc4B37g-I&list=PLnKL6-WWWE_VNp6tUznu7Ca8hBF8yjKj2&index=33

Published in: Technology
  • Be the first to comment

  • Be the first to like this

PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowanie urządzeń sieciowych

  1. 1. REST API Piotr Wojciechowski (CCIE #25543)
  2. 2. www.it-playground.pl ABOUT ME ¢ Senior Network Engineer MSO at VeriFone Inc. ¢ Independent Network Architect and IT Consultant ¢ Blogger – blog.it-playground.pl ¢ Previously Network Solutions Architect at one of top polish IT integrator ¢ CCIE #25543 (Routing & Switching) ¢ PLNOG Advisory Board member ¢ CCIE.PL General Admin
  3. 3. www.it-playground.pl ABOUT CCIE.PL ¢ The biggest Cisco community in Europe ¢ Over 8300 users, over 21000 topics, over 156000 posts ¢ Strong staff — 3 general admins — 1 board admin — 3 servers admins — 3 moderators ¢ Over 60 polish CCIEs as members — over 20 of them actively posting! ¢ About 100 new topics per month ¢ About 800 posts per month ¢ English section available
  4. 4. www.it-playground.pl AGENDA ¢ The idea of programming network devices ¢ What is REST API ¢ JSON ¢ REST API on Cisco ASA ¢ Tools I use and demo
  5. 5. www.it-playground.pl THE IDEA OF PROGRAMMING NETWORK DEVICES
  6. 6. www.it-playground.pl WHY WE ARE TALKING ABOUT THIS? ¢ Lets look at hot topics on Cisco Live — San Diego 2012 ¢ Fabric ¢ Nexus 1000V virtual switch ¢ Virtualization Ready Campus Network ¢ Big Data Architecture, Sizing, Scaling ¢ Orchestration in Cloud Computing
  7. 7. www.it-playground.pl WHY WE ARE TALKING ABOUT THIS? ¢ Lets look at hot topics on Cisco Live — San Diego 2012 ¢ Fabric ¢ Nexus 1000V virtual switch ¢ Virtualization Ready Campus Network ¢ Big Data Architecture, Sizing, Scaling ¢ Orchestration in Cloud Computing — Berlin 2017 ¢ DevOps for Developers ¢ DevOps in Data Center ¢ Multicloud strategy ¢ NFV/SDN in SP networks ¢ End-to-End Cloud management (IaaS, PaaS, SaaS) ¢ NetDevOps for the Network Dude - How to get started with API's, Ansible and Python
  8. 8. www.it-playground.pl THE IDEA OF PROGRAMMING NETWORK DEVICES
  9. 9. www.it-playground.pl THE IDEA OF PROGRAMMING NETWORK DEVICES Func CreatePathSrcDstPort() Func AddACLEntry() Func GetACL() Func CheckEndToEndRouting() CLI
  10. 10. www.it-playground.pl THE IDEA OF PROGRAMMING NETWORK DEVICES Func CreatePathSrcDstPort() Func AddACLEntry() Func GetACL() Func CheckEndToEndRouting() API
  11. 11. www.it-playground.pl THE IDEA OF PROGRAMMING NETWORK DEVICES Func CreatePathSrcDstPort() Func AddACLEntry() Func GetACL() Func CheckEndToEndRouting() API API
  12. 12. www.it-playground.pl THE IDEA OF PROGRAMMING NETWORK DEVICES Func CreatePathSrcDstPort() Func AddACLEntry() Func GetACL() Func CheckEndToEndRouting() API
  13. 13. www.it-playground.pl WHERE WE ARE? WHERE ARE WE GOING?
  14. 14. www.it-playground.pl WHAT IS REST API
  15. 15. www.it-playground.pl WHAT IS REST API ¢ API - Application Programming Interface — It’s set of rules describing how one application can interact with another ¢ Classes ¢ Methods ¢ Endpoints ¢ Etc…. — It defines mechanism in such interaction can happen — It’s software-to-software interaction so no UI
  16. 16. www.it-playground.pl WHAT IS REST API ¢ What kind of APIs do you already know? How many you use every day without even knowing? Web Service API SOAP XML-RPC REST Web Socket API Library-based API JavaScript TWAIN Google Maps JavaScript API Oracle Call Interface Class-based API Java API Android API Google Maps Android API Object remoting API .NET Remoting COBRA Hardware API PCI buses Video acceleration
  17. 17. www.it-playground.pl WHAT IS REST API ¢ REST - Representational State Transfer — Communicates over HTTP — Use HTTP methods for communication (GET, POST, PUT etc.) — Returns data in multiple formats (XML, JSON) — Same concept applies for many APIs
  18. 18. www.it-playground.pl WHAT IS REST API HTTP GET HTML Data should be displayed by web browser for user
  19. 19. www.it-playground.pl { “kind”: “object#Version”, “selfLink”: “/api/monitoring/device/version”, “upTimeinSeconds”: 7800, “deviceType”: “ASA5525”, “firewallMode”: “Router”, “totalFlashinMB”: 8192, “asaVersion”: “9.6(2)”, “currentTimeinSeconds”: 1476492557 } WHAT IS REST API REST API JSON Data should be sent to application in form it can understand and use
  20. 20. www.it-playground.pl WHAT IS REST API Client Request API Service Call API Service ResponseClient Action GET, PUT, etc JSON, XML, other
  21. 21. www.it-playground.pl REST API CLIENTS ¢ Anything that can execute HTTP methods and parse response can be used as REST API client ¢ Cisco recommends in documentation: — Python — Perl — Node.js
  22. 22. www.it-playground.pl REST API METHODS ¢ REST API is used to perform operations on firewall. Parameters and responses are embedded using JSON structure. The methods we can use are: — GET – retrieves data from specified object — POST – creates the object with the supplied information — PUT – adds the information to specific object — DELETE – removes specific object — PATCH – applies partial modification to the object
  23. 23. www.it-playground.pl REST API REQUEST https://172.16.1.64/api/controller/restconf/config?id=100 Server identification Resource identification Parameters ¢ URI ¢ Header — Content type: application/json — Authorization: API Key
  24. 24. www.it-playground.pl REST API RESPONSE ¢ If operation is performed successfully we will see one of following codes — 200 Success OK – when executing GET method — 201 Create – when execution POST method — 204 No Content – when executing PUT, PATCH or DELETE methods ¢ Content — JSON
  25. 25. www.it-playground.pl REST API RESPONSE ¢ In case of errors following codes are expected — 400 Bad Request – in situation when parameter is missing, incomplete or invalid — 404 Not Found – when we try to call resource that is not available — 405 Method Not Allowed – not all methods can be performed on all resources — 500 Internal Server Error – return response may include an error object containing more details about the error
  26. 26. www.it-playground.pl REST API
  27. 27. www.it-playground.pl REST API AUTHENTICATION ¢ None – resource is public, anybody can place call ¢ Basic HTTP – username and password are required in encoded string ¢ Token – obtained usually from administrator ¢ OAUTH – access token from an Identity Provider via dedicated flow, user rights are associated to the token
  28. 28. www.it-playground.pl JSON
  29. 29. www.it-playground.pl JSON STANDARD ¢ Douglas Crockford originally specified the JSON format in the early 2000s ¢ Three standards: — ECMA-404 (October 2013) – describes only the allowed syntax — RFC 7159 (March 2014) – covers some security and interoperability considerations — RFC 7493 (March 2015) – defines a restricted profile of JSON, known as I- JSON Source: WikiPedia
  30. 30. www.it-playground.pl WHAT IS JSON? ¢ All operations requires common and well defined structure for exchanging data ¢ JSON - Java Script Object Notation — Lightweight structured data-interchange format — An alternative to XML — Much easier for humans to read than XML — Easy for machine to parse and generate
  31. 31. www.it-playground.pl WHAT IS JSON? ¢ JSON is defined in RFC4627 ¢ JSON is predefined MIME type identified by application/json ¢ JSON consist of two structures — A collection of name/value pairs — An ordered list of values { “kind”: “object#Version”, “selfLink”: “/api/monitoring/device/version”, “upTimeinSeconds”: 7800, “deviceType”: “ASA5525”, “firewallMode”: “Router”, “totalFlashinMB”: 8192, “asaVersion”: “9.6(2)”, “currentTimeinSeconds”: 1476492557 }
  32. 32. www.it-playground.pl WHAT IS JSON? ¢ Each value is represented as a pair separated by colon. First part is string representing the name of the value, the second is value itself ¢ JSON standard defines few data types: — Number — String — Array — Boolean — Object — Null { “kind”: “object#Version”, “selfLink”: “/api/monitoring/device/version”, “upTimeinSeconds”: 7800, “deviceType”: “ASA5525”, “firewallMode”: “Router”, “totalFlashinMB”: 8192, “asaVersion”: “9.6(2)”, “currentTimeinSeconds”: 1476492557 }
  33. 33. www.it-playground.pl PARSING JSON STRUCTURES ¢ I have JSON object, what to do with it? — Nothing ¢ The output is human-readable so we may display it this way ¢ But that’s now what we want to — Own String Parsing ¢ We may write our own parser ¢ Buy why if there are plenty already available? — Use a Framework
  34. 34. www.it-playground.pl PARSING JSON STRUCTURES ¢ It’s not hard, but… — We need to know the structure! — We need to know what we want to store in JSON or what we want to read from it — What’s the size of structure? Maybe query was to big? — How much data we need? ¢ All? ¢ Just samples? ¢ Representative Sample?
  35. 35. www.it-playground.pl JSON ¢ JSON Test — http://www.jsontest.com — Testing platform for services utilizing JSON including structure validation ¢ JSONLint — http://jsonlint.com/ — JSON structure validator
  36. 36. www.it-playground.pl REST API ON CISCO ASA
  37. 37. www.it-playground.pl REST API ON CISCO ASA REST Client Web Server REST Daemon REST Agent JSON over HTTPS JSON over HTTPS CLI commands Debug/Syslog over TCP LINA Process Cisco ASA ¢ REST API architecture components: o REST Client is any external application that will be calling API methods o REST Agent is this small piece of additional software installed on ASA is responsible of processing requests and communication with other ASA subsystems o Web Server is used to handle HTTP communication that is used as transport protocol o REST Daemon is responsible for handling debug and syslog messages o LINA is core process which controls all Cisco ASA Software operations
  38. 38. www.it-playground.pl REST API ON CISCO ASA REST Client Web Server REST Daemon REST Agent JSON over HTTPS JSON over HTTPS CLI commands Debug/Syslog over TCP LINA Process Cisco ASA ¢ REST Client establishes HTTPS communication with ASA Web Server ¢ REST Client sends API request with authentication header ¢ Web Server opens internal connection to REST Agent, forwards the HTTP request and wait for response
  39. 39. www.it-playground.pl REST API ON CISCO ASA REST Client Web Server REST Daemon REST Agent JSON over HTTPS JSON over HTTPS CLI commands Debug/Syslog over TCP LINA Process Cisco ASA ¢ REST Agent process API request, analyze user and session related information that are included in request, then invokes CLI commands specific to the request via LINA ¢ LINA process executes commands and gather results and sends is back to REST Agent ¢ REST Agent prepares the response and sends it to Web Server ¢ Web Server forwards the response to REST Client
  40. 40. www.it-playground.pl REST API ON CISCO ASA ¢ How to run REST API on ASA — It’s already built-in in ASAv, just need to activate — For other platform download package from cisco.com ¢ Upload file to flash memory — Ensure there user is created preferably with privilege 15 — Ensure http server is running ¢ Optionally, but recommended, I to have valid SSL certificate — Enable REST API rest-api image boot:/asa-restapi-132-lfbff-k8.SPA rest-api agent
  41. 41. www.it-playground.pl REST API ON CISCO ASA ¢ Debugging asav-1# debug rest-api ? agent Rest-API Agent cli Rest-API cli handling client Rest-API client request handling daemon Rest-API debug/syslog handling process Starting/Stopping of Rest-API Agent token-auth Rest-API Token authentication <cr>
  42. 42. www.it-playground.pl REST API ON CISCO ASA ¢ Documentation — Cisco ASA REST API Quick Start Guide - http://www.cisco.com/c/en/us/td/docs/security/asa/api/qsg-asa-api.html — Release Notes for the Cisco ASA Series REST API ¢ Current version: 1.3(2)-100 — Directly on your firewall! ¢ https://name.of.your.firewall/doc/ ¢ With code examples ¢ Execute REST API methods directly from documentation!
  43. 43. www.it-playground.pl REST API ON CISCO ASA
  44. 44. www.it-playground.pl TOOLS I USE
  45. 45. www.it-playground.pl REST CLIENT ¢ REST API Client is required for testing API calls and responses — You can easily test different resources — You can see response content — You can try different parameters and learn objects structure ¢ RESTClient extension for Firefox
  46. 46. www.it-playground.pl REST CLIENT ¢ POSTMAN
  47. 47. www.it-playground.pl CODE EDITOR - ATOM ¢ Cross-platform editing ¢ Highly customizable — Plug-ins — Themes ¢ Package manager ¢ Smart autocomplete ¢ Multiple panes and more! https://atom.io
  48. 48. www.it-playground.pl CODE EDITOR - XCODE ¢ Native Swift/Objective-C IDE ¢ Easy to work with ¢ UI Designer ¢ Simulator ¢ Smart autocomple ¢ Extended help
  49. 49. www.it-playground.pl PROGRAMMING LANGUAGE ¢ Why Perl? — I don’t know Python (so far!) — I had some experience with Perl ¢ Why Apple Swift? — I got bored one evening ;) — I wanted to check if I can learn basics just by myself based on documentation and examples — I’ve heard good opinions about Swift language from professional developers
  50. 50. www.it-playground.pl TOPOLOGY ¢ Simulation in Cisco VIRL ¢ Details at: http://blog.it-playground.pl/2016/11/14/cisco-asa-rest-api- lab-topology-and-programming-language
  51. 51. www.it-playground.pl TOPOLOGY
  52. 52. www.it-playground.pl EXAMPLE #1 – CHECK END-TO-END ROUTING
  53. 53. www.it-playground.pl EXAMPLE #1 – CHECK END-TO-END ROUTING ¢ How we can get routing information in REST API? — If this is static route we can call GET method on resource /api/routing/static — Returned is JSON array that starts with general information — This is limited only to static routes!
  54. 54. www.it-playground.pl EXAMPLE #1 – CHECK END-TO-END ROUTING
  55. 55. www.it-playground.pl EXAMPLE #1 – CHECK END-TO-END ROUTING ¢ How we can get routing information in REST API? — We can execute show route command and parse output
  56. 56. www.it-playground.pl EXAMPLE #1 – CHECK END-TO-END ROUTING ¢ Easy to parse text in perl
  57. 57. www.it-playground.pl EXAMPLE #1 – CHECK END-TO-END ROUTING CODE EXAMPLES IN PERL AND DEMO
  58. 58. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS
  59. 59. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS ¢ Script written in node.js — Simple http server listening on port 8080 — Every time there is incoming connection it use REST API to connect to firewall ¢ Fetch ACL assigned to interface „lxc-sshd-5” ¢ Display source objects assigned to ACL entries
  60. 60. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS ¢ Node.js — JavaScript runtime built on Chrome's V8 JavaScript engine — Uses an event-driven, non-blocking I/O model — Lightweight and efficient — Multiplatform — HTTP designed with streaming and low latency in mind
  61. 61. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS ¢ Every chunk of retreived data is placed in table ¢ Done in asynchronous mode for better performance ¢ This part is executed every time new connection is established to HTTP server we run as a part of the script
  62. 62. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS ¢ JSON objects are parsed using internal library ¢ Parsing starts when connection to REST API is finished ¢ Parsing done by simple forEach() loop
  63. 63. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS
  64. 64. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS
  65. 65. www.it-playground.pl EXAMPLE #2 – DISPLAY ACL OBJECTS CODE EXAMPLES IN NODE.JS AND DEMO EXAMPLE #3 – CHECK ASA VERSION ON YOUR IPHONE CODE EXAMPLES IN SWIFTAND DEMO
  66. 66. www.it-playground.pl RESOURCES
  67. 67. www.it-playground.pl MORE RESOURCES ¢ Visit my pages for more detailed information on presented scripts — REST API tutorial on my blog -> https://blog.it-playground.pl — Source code on GitHub -> https://github.com/WojciechowskiPiotr/ccieplayground ¢ How to learn? — DevNet Learning Labs @Cisco -> https://learninglabs.cisco.com/ — CODING 101 API REST Basics with DevNet’s Brett Tiller ¢ This Thursday at 7pm CET via WebEx — GNS3 Academy -> http://academy.gns3.com — Build your own lab on Cisco VIRL
  68. 68. www.it-playground.pl QUESTIONS?
  69. 69. www.it-playground.pl THANK YOU FOR JOINING THIS SESSION

×