cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1678
Views
5
Helpful
2
Replies

How to SSH to a device through viptela rest API?

According to the sdwan rest api SSH documentation,

 

POST ​/newssh/connection/{deviceId}
      "Create SSH session"

after querying above url with device ID and username and password,

we get the following output

 

{
  "header": {
    "generatedOn": 1630319198511
  },
  "data": {
    "connectURL": "/shell/1dbc9071-1d8f-4fb2-988f-9e075fdf1c1c",
    "destroyURL": "dataservice/newssh/disconnect/1dbc9071-1d8f-4fb2-988f-9e075fdf1c1c",
    "sessionId": "1dbc9071-1d8f-4fb2-988f-9e075fdf1c1c",
    "remoteVMSessionId": "57f07d4d-096b-42ef-bbed-3533dbb3bbfa",
    "deviceId": "10.161.205.241",
    "uuid": "ISR4331/K9-FDO22100H0Q",
    "requestjSessionId": "7E3RJDXABmsUujhIyKdVXdDTh3YdCOYpOMHfRwrX"
  }
}

Now how do we connect this session URL and run some sample show commands?

Is there another way to run show commands on vmanage edge router?

 

The documentation is not clear on this.

1 ACCEPTED SOLUTION

Accepted Solutions
bigevilbeard
Cisco Employee

@RakeshKulkarni82221 i am not sure if sending show commands or others are possible. As you mentioned you send the following POST

 

/dataservice/newssh/connection/10.10.1.17

With payload

 

{"password":"admin","username":"admin"}

I am also presented with a connectURL / sessionID - but unable to send payloads via other calls. This is due to the API using the 

ShellInABox sessions to connect to the device maybe. There is no further payloads in the developer tools in POST requests. The other API commands i see are disconnect and retrieve SSH enabled devices. I would suggest this question is asked to TAC or your Cisco AM and to be routed to the API team at SD-WAN. My guess at this stage is if you wanted to connect to the devices via SSH NETCONF is used and done directly to the devices, not via the API in vManage.
 
Hope this helps.

View solution in original post

2 REPLIES 2
bigevilbeard
Cisco Employee

@RakeshKulkarni82221 i am not sure if sending show commands or others are possible. As you mentioned you send the following POST

 

/dataservice/newssh/connection/10.10.1.17

With payload

 

{"password":"admin","username":"admin"}

I am also presented with a connectURL / sessionID - but unable to send payloads via other calls. This is due to the API using the 

ShellInABox sessions to connect to the device maybe. There is no further payloads in the developer tools in POST requests. The other API commands i see are disconnect and retrieve SSH enabled devices. I would suggest this question is asked to TAC or your Cisco AM and to be routed to the API team at SD-WAN. My guess at this stage is if you wanted to connect to the devices via SSH NETCONF is used and done directly to the devices, not via the API in vManage.
 
Hope this helps.

View solution in original post

Thanks, Please update once you here from API team, I will take a look into NETCONF.

Create
Recognize Your Peers
Content for Community-Ad