open-traffic-generator / models-yang Goto Github PK
View Code? Open in Web Editor NEWYang models
License: MIT License
Yang models
License: MIT License
To reproduce the issue, get rid of -not -path *-isis.yang
in Step 3
.
The error I'm getting is:
F0316 09:09:08.672937 42963 generator.go:365] ERROR Generating GoStruct Code: template: keyHelper:4:37: executing "keyHelper" at <$key.IsPtr>: nil pointer evaluating *ygen.yangFieldMap.IsPtr
# install deps
go install google.golang.org/protobuf/cmd/[email protected] \
&& go install github.com/openconfig/ygot/[email protected] \
&& go install golang.org/x/tools/cmd/[email protected] \
# clone models-yang
git clone https://github.com/open-traffic-generator/models-yang
# generate stubs for all yang except isis (works)
COMMON_ARGS='
-path="models-yang/models"
-compress_paths
-generate_fakeroot
-fakeroot_name=device
-generate_simple_unions
-shorten_enum_leaf_names
-typedef_enum_with_defmod
-enum_suffix_for_simple_union_enums
-trim_enum_openconfig_prefix
-include_schema
-generate_append
-generate_getters
-generate_rename
-generate_delete
-generate_leaf_getters
-structs_split_files_count=3
-generate_populate_defaults
'
rm -rf pkg/telemetry && mkdir -p pkg/telemetry/device
generator \
-generate_structs \
-generate_path_structs=false \
-prefer_operational_state \
-list_builder_key_threshold=4 \
-output_dir=pkg/telemetry \
-package_name=telemetry \
-path_structs_split_files_count=3 \
${COMMON_ARGS} \
$(find models-yang/ -name *.yang -not -path *-isis.yang)
generator \
-generate_structs=false \
-generate_path_structs=true \
-prefer_operational_state \
-list_builder_key_threshold=4 \
-output_dir=pkg/telemetry \
-package_name=device \
-path_structs_output_file=pkg/telemetry/device/device.go \
-split_pathstructs_by_module=true \
-schema_struct_path=github.com/open-traffic-generator/ixia-c-gnmi-server/pkg/telemetry \
-trim_path_package_oc_prefix=true \
-path_struct_package_suffix="" \
-base_import_path=github.com/open-traffic-generator/ixia-c-gnmi-server/pkg/telemetry \
-path_structs_split_files_count=3 \
${COMMON_ARGS} \
$(find models-yang/ -name *.yang -not -path *-isis.yang)
find pkg/telemetry -name "*.go" -exec goimports -w {} +
find pkg/telemetry -name "*.go" -exec gofmt -w -s {} +
The enumeration and filtering in the open-traffic-generator-flow module is still a work in progress and should be removed from the main branch.
The open traffic generator flow module needs support for flow enumeration and filtering.
currently supported metrices:
module: open-traffic-generator-flow
+--rw flows
+--ro flow* [name metric-group]
+--ro name -> ../state/name
+--ro metric-group -> ../state/metric-group
+--ro state
| +--ro name? string
| +--ro metric-group? string
| +--ro loss-pct? otg-types:ieeefloat32
| +--ro out-frame-rate? otg-types:ieeefloat32
| +--ro in-frame-rate? otg-types:ieeefloat32
| +--ro out-rate? otg-types:ieeefloat32
| +--ro in-rate? otg-types:ieeefloat32
| +--ro counters
| +--ro in-octets? otg-types:counter64
| +--ro in-pkts? otg-types:counter64
| +--ro out-octets? otg-types:counter64
| +--ro out-pkts? otg-types:counter64
If we don't have transmit state we won't be able to determine state of that flow from gnmi-server
Remove path-id as generated yang schemas do not support optional attribute as a search key. If a prefix does not have path-id, then that prefix is not addressable in the yang schema. The search key does not allow nil pointers to path -id.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.