<commit_before>module nipap {

  namespace "http://spritelink.net/nipap/settings";
  prefix nipap;

  import ietf-inet-types {
    prefix inet;
  }

  import tailf-common {
    prefix tailf;
  }

  import tailf-ncs {
    prefix ncs;
  }

  augment /ncs:services {
    description "NIPAP settings";

    container nipap {

      list backend {
        description "Connectivity setting for a NIPAP backend";

        key name;
        leaf name {
          tailf:info "Backend id";
          tailf:cli-allow-range;
          type string;
        }

        leaf hostname {
          description "Hostname of NIPAP backend";
          type inet:host;
          mandatory true;
        }
        leaf port {
          description "Port that NIPAP backend listens on";
          type inet:port-number;
          default 1337;
        }
        leaf username {
          description "Username to authenticate with NIPAP backend";
          type string;
          mandatory true;
        }
        leaf password {
          description "Password to authenticate with NIPAP backend";
          // should we use type passwdStr isntead?
          type string;
          mandatory true;
        }
        leaf default {
          type boolean;
          default true;
//          must "count(../backend/default) <= 1";
          // TODO: make sure only one backend is marked as default
        }
      }

      list pool {
        key name;
        leaf name {
          tailf:info "Name of pool to request prefix from";
          tailf:cli-allow-range;
          type string;
        }

        list request {
          key name;
          leaf name {
            tailf:info "Name of pool to request prefix from";
            tailf:cli-allow-range;
            type string;
          }

          leaf family {
            description "Address-family to request";
            default 4;
            type enumeration {
              enum 4 {
                value 4;
              }
              enum 6 {
                value 6;
              }
            }
          }
       
          leaf prefix_id {
            type uint64;
            config false;
            tailf:cdb-oper {
              tailf:persistent true;
            }
          }

          leaf prefix {
            type inet:ip-prefix;
            config false;
            tailf:cdb-oper {
              tailf:persistent true;
            }
          }
        }


      }

      list prefix {
        key name;
        leaf name {
          tailf:info "Name of request";
          tailf:cli-allow-range;
          type string;
        }

        leaf backend {
          type leafref {
            path "../../backend/name";
          }
        }

        leaf from-pool {
          type string;
        }

        leaf prefix {<commit_msg>nso-nipap: Add redeploy-service to YANG model<commit_after>module nipap {

  namespace "http://spritelink.net/nipap/settings";
  prefix nipap;

  import ietf-inet-types {
    prefix inet;
  }

  import tailf-common {
    prefix tailf;
  }

  import tailf-ncs {
    prefix ncs;
  }

  augment /ncs:services {
    description "NIPAP settings";

    container nipap {

      list backend {
        description "Connectivity setting for a NIPAP backend";

        key name;
        leaf name {
          tailf:info "Backend id";
          tailf:cli-allow-range;
          type string;
        }

        leaf hostname {
          description "Hostname of NIPAP backend";
          type inet:host;
          mandatory true;
        }
        leaf port {
          description "Port that NIPAP backend listens on";
          type inet:port-number;
          default 1337;
        }
        leaf username {
          description "Username to authenticate with NIPAP backend";
          type string;
          mandatory true;
        }
        leaf password {
          description "Password to authenticate with NIPAP backend";
          // should we use type passwdStr isntead?
          type string;
          mandatory true;
        }
        leaf default {
          type boolean;
          default true;
//          must "count(../backend/default) <= 1";
          // TODO: make sure only one backend is marked as default
        }
      }

      list pool {
        key name;
        leaf name {
          tailf:info "Name of pool to request prefix from";
          tailf:cli-allow-range;
          type string;
        }

        list request {
          key name;
          leaf name {
            tailf:info "Name of pool to request prefix from";
            tailf:cli-allow-range;
            type string;
          }

          leaf family {
            description "Address-family to request";
            default 4;
            type enumeration {
              enum 4 {
                value 4;
              }
              enum 6 {
                value 6;
              }
            }
          }
       
          leaf prefix_id {
            type uint64;
            config false;
            tailf:cdb-oper {
              tailf:persistent true;
            }
          }

          leaf prefix {
            type inet:ip-prefix;
            config false;
            tailf:cdb-oper {
              tailf:persistent true;
            }
          }

          leaf redeploy-service {
            description "Redeploy service after succesful allocation";
            type string;
          }

        }


      }

      list prefix {
        key name;
        leaf name {
          tailf:info "Name of request";
          tailf:cli-allow-range;
          type string;
        }

        leaf backend {
          type leafref {
            path "../../backend/name";
          }
        }

        leaf from-pool {
          type string;
        }

        leaf prefix {
{'fraction_non_alphanumeric': 0.07155202212236433, 'fraction_numerical': 0.00414794331144141, 'mean_word_length': 1.1489045673969551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5093929', 'n_tokens_mistral': 1550, 'n_tokens_neox': 1490, 'n_words': 443}