Commit 5bf6de85 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ additional examples and generated output

* moved example to a different folder
parent 859e452f
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
// Contents of "acme-system.yang"
module acme-system {
    namespace "http://acme.example.com/system";
    prefix "acme";

    organization "ACME Inc.";
    contact "joe@acme.example.com";
    description
        "The module for entities implementing the ACME system.";

    revision 2007-06-09 {
        description "Initial revision.";
    }

    container system {
        leaf host-name {
            type string;
            description "Hostname for this system";
        }

        leaf-list domain-search {
            type string;
            description "List of domain names to search";
        }

        container login {
            leaf message {
                type string;
                description
                    "Message given at start of login session";
            }

            list user {
                key "name";
                leaf name {
                    type string;
                }
                leaf full-name {
                    type string;
                }
                leaf class {
                    type string;
                }
            }
        }
    }
}
 No newline at end of file
+34 −0
Original line number Diff line number Diff line
@@ -31,7 +31,41 @@ module example-sports {
        leaf season { type season; }
        leaf number { type uint16; mandatory true; }
        leaf scores { type uint16; default 0; }
        leaf-list score-list { type uint16; }
      }
      leaf protocol {
        type enumeration {
          enum tcp;
          enum udp;
          enum icmp;
        }
        default "tcp";
      }
    }
    list protocols {
      key "associated-layer-protocol";

      leaf associated-layer-protocol {
        type string;
        
        description
          "One of the values of the attribute layerProtocol of the Cpd
           IE.";
        reference
          "GS NFV IFA011: Section 7.1.6.8 CpProtocolData information
           element";
      }
	}
  }
	grouping g1 {
	  leaf protocoly {
	    type enumeration {
	      enum tcp;
	      enum udp;
	      enum icmp;
	    }
	    default "tcp";
	  }
	
	}
}
 No newline at end of file
+61 −0
Original line number Diff line number Diff line
Package generated_from_sports_yang {
    Type String
    Type TODO_RESOLVE_REFERENCED
    Use "sports.yang" as SOURCE_MAPPING
    Structure system (
        string host_name,
        string_collection domain_search,
        login login
    )
    Type string
    Collection string_collection of string
    Structure login (
        string message,
        user_collection user
    )
    Structure user (
        string ^name,
        string full_name,
        string class
    )
    Collection user_collection of user
    Structure sports (
        person_collection person,
        team_collection team,
        protocols_collection protocols
    )
    Structure person (
        string ^name,
        date_and_time birthday
    )
    Collection person_collection of person
    Type date_and_time extends string
    Structure team (
        string ^name,
        player_collection player,
        protocol protocol
    )
    Collection team_collection of team
    Structure player (
        leafref ^name,
        season season,
        uint16 number,
        scores scores,
        uint16_collection score_list
    )
    Collection player_collection of player
    Type leafref
    Type season extends string
    Type uint16
    Type scores extends uint16
    Collection uint16_collection of uint16
    Type protocol extends enumeration
    Type enumeration
    Structure protocols (
        string associated_layer_protocol
    )
    Collection protocols_collection of protocols
    Package generated_from_g1 {
        Type protocoly extends enumeration
        Type enumeration
    } }
 No newline at end of file