module yumaworks-schema-mount {
  yang-version 1.1;
  namespace "urn:yumaworks:params:xml:ns:yang:yumaworks-schema-mount";
  prefix "ysm";

  import ietf-yang-types { prefix yang; }
  import ietf-yang-structure-ext { prefix sx; }

  import yuma-app-common { prefix ncxapp; }
  import yumaworks-app-common { prefix ywapp; }
  import netconfd-pro { prefix ndpro; }

  organization "YumaWorks, Inc.";
  contact "Support <support@yumaworks.com>";
  description
    "This module contains configuration parameters
     for the YANG Schema Mount data model defined in RFC 8528.

     Copyright (c) 2022, YumaWorks, Inc. All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the BSD 3-Clause License
     http://opensource.org/licenses/BSD-3-Clause.
   ";

  revision 2022-01-19 {
    description
       "Initial version";
  }


  grouping sm-config-keys {
    description
      "Parameters for configuring a Schema Mount
       configuration.";

    leaf mp-module {
      type yang:yang-identifier;
      description
        "The module name that defines the mount-label";
    }

    leaf mp-label {
      type yang:yang-identifier;
      description
        "The label that matches the `mount-point` extension
         argument value";
    }
  }

  grouping sm-config-parms {
    description
      "Parameters for configuring a Schema Mount
       configuration.";

    uses sm-config-keys;

    leaf mp-config {
      type boolean;
      default "true";
      description
        "Set to false to force the mount-point to be read-only.";
    }

    container mp-cli {
      description
        "Contains the CLI configuration parameters for
         the Mount Point.

         The following parameters must be set:

         - module or bundle or loadpath

         TBD: complete list of supported VS parameters.";

      uses ywapp:AnnotationParm;
      uses ndpro:BundleParm;
      uses ncxapp:DeviationParm;
      uses ncxapp:CommonFeatureParms;
      uses ywapp:LoadPathParm;
      uses ncxapp:ModuleParm;
    }
  }

  grouping sm-config-contents {
    description
      "Contains configuration parameters expected to
       be in this format within the XML or JSON file
       identified by the --sm-config CLI parameter.";

    list sm-config {
      description
        "Configuration for one mount point";
      key "mp-module mp-label";
      uses sm-config-parms;
    }
  }

  sx:structure schema-mount {
    uses sm-config-contents;
  }
}