Re: [netmod] YANG action not allowed at root?

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Thu, 30 April 2020 15:51 UTC

Return-Path: <jason.sterne@nokia.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 537673A0C61 for <netmod@ietfa.amsl.com>; Thu, 30 Apr 2020 08:51:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.82, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.onmicrosoft.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Els9ngDBypW for <netmod@ietfa.amsl.com>; Thu, 30 Apr 2020 08:51:48 -0700 (PDT)
Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2091.outbound.protection.outlook.com [40.107.94.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D15AA3A0B1C for <netmod@ietf.org>; Thu, 30 Apr 2020 08:50:35 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XRwL8xULeY7ZE0ir285tav5Bd4t6FqIpSOCSzq/Ws6ozfyLi+5rcaoMFxyleWJnFX3UFhmAxRdb5bsJnxtB9t4s6OZDf9ERQuG5T9a6N4piJQ92kSVWbFfSqbKzf/HeT+MtaeAgtpCClWHU2YMS14UEs/pGdcCYpPrJv3BdXilvdYZA42B4oiy5RQAZTUS3p3Re3lVEeAdK/L3DHJbwe9K8fUxueQmJRwTkBTHK+o2i5moGdKOvXe3k4OnVCQvIx84+KQcdvWF4jUAR4JErQdPYF/eN9+zzYzwy1VuUoyB/I8XIYwjRVcVj5apmeBdxolbnljXotNkgT//STRb+/wA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z6OwIXazmaGtEFnT52qyBdh31zZ73iw7XqJaNHk/NQk=; b=HHoh6K1zLQuD7SsSE8QwVY3OZURvDni2rd3R8ajhlCC197PYPW4OnvX4/lnaV8ijdpfRV97ubwKXVkn7u6FoHNEvGF4QZOoULEy6+dWSFC8ZKAT43WxmjoJAubo4Aud8YJRZqaUomWXhP6J9SlKcf7YdstJqLzAix3L/6z8PX4KSf20KgmCNfuhOc4VGZNzt0nrpdrHozmSDcvja9Blzwmnhq8Nsbvs1RFhT+7zzJgKQbqdmMkE22axK2MwmwMPYnu2VL/Bgas7DBvEExUl94qMpPonuBDoABvHbGdmY7EgmYkNXhAV/xza8i5yC0RkvWfl+pNTh7zoaZwT8WWlGRA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z6OwIXazmaGtEFnT52qyBdh31zZ73iw7XqJaNHk/NQk=; b=g2CUBkn86lcP9tk5YfVsknaKtozG/PKKnw9ew0l+OUn3ePTSardX2Bqb7q6unf9O/f5Zn+F3GUdsi3XnfrJY6nWUp1rmMMyDZQGOBrse7HzJzoB8r5hcnsUbieGgCrAiEt8TWLcwmiZDdWBfmsbifl3aiEAn1f0u0W+2euxWGWE=
Received: from DM5PR08MB2633.namprd08.prod.outlook.com (2603:10b6:3:ca::21) by DM5PR08MB2521.namprd08.prod.outlook.com (2603:10b6:3:c6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 15:50:34 +0000
Received: from DM5PR08MB2633.namprd08.prod.outlook.com ([fe80::c00d:56c3:675e:ec63]) by DM5PR08MB2633.namprd08.prod.outlook.com ([fe80::c00d:56c3:675e:ec63%3]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 15:50:34 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: "Reshad Rahman (rrahman)" <rrahman@cisco.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] YANG action not allowed at root?
Thread-Index: AQHWHwRZTrnmeHaqAkuESYf3B2vfKqiRzWBg
Date: Thu, 30 Apr 2020 15:50:34 +0000
Message-ID: <DM5PR08MB263359FB2993EC569444A4539BAA0@DM5PR08MB2633.namprd08.prod.outlook.com>
References: <AE95765B-0561-45DC-A4A8-E8B3BCE4BB12@cisco.com>
In-Reply-To: <AE95765B-0561-45DC-A4A8-E8B3BCE4BB12@cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: cisco.com; dkim=none (message not signed) header.d=none;cisco.com; dmarc=none action=none header.from=nokia.com;
x-originating-ip: [2607:fea8:e31f:da06:99fd:f37e:6bdf:374e]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 7dbe6bfa-5c39-4b27-46a3-08d7ed1e3848
x-ms-traffictypediagnostic: DM5PR08MB2521:
x-microsoft-antispam-prvs: <DM5PR08MB2521937AEB4F375A8672A8439BAA0@DM5PR08MB2521.namprd08.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 0389EDA07F
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: DAe4f05aY0D2WfO8n2lNGZK2BynYJz7z5KiHUrCxwYkEfkCglhwtmCprkS20eDEEyztuTtwsYtajOzzN7Z34k99XDxbxOUk4dkMwXksvJO4/vrL608BBsa6Dp1fSGQk5P2mmXcjVdgIuMGbwDNtduMvhwc1gJ7sjGWxjIyuG0pwnAGGG9UggyFdkCe89jIIXLZAQzMaJh0cTg1bro8EJOl3YG8CRWGow0wfntuaX/oUp45afUPvFkLbyI5wGGiiw0ix6Y7et6zB1xrzWlss6abcvPR4VugotQaBN4Ke/vtxy+cotnMyN/vygaSX46amBSk6mmCPCGQtg0t+GKHqcUF2JDU17ppF+003EqUezqhT9DLegsxz/OTBiPgvzRywI6Rn+jQIz7Lm7qDVUVKBJxefczYcubT0DdbLiA1eYxdJbtY8qIH/zmudzuBH2aSR66nE2S3liaR+UA4/NHi4568q/Y1oBDb9YJYsdrc3S05kQKF55OtDzRkgwyNMOohDoDy220bOR+lTDkmaiS/Lm0HBWqVeN9b92tvM4uV/BJt6uXHEJVOamOM1SdS0vrDei
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR08MB2633.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(366004)(39860400002)(136003)(376002)(346002)(66946007)(55016002)(478600001)(7696005)(5660300002)(33656002)(316002)(110136005)(76116006)(186003)(966005)(66476007)(66556008)(64756008)(66446008)(9686003)(71200400001)(86362001)(2906002)(52536014)(8676002)(53546011)(8936002)(6506007)(21314003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: BbNdasFLnr8622KLDTZvzl9fsuMhPDzT5q+NyvpGckJAsaDiX/2iAXQZMuR2mJVBw51rU+syBQJ1gRAOIr1U2uZDoXHg1FP84Y8YNZcQybthyJdUGmKLfTORySoeAX0pAupYQ3RJHPb0eW+IHLB9nQBDveWtxAFYBbMSrfNbZe+xPaO/cf4WUujWo7rGhrl1Ol1flevDyROi2nxiNthdJ5HhPK+kFjU4L6w+zRCBedd1dOZeW4b3lKE8LaeQqaVcgRUdZ0DILKzoa/5zzSFYDkrkXN1DcJwe1bzQxedgnEMUBLyTNcnChN1awOzDft4inNKdosVTtlWR39m2Rs9oaoaGipEVZbvNuRz2GyZO7GE16Ov9JmYTFtLZSZfbGtSoCpubgmA3dMVxWPEHzb5o/k7sNtMEwieG8G8ypT0JEknX8vQ3xL2bGCaTLXcGZwNwWdWzNJ1M6K8SiYyFcL52OGm+JWw9dLIH1MqeEjSi9Q2Jr3wUssxqa4olwcTCcdceL2+Bdk1omCCvoX9r7wJ/5FG/9lJsyJGXGJQyMvC25RMsxCezw5V81Z/Epsm6gCDAgGquCweMpnq0ENncpXeEsJ4volNkw52yza/DcbTQUCYO7vaCsl3A5kNqHtFog+MWv5omkJO1Irtk/Nq93ExqeNL35y/R3AuonBHV0Fzl6oKDt9XGaN5L6ctCu2vys9TPAPFmsYVGprePYfU3FOkCL6X/R+vkO2vwgL1XCRR7YHM78DABfQ4+CRs6iYm0tJVy6xWk/TEg95IfvKoCTA7HKhmRF47gpKHVwZZbwy/fQVeqXbla54pLBIWIZPvPfwb6mrV7x3DTLftggurSWiSFFyKManUOhcwwmX4oezF77zQVIbQi2Pat1YKVaI/NSF4m
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_DM5PR08MB263359FB2993EC569444A4539BAA0DM5PR08MB2633namp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7dbe6bfa-5c39-4b27-46a3-08d7ed1e3848
X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2020 15:50:34.3947 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: RQYqdk5T1Xallq/cBribQ4ElpYsNUi5gccyvvdoBkBr/quWMouIJPIboS8aiEY9riTGodKANRTk0jOBkSRdO6w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR08MB2521
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Pr8mpeDWNtOedB7_0eYhErQCEJ4>
Subject: Re: [netmod] YANG action not allowed at root?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Apr 2020 15:52:02 -0000

Yes - the intent was to address the limitation that an RPC can only be at root. Actions can be out in a tree & nicely associated with something (e.g. instead of having a pile of flat RPCs with long names that encode containers like reset-www-xxx-yyy-zzz-entity).

But I don't really understand why we limited actions from being at the root. It prevents a strategy of implementing all operations in a server (some of which may be desirable at root for various reasons, some of which may be desirable in the tree) as actions.

Why not allow this?

   module bar {
         action do-stuff {
           input {
             leaf iterations {
               type uint8;
              }
            }
         }
       }
   }

Which could be called from NETCONF like this:

     <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
       <action xmlns="urn:ietf:params:xml:ns:yang:1">
         <do-stuff xmlns="urn:example:bar">
           <iterations>5</iterations>
         </do-stuff>
       </action>
     </rpc>


Jason

From: Reshad Rahman (rrahman) <rrahman@cisco.com>
Sent: Thursday, April 30, 2020 11:31 AM
To: Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>; netmod@ietf.org
Subject: Re: [netmod] YANG action not allowed at root?

I don’t know the history on this but the intent is to have action tied to a data node.

https://tools.ietf.org/html/rfc7950#section-7.15
   The difference between an action and an rpc is that an action is tied
   to a node in the datastore, whereas an rpc is not.  When an action is
   invoked, the node in the datastore is specified along with the name
   of the action and the input parameters.

Regards,
Reshad.

From: netmod <netmod-bounces@ietf.org<mailto:netmod-bounces@ietf.org>> on behalf of "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com<mailto:jason.sterne@nokia.com>>
Date: Thursday, April 30, 2020 at 11:08 AM
To: "netmod@ietf.org<mailto:netmod@ietf.org>" <netmod@ietf.org<mailto:netmod@ietf.org>>
Subject: [netmod] YANG action not allowed at root?

Hi all,

I was a bit surprised to find this in section 7.15 of 7950 recently:

   Since an action cannot be defined at the top level of a module or in
   a "case" statement, it is an error if a grouping that contains an
   action at the top of its node hierarchy is used at the top level of a
   module or in a case definition.

I realize that actions can be placed down in a schema tree (i.e. sit in the context of a container or list), but why is it phrased that they *must* be in a container?

RPCs are limited to being at the root. I would have thought actions could be anywhere (root or down in the tree).

Jason