Yang-Cheat-Sheet-V1.1.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
YumaWorks Automating the Internet YANG Cheat Sheet (c) Copyright 2013, 2016 YumaWorks, Inc. Version 1.1 www.yumaworks.com module-stmt body-stmt module module-name { extension extension-name { rpc rpc-name { yang-version 1 | 1.1; argument argument-name { grouping grouping-name { if-feature “feature-spec”; // 0 or more namespace “uri-string”; yin-element true|false; status current|deprecated|obsolete; status current|deprecated|obsolete; prefix “prefix-string”; } description “description text”; description “description text”; status current|deprecated|obsolete; reference “reference text”; reference “reference text”; // 0 or more imports description “description text”; typedef-stmt; // 0 or more typedef-stmt; // 0 or more import “module-name” { reference “reference text”; grouping-stmt; // 0 or more grouping-stmt; // 0 or more prefix “prefix-string”; } data-def-stmt; // 0 or more input { revision-date “date-string”; action-stmt; // 0 or more ┼ must-stmt; // 0 or 1 ┼ description “revision description”; ┼ feature feature-spec{ notification-stmt; // 0 or more ┼ typedef-stmt; // 0 or more reference “revision reference”; ┼ if-feature “feature-spec”; // 0 or more } grouping-stmt; // 0 or more } status current|deprecated|obsolete; data-def-stmt; // 1 or more description “description text”; [data-def-stmt] } // 0 or more includes reference “reference text”; output { include “submodule-name” { } augment “/path/to/augment/target” { must-stmt; // 0 or 1 ┼ revision-date “date-string”; when “xpath-expr”; typedef-stmt; // 0 or more description “revision description”; ┼ identity identity-name { if-feature “feature-spec”; // 0 or more grouping-stmt; // 0 or more reference “revision reference”; ┼ base identity-base; // 0 or 1, 0 or more ┼ status current|deprecated|obsolete; data-def-stmt; // 1 or more } status current|deprecated|obsolete; description “description text”; } description “description text”; reference “reference text”; } organization “org-name”; reference “reference text”; data-def-stmt | case-stmt | // 1 or more contact “contact info”; } action-stmt | notification-stmt; ┼ deviation “/path/to/deviation/target” { description “module description”; } description “description text”; reference “module reference”; notification notification-name { reference “reference text”; if-feature “feature-spec”; // 0 or more typedef type-name { deviate not-supported; // option 1 // 0 or more revision identifiers status current|deprecated|obsolete; type-stmt; deviate operation { // option 2, 1 or more revision “date-string” { description “description text”; units “units name”; units “units name”; description “revision description”; reference “reference text”; default “default value”; must “xpath-expr”; // 0 or more reference “revision reference”; must-stmt; // 0 or 1 ┼ status current|deprecated|obsolete; unique “unique-leafs”; // 0 or more } typedef-stmt; // 0 or more description “description text”; default “default value”; // 0 or more ┼ grouping-stmt; // 0 or more reference “reference text”; type-stmt; body-stmt; // 0 or more data-def-stmt; // 0 or more } } } } } type-stmt data-def-stmt type integer{ container name { range “range-expr”; // 0 or 1 when “xpath-expr”; } if-feature “feature-spec”; // 0 or more list name { anydata name { ┼ must “xpath-expr”; // 0 or more when “xpath-expr”; when “xpath-expr”; // integer = [u]int (8, 16, 32, 64) presence “presence description”; if-feature “feature-spec”; // 0 or more if-feature “feature-spec”; // 0 or more config true|false; must “xpath-expr”; // 0 or more must “xpath-expr”; // 0 or more type decimal64 { status current|deprecated|obsolete; key “key leafs”; // req. if config=true config true|false; fraction-digits “integer”; // value is 1..18 description “description text”; unique “unique-leafs”; // 0 or more mandatory true|false; range “range-expr”; // 0 or 1 reference “reference text”; config true|false; status current|deprecated|obsolete; } typedef-stmt; // 0 or more min-elements number; // default 0 description “description text”; grouping-stmt; // 0 or more max-elements number | unbounded; reference “reference text”; type string { data-def-stmt; // 0 or more ordered-by user | system; } length “range-expr”; // 0 or 1 action-stmt; // 0 or more ┼ status current|deprecated|obsolete; pattern “pattern-expr”; // 0 or more notification-stmt; // 0 or more ┼ description “description text”; uses grouping-name { } } reference “reference text”; when “xpath-expr”; typedef-stmt; // 0 or more if-feature “feature-spec”; // 0 or more type enumeration { leaf name { grouping-stmt; // 0 or more status current|deprecated|obsolete; enum “enum-string” { when “xpath-expr”; data-def-stmt; // 0 or more description “description text”; if-feature “feature-spec”; // 0 or more ┼ if-feature “feature-spec”; // 0 or more action-stmt; // 0 or more ┼ reference “reference text”; value integer; type-stmt; notification-stmt; // 0 or more ┼ refine-stmt; // 0 or more status current|deprecated|obsolete; units “units name”; } uses-augment-stmt; // 0 or more description “description text”; must “xpath-expr”; // 0 or more } reference “reference text”; default “default value”; choice name { } // 1 or more config true|false; when “xpath-expr”; // not a data-def-stmt } mandatory true|false; // no default if true if-feature “feature-spec”; // 0 or more action action-name { ┼ status current|deprecated|obsolete; default “case name”; if-feature “feature-spec”; // 0 or more type bits { description “description text”; config true|false; status current|deprecated|obsolete; bit “bit-name” { reference “reference text”; mandatory true|false; description “description text”; if-feature “feature-spec”; // 0 or more ┼ } status current|deprecated|obsolete; reference “reference text”; position “integer”; description “description text”; typedef-stmt; // 0 or more status current|deprecated|obsolete; leaf-list name { reference “reference text”; grouping-stmt; // 0 or more description “description text”; when “xpath-expr”; case-stmt | short-case-stmt; // 0 or more input { reference “reference text”; if-feature “feature-spec”; // 0 or more } must-stmt; // 0 or 1 } // 1 or more type-stmt; typedef-stmt; // 0 or more } units “units name”; short-case-stmt = 1 of grouping-stmt; // 0 or more must “xpath-expr”; // 0 or more choice-stmt ┼ data-def-stmt; // 1 or more type identityref { default “default value”; // 0 or more ┼ container-stmt } base “identity-base”; // 1, 1 or more ┼ config true|false; leaf-stmt output { } min-elements number; // default 0 leaf-list-stmt must-stmt; // 0 or 1 max-elements number | unbounded; list-stmt typedef-stmt; // 0 or more type leafref { ordered-by user | system; anydata-stmt ┼ grouping-stmt; // 0 or more path “path-expr”; status current|deprecated|obsolete; anyxml-stmt data-def-stmt; // 1 or more require-instance true|false; ┼ description “description text”; } } reference “reference text”; anyxml name { } } when “xpath-expr”; type boolean; if-feature “feature-spec”; // 0 or more type empty; case name { must “xpath-expr”; // 0 or more type binary { when “xpath-expr”; config true|false; length “range-expr”; // 0 or 1 if-feature “feature-spec”; // 0 or more mandatory true|false; Key } status current|deprecated|obsolete; status current|deprecated|obsolete; blue text = keyword description “description text”; description “description text”; green text = string content type union { reference “reference text”; reference “reference text”; red text = comment type-stmt; // 1 or more data-def-stmt; // 0 or more } italics = optional } } ┼ = YANG version 1.1 type instance-identifier { require-instance true|false: }.