module ietf-netconf-resolve-system {
  yang-version 1.1;
  namespace
    "urn:ietf:params:xml:ns:yang:ietf-netconf-resolve-system";
  prefix ncrs;

  import ietf-netconf {
    prefix nc;
    reference
      "RFC 6241: Network Configuration Protocol (NETCONF)";
  }
  import ietf-netconf-nmda {
    prefix ncds;
    reference
      "RFC 8526: NETCONF Extensions to Support the Network
       Management Datastore Architecture";
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     Author: Qiufang Ma
             <mailto:maqiufang1@huawei.com>
     Author: Qin Wu
             <mailto:bill.wu@huawei.com>
     Author: Chong Feng
             <mailto:fengchongllly@gmail.com>";
  description
    "This module defines an extension to the NETCONF protocol
     that allows the NETCONF client to control whether the server
     is allowed to copy referenced system configuration
     automatically without the client doing so explicitly.

      Copyright (c) 2024 IETF Trust and the persons identified
      as authors of the code. 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 Revised
      BSD License set forth in Section 4.c of the IETF Trust's
      Legal Provisions Relating to IETF Documents
      (https://trustee.ietf.org/license-info).

      This version of this YANG module is part of RFC XXXX
      (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
      itself for full legal notices.

      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
      'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
      'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
      are to be interpreted as described in BCP 14 (RFC 2119)
      (RFC 8174) when, and only when, they appear in all
      capitals, as shown here.";

  revision 2024-06-18 {
    description
      "Initial version.";
    reference
      "RFC XXXX: System-defined Configuration";
  }

  grouping resolve-system-grouping {
    description
      "Define the resolve-system parameter grouping.";
    leaf resolve-system {
      type empty;
      description
        "When present, and the server supports this capability,
         the server MUST copy the entire referenced system
         configuration, including all descendants into the target
         datastore (e.g., <candidate> and <running>) without the
         client doing the copy/paste explicitly, to resolve any
         references not resolved by the client. The copy operation
         MUST NOT override any explicit configuration in the target
         datastore.";
    }
  }

  augment "/nc:edit-config/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <edit-config> operation.";
    uses resolve-system-grouping;
  }

  augment "/nc:copy-config/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <copy-config> operation.";
    uses resolve-system-grouping;
  }
  augment "/nc:validate/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <validate> operation.";
    uses resolve-system-grouping;
  }
  augment "/nc:commit/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <commit> operation.";
    uses resolve-system-grouping;
  }
  augment "/ncds:edit-data/ncds:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <edit-data> operation.";
    uses resolve-system-grouping;
  }
}
