6. Subservice Augmentation: "ietf-service-assurance-interface" YANG Module
6. Subservice Augmentation: "ietf-service-assurance-interface" YANG Module
6.1. 树视图
以下树图 [RFC8340] 概述了 "ietf-service-assurance-interface" 数据模型.
module: ietf-service-assurance-interface
augment /sain:subservices/sain:subservice/sain:parameter:
+--rw parameters
+--rw device string
+--rw interface string
包含本文档所给全部 augmenting module 的基础 module 完整树视图见附录 B.3.
6.2. 概念
对于 interface subservice 定义, 新的 interface-type 被规定为继承自 subservice 的基础 identity. 这向保障 agent 表明, 当前正在保障某个接口的健康状态.
配置 interface subservice 的参数是设备名称, 以及该特定设备上的某个特定接口. 这些参数与 [RFC8343] 中描述的 "ietf-interfaces" 模型保持一致, 在该模型中, 接口名称是在给定设备上标识接口所需的唯一键. 通过针对 interface-type subservice 类型扩展 "ietf-service-assurance" YANG module 中的 parameter choice, 即可规定这两个新参数.
6.3. YANG Module
<CODE BEGINS> file "[email protected]"
module ietf-service-assurance-interface {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-service-assurance-interface";
prefix sain-interface;
import ietf-service-assurance {
prefix sain;
reference
"RFC 9418: YANG Modules for Service Assurance";
}
organization
"IETF OPSAWG Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/opsawg/>
WG List: <mailto:[email protected]>
Author: Benoit Claise <mailto:[email protected]>
Author: Jean Quilbeuf <mailto:[email protected]>";
description
"This module extends the ietf-service-assurance module to add
support for the interface subservice.
It checks whether an interface is healthy.
Copyright (c) 2023 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 9418; see the
RFC itself for full legal notices. ";
revision 2023-07-11 {
description
"Initial revision.";
reference
"RFC 9418: YANG Modules for Service Assurance";
}
identity interface-type {
base sain:subservice-base;
description
"Checks whether an interface is healthy.";
}
augment "/sain:subservices/sain:subservice/sain:parameter" {
when "derived-from-or-self(sain:type, 'interface-type')";
description
"Augments the parameter choice from ietf-service-assurance
module with a case specific to the interface subservice.";
container parameters {
description
"Parameters for the interface subservice type.";
leaf device {
type string;
mandatory true;
description
"Device supporting the interface.";
}
leaf interface {
type string;
mandatory true;
description
"Name of the interface.";
}
}
}
}
<CODE ENDS>