跳到主要内容

5. Subservice Augmentation: "ietf-service-assurance-device" YANG Module

5. Subservice Augmentation: "ietf-service-assurance-device" YANG Module

5.1. 树视图

以下树图 [RFC8340] 概述了 "ietf-service-assurance-device" module.

module: ietf-service-assurance-device

augment /sain:subservices/sain:subservice/sain:parameter:
+--rw parameters
+--rw device string

包含本文档所给全部 augmenting module 的基础 module 完整树视图见附录 B.3.

5.2. 概念

随着 subservice 数量随时间增长, YANG module 被设计为可扩展. 新的 subservice 类型需要精确定义其类型和预期参数. 下面以新的 device subservice 类型为例说明. 顾名思义, 它监控并报告设备健康状态, 并在发生降级时报告一些症状.

对于 device subservice 定义, 新 identity "device-type" 被规定为继承自 subservice 的基础 identity. 这向保障 agent 表明, 当前正在保障某个设备的健康状态.

配置 device subservice 的典型参数是需要保障的设备名称. 通过针对 "device-type" subservice 类型扩展 "ietf-service-assurance" YANG module 中的 parameter choice, 即可规定这个新参数.

5.3. YANG Module

<CODE BEGINS> file "[email protected]"
module ietf-service-assurance-device {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-service-assurance-device";
prefix sain-device;

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 augments the ietf-service-assurance module with
support of the device subservice.

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 device-type {
base sain:subservice-base;
description
"Identity of device subservice.";
}

augment "/sain:subservices/sain:subservice/sain:parameter" {
when "derived-from-or-self(sain:type, 'device-type')";
description
"Augments the parameter choice from the ietf-service-assurance
module with a case specific to the device subservice.";
container parameters {
description
"Parameters for the device subservice type.";
leaf device {
type string;
mandatory true;
description
"Identifier of the device to monitor. The
identifier (e.g., device id, hostname, or management IP)
depends on the context.";
}
}
}
}
<CODE ENDS>