Appendix A. Vendor-Specific Subservice Augmentation: "example-service-assurance-device-acme" YANG Module
Appendix A. Vendor-Specific Subservice Augmentation: "example-service-assurance-device-acme" YANG Module
A.1. Tree View
The following tree diagram [RFC8340] provides an overview of the "example-service-assurance-device-acme" module.
module: example-service-assurance-device-acme
augment /sain:subservices/sain:subservice/sain:parameter:
+--rw parameters
+--rw device string
+--rw acme-specific-parameter string
A complete tree view of the base module with all augmenting modules presented in this document is available in Appendix B.3.
A.2. Concepts
Under some circumstances, vendor-specific subservice types might be required. As an example of this vendor-specific implementation, this section shows how to augment the "ietf-service-assurance-device" module to add custom support for the device subservice specific to the Acme Corporation. The specific version adds a new parameter named "acme-specific-parameter". It's an implementation choice to either derive a new specific identity from the "subservice-base" identity defined in the "ietf-service-assurance" module or to augment the parameters from the "ietf-service-assurance-device" module; here, we choose to create a new identity.
A.3. YANG Module
module example-service-assurance-device-acme {
yang-version 1.1;
namespace "urn:example:example-service-assurance-device-acme";
prefix example-device-acme;
import ietf-service-assurance {
prefix sain;
reference
"RFC 9418: YANG Modules for Service Assurance";
}
import ietf-service-assurance-device {
prefix sain-device;
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 example module extends the ietf-service-assurance-device
module to add specific support for devices of the Acme
Corporation. ";
revision 2023-07-11 {
description
"Initial revision.";
reference
"RFC 9418: YANG Modules for Service Assurance";
}
identity device-acme-type {
base sain-device:device-type;
description
"Network device is healthy.";
}
augment "/sain:subservices/sain:subservice/sain:parameter" {
when "derived-from-or-self(sain:type, 'device-acme-type')";
description
"Augments the parameter choice from the ietf-service-assurance
module with a case specific to the device-acme subservice.";
container parameters {
description
"Parameters for the device-acme subservice type.";
leaf device {
type string;
mandatory true;
description
"The device to monitor.";
}
leaf acme-specific-parameter {
type string;
mandatory true;
description
"The Acme-Corporation-specific parameter.";
}
}
}
}