RPC operations in wrong location
pdumais opened this issue · 4 comments
pdumais commented
For example,
POST /restconf/operations/example-ops:reboot HTTP/1.1
Host: example.com
Content-Type: application/yang-data+json
{
"example-ops:input" : {
"delay" : 600,
"message" : "Going down for system maintenance",
"language" : "en-US"
}
}
does not work. We get an error saying "Expected format: http://server/restconf[=device]/operation/module:path"
But the RFC does not mention anything about "=device". Also, looking at server.go#L146, it seems that "operations" is simply not implemented and the error message is misleading
dhubler commented
re:operations
this is missing but only because i misinterpreted the spec. POST to
http://server/restconf/module:{rpc} would work. This is relatively easy
fix to server.go if you wanted to take a look
re:namespaced json (e.g. "example-ops:xyz")
this is missing, instead it would come out as just "xyz" which has the
potential for name collision. This would be a welcomed but bigger change.
re:Content-Types
library is pretty lax about requiring and returning proper types.
…On Wed, Aug 17, 2022 at 11:41 AM Patrick Dumais ***@***.***> wrote:
For example,
`
POST /restconf/operations/example-ops:reboot HTTP/1.1
Host: example.com
Content-Type: application/yang-data+json
{
"example-ops:input" : {
"delay" : 600,
"message" : "Going down for system maintenance",
"language" : "en-US"
}
}
`
does not work. We get an error saying "Expected format:
http://server/restconf[=device]/operation/module:path"
But the RFC does not mention anything about "=device". Also, looking at
server.go#L146
<https://github.com/freeconf/restconf/blob/141e395ecaf03235b0f16933ba8b8bc273f21c32/server.go#L146>,
it seems that "operations" is simply not implemented and the error message
is misleading
—
Reply to this email directly, view it on GitHub
<#4>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7QOB3IMTFD4YGIBFODVZUBYZANCNFSM562A5JPA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
pdumais commented
I can confirm that this fixes the issues I initially saw.
Any chance this can get merged?
dhubler commented
I'm working on a number of other issues (JSON namespacing, notification and
rpc input misformatting) and want to get a few more done before I am ready
to merge this into master because I'm developing a compliance settings at
the same time that will allow existing codebases to ease into new
compliance operations.
So I want to fix a few more before I'm ready to commit to how i'm
supporting this compliance API.
It should be safe to use this branch for your development and provide any
feedback on testing
…On Fri, Nov 11, 2022 at 8:04 AM Patrick Dumais ***@***.***> wrote:
I can confirm that this fixes the issues I initially saw.
Any chance this can get merged?
—
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7U7BTZJAWSLQTSXNTTWHY73TANCNFSM562A5JPA>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
dhubler commented
except for content types, all fixed on compliance branch. I'll open a separate issue for content types