module keatest-module {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:keatest-module";
  prefix tm;

  organization "Sysrepo and ISC";
  description
    "ISC imported a test module from Sysrepo tests and adapted it
     to kea testing regime.";
  contact
    "kea-dev@lists.isc.org";

  revision 2018-11-20 {
    description "Initial revision";
    reference "";
  }

  container container {
      config true;
      list list {
         leaf leaf {
            type string;
         }
         leaf key1 {
            type string;
         }
         leaf key2 {
            type string;
         }
         key "key1 key2";
      }
  }

  container main {
    leaf enum {
      type enumeration {
        enum "yes" {
          value 1;
        }
        enum "no" {
          value 2;
        }
        enum "maybe" {
          value 3;
        }
      }
    }
    leaf options {
      type bits {
        bit strict;
        bit recursive;
        bit logging;
      }
    }
    leaf raw {
      type binary;
    }
    leaf dec64 {
      type decimal64{
         fraction-digits 2;
      }
    }
    leaf i8 {
      type int8;
    }
    leaf i16 {
      type int16;
    }
    leaf i32 {
      type int32;
    }
    leaf i64 {
      type int64;
    }
    leaf ui8 {
      type uint8;
    }
    leaf ui16 {
      type uint16;
    }
    leaf ui32 {
      type uint32;
    }
    leaf ui64 {
      type uint64;
    }
    leaf empty {
      type empty;
    }
    leaf boolean {
      type boolean;
    }
    leaf string {
      type string;
    }
    leaf id_ref {
      type identityref{
        base base_id;
      }
    }
    leaf-list numbers {
      type uint8;
    }
    leaf instance_id {
      type instance-identifier;
    }
    anyxml xml-data;
    anydata any-data;
  }

  identity base_id;

  identity id_1 {
    base base_id;
  }

  identity id_2 {
    base base_id;
  }

  list list {
    key "key";
    leaf key {
      type string;
    }
    leaf id_ref {
      type identityref{
        base base_id;
      }
    }
    leaf instance_id {
       type instance-identifier;
    }
    leaf union {
      type union{
          type uint8;
          type enumeration {
              enum "infinity";
          }
      }
    }
  }

  container kernel-modules {
    list kernel-module {
      key "name";

      leaf name {
        type string;
      }

      leaf location {
        type string;
        default "/lib/modules";
      }

      leaf loaded {
        type boolean;
      }

      action load {
        input {
          leaf params {
            mandatory "true";
            type string;
          }
          leaf force {
            type boolean;
            default "false";
            when "../../loaded = 'false'";
          }
          leaf dry-run {
            type boolean;
            default false;
          }
        }
        output {
          leaf return-code {
            type uint8;
          }
        }
      }
    }
  }

 container presence-container {
   presence "presence-container";

    leaf topleaf1 {
      type int8;
    }

    leaf topleaf2 {
      type int8;
    }

    container child1 {
      leaf child1-leaf {
        type int8;
      }

      container grandchild1 {
        leaf grandchild1-leaf {
          type int8;
          default 10;
        }
      }
    }

    container child2 {
      leaf child2-leaf {
        type int8;
       }

      container grandchild2 {
        leaf grandchild2-leaf1 {
          type int8;
        }
        leaf grandchild2-leaf2 {
          type int8;
        }
        leaf grandchild2-leaf3 {
          type int8;
        }
      }
    }
  }
}
