Help in doing an RPC call through RESTCONF? #24
Replies: 8 comments 2 replies
-
probably nothing, i haven't updated the examples in a while and will get
you an answer in the next hour or so.
…On Thu, Mar 16, 2023 at 4:29 PM Roberto Fronteddu ***@***.***> wrote:
I am trying to use curl to call the rotateTire method. The yang and the
code are the same as your example, I tried the following and other
variations:
$ curl -X POST http://localhost:8080/restconf/data/car:rotateTires
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12 100 12 0 0 12752 0 --:--:-- --:--:-- --:--:-- 12000Bad Request
$ curl -d "" -X POST http://localhost:8080/restconf/data/car/rotateTires
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 194 100 194 0 0 171k 0 --:--:-- --:--:-- --:--:-- 189k{"ietf-restconf:errors":{"error":[{"error-type":"protocol","error-tag":"operation-failed","error-path":"/restconf/data/car/rotateTires","error-message":"not found. no module found in path"}
]}}
```
Can you help me figure out what am I doing wrong?
—
Reply to this email directly, view it on GitHub
<#24>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7SLYF7L6GR4WFNSDSTW4NZ3FANCNFSM6AAAAAAV5WPGPQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks! Let me know if you want to see my code or the yang model. |
Beta Was this translation helpful? Give feedback.
-
wow, my bad, i introduced a bug when adding strict compliance. I updated
restconf master w/fix. you will need to update your version of examples.
I had outstanding changes so hopefully it don't disrupt you too much
…On Thu, Mar 16, 2023 at 6:11 PM Roberto Fronteddu ***@***.***> wrote:
Thanks! Let me know if you want to see my code or the yang model.
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7XF5HTP2KBAIGFBAWDW4OFYVANCNFSM6AAAAAAV5WPGPQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks! I just started working on this project and experimenting with what stack we could use so it is the perfect time for disruptive changes :) |
Beta Was this translation helpful? Give feedback.
-
That fixed it, I am now able to do RPC calls. I have another question if I set config false in a leaf, does that protect the leaf from being updated without using an RPC call? |
Beta Was this translation helpful? Give feedback.
-
re:fix
nice
re: config false
correct if i understand you correctly. Update cannot be attempted via RPC.
https://freeconf.org/docs/reference/yang-primer/#metrics
…On Fri, Mar 17, 2023 at 4:44 PM Roberto Fronteddu ***@***.***> wrote:
That fixed it, I am now able to do RPC calls.
I have another question if I set config false in a leaf, does that protect
the leaf from being updated without using an RPC call?
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7UU6VM3YONRFTHDUO3W4TELRANCNFSM6AAAAAAV5WPGPQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
config false means a PUT or POST to that to that field **directly** is not
possible
rpcs do whatever you want them too, update, clear, read so you can
**indirectly** change anything I suppose, but that is not really what they
were intended for.
…On Fri, Mar 17, 2023 at 5:39 PM Roberto Fronteddu ***@***.***> wrote:
You mean without right? I think in your example you called reset through
RPC to set miles to 0. While you changed the speed with a put.
—
Reply to this email directly, view it on GitHub
<#24 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7UONAAFBZAEQ7LHDUDW4TK2NANCNFSM6AAAAAAV5WPGPQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Yep it will become clear after some playing around.
…On Fri, Mar 17, 2023, 6:09 PM Roberto Fronteddu ***@***.***> wrote:
I was thinking of using RPC functionalities like that because it looked
like an easy way to pair incremental changes with sanity checks.
It is really not a configuration that I am changing but the dynamic state
of a component. I may be abusing RESTCONF a bit. I am just playing around
for now. I will check your other examples to see how you implemented
notifications and other features. There may be a more idiomatic way of
doing what I am attempting.
—
Reply to this email directly, view it on GitHub
<#24 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7RNPJGTEWHXKGCUSXLW4TOIPANCNFSM6AAAAAAV5WPGPQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am trying to use curl to call the rotateTire method. The yang and the code are the same as your example, I tried the following and other variations:
Beta Was this translation helpful? Give feedback.
All reactions