Introduction
This document describes how to convert vEdge from vManage mode to CLI mode by vManage API.
Prerequisites
Requirements
Cisco recommends that you have knowledge of these topics:
- Cisco Software-defined Wide Area Network (SD-WAN)
- Postman
Components Used
The information in this document is based on these software and hardware versions:
- Cisco vManager version 20.9.4
- Cisco vEdge version 20.9.4
- Postman version 11.63.0
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Background Information
- Cisco SD-WAN vManage API is a REST API interface for controlling, configuring, and monitoring the Cisco devices in an overlay network.
- REST architecture uses a stateless, client–server, cacheable communications protocol.
- REpresentational State Transfer (REST) is an architecture style for designing web-services applications.
- Test API calls can be tried out from swagger UI.
- Sometimes, it is impossible to modify the management mode of vedge through the GUI interface. In such cases, choosing to modify the management mode through the API is another feasible approach.
- The vManage API documentation is accessible via https://<vmanage_ip>:<port>/apidocs for reference on available API calls.
URL Structure Components
https://<vmanage_ip>:<port>/apidocs/#/Configuration%20-%20Template%20Configuration/updateDeviceToCLIMode
Command Properties
|
Command Syntax
|
Description
|
Protocol
|
http:// or https://
|
Protocol over which data is sent between client and server
|
Server or Host
|
<vmanage-ip:port>
|
Resolves to the IP and port to which to connect
|
Resource
|
/apidocs/#/Configuration%20-%20Template%20Configuration/updateDeviceToCLIMode
|
The location of the data or object of interest
|
Access Onboard API Documentation
vManage onboard API documentation is at the URL https://<vmanage_ip>:<port:>/apidocs. This documentation displays APIs available on the current software version.
This requires log in with valid vManage credentials. While multiple privilege levels can view documentation, only a netadmin user is able to execute all of them.
Note: The API documentation page is available to tenants in a multitenant environment, however, certain commands are restricted to the provider only.
vManage then displays a list of categories of available APIs. Click the desired category, followed by the API call itself, which displays these fields:
Description/Implementation Notes
|
Description of the operation performed.
|
Parameters
|
Required parameters to be specified for the API call.
|
Request Body (POST/PUT/DELETE)
|
Format of the request body.
|
Responses
|
Possible responses which vManage sends to the API. This includes HTTP status code, reason, and the possible response body.
|
Extensions
|
Valid extensions for the call.
|
Note: From the 20.6 release, the system introduces these rate limits: Bulk API: 48 requests/minute All other API: 100 requests/second.
Warning: Real-time monitoring APIs are CPU intensive and must be used only for troubleshooting, not continuous monitoring.
Test APIs from the Documentation Tool
Step 1:Login to the vManage GUI to Check that the Management mode of vEdge is vManage

Step 2:Modify the URL to LoginCisco SD-WAN vManage API
Login https://10.124.x.x/apidocs/

Step 3: Navigate to Configuration - Template Configurationin the Cisco SD-WAN vManage API

Step 4:ClickTry it out Button

Step 5:Change DeviceId and DeviceIP
- deviceId == uuid
- deviceIP == local-system-ip

Step 6:Click Execute Button
Step 7:Check vEdge mode in vManage GUI
The vedge management mode has been switched from vManage to CLI status.

Test APIs from the Postman Tool
Step 1: Login to vManage and obtain the Session Cookie
Request method: POST
URL: https://<vmanage-ip>/j_security_check
Postman configuration
Headers: Content-Type:application/x-www-form-urlencoded
Body type: x-ww-form-urlencoded
Body content:
- j_username=admin
- j_password=xxx


After a successful login, vManage returns the Cookie of JSESSIONID; Cookies are saved automatically.
Step 2: Obtain the CSRF Token
Request method: GET
URL: https://<vmanage-ip>/dataservice/client/token
Postman configuration
Headers: Content-Type:application/x-www-form-urlencoded
Body type: x-ww-form-urlencoded
Body content:
- j_username=admin
- j_password=xxx

Step 3:Get the device UUID and IP
Request method: GET
URL: https://<vmanage-ip>/dataservice/template/config/device/mode/vmanage?type=vedge
Postman configuration
Headers:
- Content-Type:application/json
- X-XSRF-TOKEN: E9C81862C46DA9F8C9A650272E8D577C415999496A990B771EEFB8F05C37DBEFA7759A20816ACC2DCF795A912C9ECD23A68A
Body type: x-ww-form-urlencoded
Body content:
- j_username=admin
- j_password=xxx


Step 4: Unbind the configuration template of vEdge
Request method: POST
URL: https://<vmanage-ip>/dataservice/template/config/device/mode/cli
Postman configuration
Headers:
- accept:application/json
- Content-Type:application/json
- X-XSRF-TOKEN: E9C81862C46DA9F8C9A650272E8D577C415999496A990B771EEFB8F05C37DBEFA7759A20816ACC2DCF795A912C9ECD23A68A
Body type: raw (JSON)
Body content:
{"deviceType":"vedge","devices":[{"deviceId":"cfca8af1-8f4d-faba-xxx","deviceIP":"xxx"}]}
Related Information