Access Level (Login And Logout) - Cisco D9800 Reference Manual

Network transport receiver
Hide thumbs Also See for D9800:
Table of Contents

Advertisement

Access Level (Login and Logout)

To access a single API, you can use cURL. For more information, see https://curl.haxx.se/. Since SSL
certificates on D9800 units are self-signed, you can use "-k DEFAULT" options to bypass the security checks
of the cURL command.
Example 1:
curl -k -i -H "X-SESSION-ID: $token" "https://192.168.0.1/ws/v2/test/show/id-eeprom"
Example 2:
curl -k "https://192.168.0.1/ws/v2/test/show/id-eeprom&session=$token"
The DEFAULT –k cipher option might not be available in older versions of the cURL command. An
Note
updated version of the tool is required to enable this option. Follow your operating systems instructions
to update your cURL. For example, on CEL/Fedora, issue the following command as a root user and then
restart:
yum update curl
The
in order to propagate the HTTP session_id. The
environment) environment variable that is based on the value of the XML <SESSION></SESSION> item
from the successful Login response.
For an example of the login command, and setting the $token environment variable, see
and Logout), on page
Access Level (Login and Logout)
When you successfully log in to a session, an access level is assigned. Access levels are confirmed on a per
API basis, and depending on the access level, the behavior of the API may change.
1 No Access - No session available.
2 Guest - Guest session is active.
3 User - User session is active.
4 Admin - Admin session is active.
The following is an example of the Login command.
Input:
curl -k https://192.168.0.1/ws/v1/table?t=return -X POST -d
"<HDR><LOGIN><UID>admin</UID><USERPASS>localadmin</USERPASS></LOGIN></HDR>" -H "Content-Type:
text/xml; charset=UTF-8"
Expected output:
?xml version="1.0" encoding="ISO-8859-1"?>
<HDR><TABLE><ITEM><ID>STATUS</ID><VALUE>Please wait while the default page loads up
. . . . < / V A L U E > < / I T E M > < L O G I N _ I N F O > < U S E R _ N A M E > a d m i n < / U S E R _ N A M E > < U S E R _ R O L E > A D M I N < / U S E R _ R O L E > < S E S S I O N _ I D > T o k e n V a l u e < / S E S S I O N _ I D > < / L O G I N _ I N F O > < / T A B L E > < / H D R >
Where Session
In each of the commands described in this document, the
"session=$token"
Cisco D9800 Network Transport Receiver Version 2.75 RESTful Web Services API Reference Guide
2
–H "X-SESSION-ID: $token"
2.
should be used in each subsequent Web Server API commands.
TokenValue
) portion of the curl request syntax passes the value of
(or
) part of the cURL syntax is required for each command
session=$token
represents a Linux (or Cygwin if that is the Host
$token
–H "X-SESSION-ID: $token"
Web Services API
Access Level (Login
(or appended
environment variable.
$token

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents