GithubHelp home page GithubHelp logo

Comments (7)

ljyfree avatar ljyfree commented on June 29, 2024

You could try /usr/sbin/clish_start in mgmt-framework docker.

from sonic-mgmt-framework.

asydney avatar asydney commented on June 29, 2024

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.

ljyfree avatar ljyfree commented on June 29, 2024

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.

asydney avatar asydney commented on June 29, 2024

Indeed.. I came across this same info from the URL below:

https://github.com/Azure/SONiC/blob/master/doc/mgmt/Management%20Framework.md#322415-api-documentation

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.

ljyfree avatar ljyfree commented on June 29, 2024

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.

mayuresh82 avatar mayuresh82 commented on June 29, 2024

@ljyfree i dont think you have any clue about what the OP is asking so please refrain from shit-posting

from sonic-mgmt-framework.

ljyfree avatar ljyfree commented on June 29, 2024

@mayuresh82 Thanks for your kind reminder,shit-posting judge.

from sonic-mgmt-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.