corenova / yang-express

YANG model-driven Express framework
Apache License 2.0
12 stars 4 forks source link

Enable PUT/PATCH operations on yangapi plugin #3

Open sekur opened 8 years ago

ramukima commented 8 years ago

The existing delete operation hangs as the response from server does not end. Missing "res.status(204).end()" probably.

On a POST, I always hit this line 'console.warn "[yangapi] cannot POST on #{req.path} (link exists)"' after a DELETE operation. You probably intended "DELETE" operation to be a disable feature. Somewhere the req.app.settings is not cleared after DELETE operation.

sekur commented 8 years ago

I'd call it an undocumented feature :-)

I've pushed it in there "untested" (gasp) thinking nobody will actually try this yet... but I should've known better, haha.

Yep, there's much more work needed on the "yangapi" remote hotplug deployment/management feature module. I'm confident that the underlying design/framework will support this construct effectively - since it was a foundational objective behind yang-js and yang-express (even yang-forge) from day one but still a number of key open considerations that need to get worked out.

sekur commented 8 years ago

On the yangapi endpoint, I'm thinking I'll mount it on a new /yangapi endpoint instead of serving at the top-level /.

This way I can support bulk-POST directly into /yangapi and also allow for list discovery of already loaded YANG schema collections (kind of like what ietf-yang-library tries to do). I will still preserve the /yangapi/some-module.yang routes for more granular control on a per-model basis.

I'm thinking the top-level / route should be reserved for some future default feature plugin (just not sure what yet).

ramukima commented 8 years ago

You spoke my mind. Yes, that would be more desired. In fact, not just yangapi, but all other e.g. restconf etc could have a dedicated endpoint and models hang off of the relevant endpoint.

Not sure if you targeted true RESTCONF specification to be implemented in future. If not, its good to change the endpoint name to something else to avoid confusion.