Comments (11)
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.
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.
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.
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.
Changing state nodes is possible even for <get>
using the same mechanisms as are described in the link I have posted before.
from sysrepo.
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.
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.
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:
- A user modifies the configuration via NetConf, for instance, by setting the temperature to 100.
- 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.
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.
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.
Yes; if you decide that your existing SW will:
- update your system config in the same way as it's currently doing, and
- 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:
- something which updates your system config based on changes done in the web interface (that's what you have now),
- something which builds an edit and propagates the config update to sysrepo (you'll have to build this),
- 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)
- How to get unique identifiers for netopeer client subscriptions HOT 6
- Callback not being called by sysrepo HOT 1
- Internal error (sysrepo/src/shm_sub.c:4532). HOT 3
- Queries related to stable version HOT 2
- Merge configuration diff error after the yang modules have been changed. HOT 8
- Question: What's the best way to recover from an "abnormal exit"? HOT 10
- delete item on "operational" possibly corrupted the datastore HOT 7
- Question: Is it possible for multiple processes to access the same module in operational datastore at the same time? HOT 5
- netopeer2 does not see all yang modules in sysrepo HOT 6
- (leaf-)list instance move checks is not working HOT 1
- How to get (sr_session_ctx_t *) session from (sr_subscription_ctx_t * ) subscription? HOT 3
- How to extract stream argument of netopeer2-cli subscribe command? HOT 2
- Missing dependent libraries for rpm installation. HOT 1
- Wrong path imported for xpath reference HOT 2
- Rules for emitting changes to subtrees? HOT 6
- Not found node "diffserv-markings" in path HOT 1
- netopeer2-server assert in sr_edit_find_match() HOT 2
- sr_oper_get_subscribe callback not updating data in Parent node HOT 8
- UTF-8 validation is missing on operational datastore HOT 1
- Delete operation on operational on a leaf-list element in a module container tagged with config false does nothing HOT 16
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 sysrepo.