-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from robshakir/rpc-parsing
Add support for RPC generation. * (M) pybind.py -- changed paths for RPCs to be modulename_rpc to ensure that there are not namespace conflicts. Only generate the modulename_rpc bindings when RPCs exist. Modify register_paths behaviour to be on a per-leaf element basis rather than by making path_helper False, since this resulted in the path_helper not being available where required to other leaves (e.g., leafrefs) * (M) lib/yangtypes.py -- check register_paths before determing whether to use the path_helper to register. * (A) tests/rpc/* -- added tests for RPCs.
- Loading branch information
Showing
5 changed files
with
370 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
module rpc { | ||
yang-version "1"; | ||
namespace "http://rob.sh/yang/test/rpc"; | ||
prefix "foo"; | ||
organization "BugReports Inc"; | ||
contact "A bug reporter"; | ||
|
||
description | ||
"A test module"; | ||
revision 2014-01-01 { | ||
description "april-fools"; | ||
reference "fooled-you"; | ||
} | ||
|
||
rpc check { | ||
description | ||
"Basic RPC with a single input argument"; | ||
input { | ||
leaf argument { | ||
type string; | ||
} | ||
} | ||
} | ||
|
||
rpc check-two { | ||
description | ||
"Basic RPC check with two leaves in output"; | ||
output { | ||
leaf arg-one { | ||
type int8; | ||
} | ||
|
||
leaf arg-two { | ||
type int8; | ||
} | ||
} | ||
} | ||
|
||
rpc check-three { | ||
description | ||
"RPC check with a container under input"; | ||
input { | ||
container arguments { | ||
leaf arg-one { | ||
type string; | ||
} | ||
|
||
leaf arg-two { | ||
type string; | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
rpc check-four { | ||
description | ||
"RPC check with multiple containers under output"; | ||
output { | ||
container arguments { | ||
leaf arg-one { | ||
type string; | ||
} | ||
} | ||
|
||
container arguments-two { | ||
leaf arg-two { | ||
type string; | ||
} | ||
} | ||
} | ||
} | ||
|
||
rpc check-five { | ||
description | ||
"RPC check with input and output structures"; | ||
|
||
input { | ||
container arguments { | ||
leaf arg-one { | ||
type string; | ||
} | ||
} | ||
} | ||
|
||
output { | ||
container return-values { | ||
leaf return-val { | ||
type int8; | ||
} | ||
} | ||
} | ||
} | ||
|
||
rpc check-six { | ||
description | ||
"RPC check with input and output values using a leafref which | ||
requires use of the XPATHHELPER"; | ||
|
||
input { | ||
leaf argument { | ||
type leafref { | ||
path "/test/reference-target"; | ||
require-instance true; | ||
} | ||
} | ||
} | ||
|
||
output { | ||
leaf out { | ||
type string; | ||
} | ||
} | ||
} | ||
|
||
container test { | ||
leaf-list reference-target { | ||
type string; | ||
} | ||
} | ||
} |
Oops, something went wrong.