cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1020
Views
0
Helpful
1
Replies

create XML from YANG model

Skebard
Level 1
Level 1

Hello,

Currently I'm doing a project with the library netopeer2 and I have written the YANG model for my switch but I can't find the right XML to change the value of the device. The main problem is that I don't know how to represent more than one container of YANG in XML. If someone could write the XML fro this model I really would appreciate this, thanks in advance.Below there is the model;

 

 

module NewSwitch {
    yang-version 1;
    namespace "urn:NewSwitch:test";

    prefix bld;

 

    container ietf-interfaces-interfaces {
        list interface {
        key name;
        leaf type{
            type uint32;
        }
        leaf enabled{
            type boolean;
        }
        leaf name{
            type uint32;
        }

        container ieee802-dot1q-bridge-bridge-port{
            container ieee802-dot1q-sched-gate-parameters{
                container admin-cycle-time{
                    leaf denominator{
                        type uint32;
                    }
                    leaf numerator{
                        type uint32;

                    }
                }
                leaf config-change{
                    type boolean;
                }
                list admin-control-list{
                    key index;
                    container sgs-params{
                        leaf time-interval-value{
                            type uint32;
                        }
                        leaf gate-states-value{
                            type uint32;
                        }

                    }
                    leaf index{
                        type uint16;
                    }

                }
                leaf admin-control-list-length{
                    type uint32;
                }
                container admin-base-time{
                    leaf seconds{
                        type uint32;
                    }
                    leaf fractional-seconds{
                        type uint32;
                    }

                }

            }

        }

    }
    }
}

1 Reply 1

abhirame
Cisco Employee
Cisco Employee
Please check the libyang documentation https://netopeer.liberouter.org/doc/libyang/master/. It might help you as you are using netopeer2