Git Product home page Git Product logo

Comments (11)

jktjkt avatar jktjkt commented on June 21, 2024 2

Please start by reading RFC 8342 which defines the semantics of various datastores. That should get you the big picture on what is possible with NETCONF/RESTCONF/YANG, and how any server-side implementation is expected to behave. Then, follow by reading sysrepo's documentation which explains how to implement these concepts in your code.

from sysrepo.

michalvasko avatar michalvasko commented on June 21, 2024 1

It does not matter whether you have some actual hardware or not. You keep asking general question but I will not explain you specifically all the basics since they are documented/implemented based on RPCs, I would just be repeating it.

from sysrepo.

michalvasko avatar michalvasko commented on June 21, 2024

Since temperature is a configuration node and you mentioned <get>, there are not many options to achieve this. For good reason, though, because why should you want to display a different configured value than the one that is configured?

Nevertheless, the situation is different when using <get-data> and the operational datastore. Having understood the principles of this datastore, sysrepo allows several ways of affecting what values are actually displayed, more in the docs.

from sysrepo.

hrmnboparai avatar hrmnboparai commented on June 21, 2024

Had there been a read only / state data node like lets say temperature is a state variable which not configurable, How will be change it ? Using edit_batch()

from sysrepo.

michalvasko avatar michalvasko commented on June 21, 2024

Changing state nodes is possible even for <get> using the same mechanisms as are described in the link I have posted before.

from sysrepo.

hrmnboparai avatar hrmnboparai commented on June 21, 2024

Actually Michal , I will explain you the situation. For the moment my NetConf implementation doesn't have a direct connection with hardware. Suppoe I have a source which is capable of doing everything on my device. It is something like if NetConf client sends me "edit-config" command I will forward it to source. If client calls "get" I will fetch info from source and change config and state data accordingly and then get will display that. Is this possible ?

from sysrepo.

hrmnboparai avatar hrmnboparai commented on June 21, 2024

Thanks for the support. I will go through different RPCs and then read the sysrepo docs again maybe then I understand better. Thank you for bearing with me

from sysrepo.

hrmnboparai avatar hrmnboparai commented on June 21, 2024

We possess a device that can be configured through a web interface; this functionality is entirely independent of Netconf. However, the client now desires a Netconf interface as well. The current situation unfolds as follows, assuming I provide both interfaces:

  1. A user modifies the configuration via NetConf, for instance, by setting the temperature to 100.
  2. Subsequently, another user adjusts the temperature to 120 using the web interface.
    In this scenario, Netconf remains oblivious to the altered configuration. Consequently, a <get>
    request for the temperature still returns 100, even though the actual running configuration is 120.

I comprehend that one potential solution involves making Netconf the sole interface for the system and routing the web server traffic through Netconf. Regrettably, this approach proves unfeasible within the existing system framework without a comprehensive overhaul. Given this constraint, I find myself contemplating the possibility of an alternative method. Specifically, I wonder if there exists a way for Netopeer2/sysrepo to access the configuration on the device itself, rather than solely interacting with its datastore, when performing a operation. I hope this clarifies the essence of my predicament.

I've made attempts to explore various methods and thoroughly reviewed the documentation multiple times. Despite these efforts, I haven't been able to arrive at a solution. Could you kindly offer assistance on this matter? Perhaps you could provide specific links or suggest APIs that I should refer to?

from sysrepo.

jktjkt avatar jktjkt commented on June 21, 2024

Nope, what you're asking for is not possible with this SW stack. You might get "almost there" through a lot of effort spent on custom datastore plugins, but doing that will break other parts of the SW stack in subtle ways (e.g., YANG push). Also, it will very likely require much more work compared to refactoring your existing SW so that it uses a central place for configuration storage.

from sysrepo.

hrmnboparai avatar hrmnboparai commented on June 21, 2024

Thank you for providing the information. I grasp that there isn't a straightforward approach for this task. However, I have a potential solution in mind. Whenever my web-based interface modifies a configuration, it can trigger a notification to NetConf/Sysrepo. With this approach, would it be possible to subsequently apply the updated configuration? I'm considering utilizing functions like sr_edit_batch() and sr_set_item() (please advise if there's a more suitable method). I'm optimistic about the feasibility of this approach. Is this doable ?

from sysrepo.

jktjkt avatar jktjkt commented on June 21, 2024

Yes; if you decide that your existing SW will:

  1. update your system config in the same way as it's currently doing, and
  2. push the updated configuration into sysrepo,

then you're all set. However, keep in mind that if you want to support editing the configuration through NETCONF as well, you'll need "something" which will "update your system config" based on a change in sysrepo. You've just described a situation where your "web UI" acts as another client to sysrepo. At that point you essentially have:

  1. something which updates your system config based on changes done in the web interface (that's what you have now),
  2. something which builds an edit and propagates the config update to sysrepo (you'll have to build this),
  3. something which updates your system config based on a change in sysrepo (you'll have to build this).

When you get there, you can remove component 1) from the story and you'll have a simpler system architecture.

from sysrepo.

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.