[CCAMP] YANG issue in draft-ietf-ccamp-alarm-module

Martin Bjorklund <mbj@tail-f.com> Fri, 22 March 2019 12:43 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: ccamp@ietfa.amsl.com
Delivered-To: ccamp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9DE6D130EE4 for <ccamp@ietfa.amsl.com>; Fri, 22 Mar 2019 05:43:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 2DX2fqDyiOMm for <ccamp@ietfa.amsl.com>; Fri, 22 Mar 2019 05:42:59 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id D2D3F130E78 for <ccamp@ietf.org>; Fri, 22 Mar 2019 05:42:58 -0700 (PDT)
Received: from localhost (h-4-215.A165.priv.bahnhof.se [158.174.4.215]) by mail.tail-f.com (Postfix) with ESMTPSA id 3481D1AE00A0 for <ccamp@ietf.org>; Fri, 22 Mar 2019 13:42:57 +0100 (CET)
Date: Fri, 22 Mar 2019 13:42:49 +0100
Message-Id: <20190322.134249.387057810261874257.mbj@tail-f.com>
To: ccamp@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ccamp/ka1OpyuOO3DexxD--NBrooVBdtE>
Subject: [CCAMP] YANG issue in draft-ietf-ccamp-alarm-module
X-BeenThere: ccamp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Discussion list for the CCAMP working group <ccamp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ccamp>, <mailto:ccamp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ccamp/>
List-Post: <mailto:ccamp@ietf.org>
List-Help: <mailto:ccamp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ccamp>, <mailto:ccamp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Mar 2019 12:43:06 -0000

Hi,

When we fixed the review comments for this draft, I found an issue
with the current YANG model.  Currently we have:


         choice notify-status-changes {
           description
             "This leaf controls the notifications sent for alarm status
              updates.  There are three options:

              [...]";

           leaf notify-all-state-changes {
             type empty;
             description
               "Send notifications for all status changes.";
           }
           leaf notify-raise-and-clear {
             type empty;
             description
               "Send notifications only for raise, clear, and re-raise.
                Notifications for severity level changes or alarm text
                changes are not sent.";
           }
           leaf notify-severity-level {
             type severity;
             description
               "Only send notifications for alarm state changes crossing
                the specified level.  Always send clear notifications.";
           }
         }


First of all, the description refers to the choice as a leaf; the main
text has the same issue.

But worse is that it isn't described what happens if no leafs in this
choice are configured.  What is the default?

Since the leafs are of type empty we can't just add a default
statement to the choice.

So we suggest the following updated model to fix this issue:

      leaf notify-status-changes {
        type enumeration {
          enum all-state-changes {
            description
              "Send notifications for all status changes.";
          }
          enum raise-and-clear {
            description
              "Send notifications only for raise, clear, and
               re-raise.  Notifications for severity level changes or
               alarm text changes are not sent.";
          }
          enum severity-level {
            description
              "Only send notifications for alarm state changes
               crossing the level specified in
               'notify-severity-level'.  Always send clear
               notifications.";
          }
        }
        must '. != "severity-level" or ../notify-severity-level' {
          description
            "When notify-status-changes is 'severity-level', a value
             must be given for notify-severity-level.";
        }
        default "all-state-changes";
        description
          "This leaf controls the notifications sent for alarm status
           updates.  There are three options:

           [...]";
      }
      leaf notify-severity-level {
        when '../notify-status-changes = "severity-level"';
        type severity;
        description
          "Only send notifications for alarm state changes crossing
           the specified level.  Always send clear notifications.";
      }


I.e., change it to an enumeration leaf with a default value, and add
an additional leaf to set the severity level when the enum
"severity-level" is set.

Note that it doesn't change any major concepts; it is a model change
to better describe the semantics.

Unless we hear any objections, we'll make this change in the updated
draft that will be sent to the IESG.



/martin