forked from sonata-nfv/tng-sdk-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: peusterm <[email protected]>
- Loading branch information
peusterm
committed
Feb 28, 2019
1 parent
a1cdd12
commit 906f83d
Showing
11 changed files
with
153 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
models/model.py | ||
# generated stuff | ||
results/ | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# tng-sdk-benchmark models | ||
|
||
YANG based models for PED files etc. | ||
YANG based models for PED files etc. | ||
|
||
## Build | ||
|
||
```sh | ||
make | ||
``` | ||
|
||
This will create HTML, tree, and UML documentation in `doc/`. |
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,6 @@ | ||
module: ietf-ped | ||
+--rw ped | ||
+--rw descriptor-schema? string | ||
+--rw vendor? string | ||
+--rw name? string | ||
+--rw version? string |
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,29 @@ | ||
'Download plantuml from http://plantuml.sourceforge.net/ | ||
'Generate png with java -jar plantuml.jar <file> | ||
'Output in img/<module>.png | ||
'If Java spits out memory error increase heap size with java -Xmx1024m -jar plantuml.jar <file> | ||
@startuml img/ietf-ped.png | ||
hide empty fields | ||
hide empty methods | ||
hide <<case>> circle | ||
hide <<augment>> circle | ||
hide <<choice>> circle | ||
hide <<leafref>> stereotype | ||
hide <<leafref>> circle | ||
page 1x1 | ||
Title ietf-ped | ||
note top of pe_ietf_ped : <b>Namespace: </b> urn:ietf:params:xml:ns:yang:ietf-ped \n<b>Prefix: </b> pe \n<b>Organization : </b>\n \n<b>Contact : </b>\n \n<b>Revision : </b> 2019-02-21 \n | ||
package "pe:ietf-ped" as pe_ietf_ped { | ||
class "ietf-ped" as ietf_ped << (M, #33CCFF) module>> | ||
class "ped" as ietf_ped_I_ped <<container>> | ||
ietf_ped *-- "1" ietf_ped_I_ped | ||
ietf_ped_I_ped : descriptor-schema : string = https://github.com/mpeuster/tng-sdk-benchmark/raw/feature-73/models/ped.yang | ||
ietf_ped_I_ped : vendor : string | ||
ietf_ped_I_ped : name : string | ||
ietf_ped_I_ped : version : string | ||
} | ||
|
||
center footer | ||
<size:20> UML Generated : 2019-02-28 22:37 </size> | ||
endfooter | ||
@enduml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
--- | ||
ped: | ||
descriptor-schema: "blaa" | ||
vendor: "com.vendor" | ||
name: "my_example" | ||
version: "0.1" |
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,28 @@ | ||
import model | ||
from model import ietf_ped | ||
from pyangbind.lib.serialise import pybindJSONDecoder | ||
import pyangbind.lib.pybindJSON as pybindJSON | ||
import yaml | ||
import json | ||
|
||
# | ||
# re-generate the model | ||
# pyang --plugindir $PYBINDPLUGIN -f pybind -o model.py ietf-ped.yang | ||
# | ||
|
||
#m = ietf_ped() | ||
#print(ietf_ped) | ||
#print(pybindJSON.dumps(m)) | ||
|
||
# | ||
#pybindJSONDecoder.load_ietf_json(data, None, None, obj=m.ped()) | ||
|
||
# json version | ||
#m2 = pybindJSON.load("example-instance.json", model, "ietf_ped") | ||
#print(m2.ped.vendor) | ||
|
||
# yaml version | ||
data = yaml.load(open("example-instance.yml", "r")) | ||
print(data) | ||
m3 = pybindJSON.loads(data, model, "ietf_ped") | ||
print(m3.ped.vendor) |