Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTCONF RPC operations #66

Merged
merged 3 commits into from
Oct 28, 2020

Conversation

sachinholla
Copy link
Contributor

Handle yang rpc operations through RESTCONF operations resource
requests -- "POST /restconf/operations/xxxxx". Here "xxxxx" is the yang
module qualified rpc name (like "ietf-system:system-restart"). Payload
should contain the json encoded rpc input data; or empty if rpc does not
define any input. REST server invokes translib.Action API to handle
these requests. On success, REST server returns 200 status with json
encoded rpc output data.

Handle "GET /restconf/operations" requests to return available yang rpc
operations. Clients can use this to discover avaiable rpc operations
resources. Sample output (assuming device supports 2 rpcs):

{
  "operations": {
    { "ietf-system:system-restart" : [null] },
    { "foo:bar" : [null] }
  }
}

Reference: RFC8040, section 3.3.2

REST server now handles "POST /restconf/operations/xxxxx" requests to
invoke translib.Action API.
Handle "GET /restconf/operations" requests to return available yang rpc
operations. Only json encoded responses are supported - "accept" header
is ignored. Sample output (assuming device supports 2 rpcs):

{
  "operations": {
    { "ietf-system:system-restart" : [null] },
    { "foo:bar" : [null] }
  }
}

Reference: RFC8040, section 3.3.2
@renukamanavalan renukamanavalan merged commit f3b3f6f into sonic-net:master Oct 28, 2020
@sachinholla sachinholla deleted the operations_req branch October 29, 2020 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants