Comments (7)
You could try /usr/sbin/clish_start in mgmt-framework docker.
from sonic-mgmt-framework.
I hopped onto "mgmt-framework" docker container and "/usr/sbin/cli/clish_start" provides an interface to execute commands. However, it's not clear how it can be used remotely.
Let me clarify the original question... I would like to execute a command such as "show version" from a remote host, to a switch running SONiC: below is the topology that shows the connection between my remote_host system and the sonic switch:
remote_host <-> sonic_switch
Below is an example of how this can be done using "curl" assuming our switch has management IP 192.168.1.5 and has a rest server listening on port 80 with the REST endpoint "comman-api":
remote_host> curl --insecure -u admin -H "Content-Type: application/json" -X POST -d '{"jsonrpc":"2.0", "method":"runCmds", "params":{ "version":1, "cmds":["show version"], "format":"json"}, "id":""}' http:///192.168.1.5:80/command-api | json_reformat
So how could I execute "show version" similarly for sonic switches?
from sonic-mgmt-framework.
All I know is that you could open SONiC REST API explorer on https://192.168.1.5/ui ,which were compiled from yang model.
As for "comman-api" , I have no clue.
from sonic-mgmt-framework.
Indeed.. I came across this same info from the URL below:
When I click on a given definition (e.g. openconfig-interfaces.yaml), there are a list of REST endpoints and for example, when I click on "GET /openconfig-interfaces:interfaces", I"m provided with the "curl" command executed (e.g. curl -X GET "https://192.168.122.10/restconf/data/openconfig-interfaces:interfaces" -H "accept: application/yang-data+json"), the request URL and also the response.
So I'm investigating a bit to determine if I can use this interface to perhaps convert the CLI commands to their REST equivalents.
from sonic-mgmt-framework.
I realize your request looks like “Docker to Host Comminication”,which was described in https://github.com/Azure/SONiC/blob/master/doc/mgmt/Docker%20to%20Host%20communication.md
from sonic-mgmt-framework.
@ljyfree i dont think you have any clue about what the OP is asking so please refrain from shit-posting
from sonic-mgmt-framework.
@mayuresh82 Thanks for your kind reminder,shit-posting judge.
from sonic-mgmt-framework.
Related Issues (20)
- sonic-cli start failure HOT 1
- Question: sonic-cli missing in mgmt-framework compiled for platform vs
- Add support for all Yang models in the REST API
- Interface allows non existent VLAN to be tagged
- Consider replacing libcurl-gnutls with libcurl-openssl
- SONiC Mgmt FW - build time unit tests
- SONiC Mgmt FW - Nightly tests
- Enhance to use host-DBus & State-DB for platform info
- Data can not be defined in other DB than CONFIG_DB
- go.sum appears to be out-of-date
- How to edit the uri to test the rest-server?
- Don't install dependent packages in Makefile
- i need your help about file config!
- Handle python dependencies in this repo HOT 4
- Compilation issue : Make clean; Make all is not working in sonic-mgmt-framework HOT 1
- sonic-cli start failure HOT 2
- considering REST interface, how sonic-mgmt-framework different from sonic-restapi
- sonic-vlan allows 2 untagged vlans on the same interface
- openconfig-interfaces problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonic-mgmt-framework.