DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

Let’s explore the Cisco vManage REST API next. The API
documentation can be found at https://sdwan-
docs.cisco.com/Product_Documentation/Command_Re
ference/Command_Reference/vManage_REST_APIs.
At this link, you can find all the information needed on
how to interact with the REST API, all the resources
available, and extensive explanations.


You need to establish a connection to the Cisco vManage
instance. The initial connection is established through an
authorization request to
https://sandboxsdwan.cisco.com:8443/j_security_chec
k. The information sent over this POST call is URL form
encoded and contains the username and password
mentioned previously. The curl request for this
authorization request should look as follows:


Click here to view code image


curl -c - -X POST -k \

https://sandboxsdwan.cisco.com:8443/j_security_check
\
-H 'Content-Type: application/x-www-form-
urlencoded' \
-d 'j_username=devnetuser&j_password=Cisco123!'

The -c - option passed to the curl request specifies that
the returned authorization cookie should be printed to
the console. The -k option bypasses SSL certificate
verification as the certificate for this sandbox is self-
signed. The output of the command should look as
follows:


Click here to view code image


# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your
own risk.
Free download pdf