Skip to content

Commit

Permalink
Provide default config to lighty-gnmi-device-simulator
Browse files Browse the repository at this point in the history
Gnmi-device-simulator default config was missing.

JIRA:LIGHTY-257
Signed-off-by: tobias.pobocik <[email protected]>
  • Loading branch information
Tobianas authored and ihrasko committed Dec 6, 2023
1 parent 81fde25 commit c50a2a2
Show file tree
Hide file tree
Showing 7 changed files with 2,436 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
module openconfig-alarm-types {

yang-version "1";

// namespace
namespace "http://openconfig.net/yang/alarms/types";

prefix "oc-alarm-types";

// import some basic types
import openconfig-extensions { prefix oc-ext; }

// meta
organization "OpenConfig working group";

contact
"OpenConfig working group
www.openconfig.net";

description
"This module defines operational state data related to alarms
that the device is reporting.
This model reuses some data items defined in the draft IETF
YANG Alarm Module:
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02
Portions of this code were derived from the draft IETF YANG Alarm
Module. Please reproduce this note if possible.
IETF code is subject to the following copyright and license:
Copyright (c) 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 Simplified BSD License set forth in
Section 4.c of the IETF Trust's Legal Provisions Relating
to IETF Documents (http://trustee.ietf.org/license-info).";

oc-ext:openconfig-version "0.2.1";

revision "2018-11-21" {
description
"Add OpenConfig module metadata extensions.";
reference "0.2.1";
}

revision "2018-01-16" {
description
"Moved alarm identities into separate types module";
reference "0.2.0";
}

// OpenConfig specific extensions for module metadata.
oc-ext:regexp-posix;
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

// identity statements
identity OPENCONFIG_ALARM_TYPE_ID {
description
"Base identity for alarm type ID profiles";
}

identity AIS {
base OPENCONFIG_ALARM_TYPE_ID;
description
"Defines an alarm indication signal type of alarm";
}

identity EQPT {
base OPENCONFIG_ALARM_TYPE_ID;
description
"Defines an equipment related type of alarm that is specific
to the physical hardware";
}

identity LOS {
base OPENCONFIG_ALARM_TYPE_ID;
description
"Defines a loss of signal type of alarm";
}

identity OTS {
base OPENCONFIG_ALARM_TYPE_ID;
description
"Defines a optical transport signal type of alarm";
}

identity OPENCONFIG_ALARM_SEVERITY {
description
"Base identity for alarm severity profiles. Derived
identities are based on contents of the draft
IETF YANG Alarm Module";
reference
"IETF YANG Alarm Module: Draft - typedef severity
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";

}

identity UNKNOWN {
base OPENCONFIG_ALARM_SEVERITY;
description
"Indicates that the severity level could not be determined.
This level SHOULD be avoided.";
}

identity MINOR {
base OPENCONFIG_ALARM_SEVERITY;
description
"Indicates the existence of a non-service affecting fault
condition and that corrective action should be taken in
order to prevent a more serious (for example, service
affecting) fault. Such a severity can be reported, for
example, when the detected alarm condition is not currently
degrading the capacity of the resource";
}

identity WARNING {
base OPENCONFIG_ALARM_SEVERITY;
description
"Indicates the detection of a potential or impending service
affecting fault, before any significant effects have been felt.
Action should be taken to further diagnose (if necessary) and
correct the problem in order to prevent it from becoming a more
serious service affecting fault.";
}

identity MAJOR {
base OPENCONFIG_ALARM_SEVERITY;
description
"Indicates that a service affecting condition has developed
and an urgent corrective action is required. Such a severity
can be reported, for example, when there is a severe
degradation in the capability of the resource and its full
capability must be restored.";
}

identity CRITICAL {
base OPENCONFIG_ALARM_SEVERITY;
description
"Indicates that a service affecting condition has occurred
and an immediate corrective action is required. Such a
severity can be reported, for example, when a resource becomes
totally out of service and its capability must be restored.";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
module openconfig-alarms {

yang-version "1";

// namespace
namespace "http://openconfig.net/yang/alarms";

prefix "oc-alarms";

// import some basic types
import openconfig-alarm-types { prefix oc-alarm-types; }
import openconfig-extensions { prefix oc-ext; }
import openconfig-types { prefix oc-types; }
import openconfig-platform { prefix oc-platform; }

// meta
organization "OpenConfig working group";

contact
"OpenConfig working group
www.openconfig.net";

description
"This module defines operational state data related to alarms
that the device is reporting.
This model reuses some data items defined in the draft IETF
YANG Alarm Module:
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02
Portions of this code were derived from the draft IETF YANG Alarm
Module. Please reproduce this note if possible.
IETF code is subject to the following copyright and license:
Copyright (c) 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 Simplified BSD License set forth in
Section 4.c of the IETF Trust's Legal Provisions Relating
to IETF Documents (http://trustee.ietf.org/license-info).";

oc-ext:openconfig-version "0.3.2";

revision "2019-07-09" {
description
"Clarify relative base for leaves using timeticks64.";
reference "0.3.2";
}

revision "2018-11-21" {
description
"Add OpenConfig module metadata extensions.";
reference "0.3.1";
}

revision "2018-01-16" {
description
"Moved alarm identities into separate types module";
reference "0.3.0";
}

revision "2018-01-10" {
description
"Make alarms list read only";
reference "0.2.0";
}

revision "2017-08-24" {
description
"Initial public release";
reference "0.1.0";
}

// OpenConfig specific extensions for module metadata.
oc-ext:regexp-posix;
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

// grouping statements

grouping alarm-state {
description
"Operational state data for device alarms";

leaf id {
type string;
description
"Unique ID for the alarm -- this will not be a
configurable parameter on many implementations";
}

leaf resource {
type string;
description
"The item that is under alarm within the device. The
resource may be a reference to an item which is
defined elsewhere in the model. For example, it
may be a platform/component, interfaces/interface,
terminal-device/logical-channels/channel, etc. In this
case the system should match the name of the referenced
item exactly. The referenced item could alternatively be
the path of the item within the model.";
reference
"IETF YANG Alarm Module: Draft - typedef resource
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
}

leaf text {
type string;
description
"The string used to inform operators about the alarm. This
MUST contain enough information for an operator to be able
to understand the problem. If this string contains structure,
this format should be clearly documented for programs to be
able to parse that information";
reference
"IETF YANG Alarm Module: Draft - typedef alarm-text
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
}

leaf time-created {
type oc-types:timeticks64;
description
"The time at which the alarm was raised by the system.
This value is expressed relative to the Unix Epoch.";
}

leaf severity {
type identityref {
base oc-alarm-types:OPENCONFIG_ALARM_SEVERITY;
}
description
"The severity level indicating the criticality and impact
of the alarm";
reference
"IETF YANG Alarm Module: Draft - typedef severity
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
}

leaf type-id {
type union {
type string;
type identityref {
base oc-alarm-types:OPENCONFIG_ALARM_TYPE_ID;
}
}
description
"The abbreviated name of the alarm, for example LOS,
EQPT, or OTS. Also referred to in different systems as
condition type, alarm identifier, or alarm mnemonic. It
is recommended to use the OPENCONFIG_ALARM_TYPE_ID
identities where possible and only use the string type
when the desired identityref is not yet defined";
reference
"IETF YANG Alarm Module: Draft - typedef alarm-type-id
https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
}
}

grouping alarm-config {
description
"Configuration data for device alarms";
}

grouping alarms-top {
description
"Top-level grouping for device alarms";

container alarms {
description
"Top-level container for device alarms";

config false;

list alarm {
key "id";
description
"List of alarms, keyed by a unique id";

leaf id {
type leafref {
path "../state/id";
}

description
"References the unique alarm id";
}

container config {
description
"Configuration data for each alarm";

uses alarm-config;
}

container state {
config false;

description
"Operational state data for a device alarm";

uses alarm-config;
uses alarm-state;
}
}
}
}

// augments

augment "/oc-platform:components/oc-platform:component/oc-platform:state" {
description
"Adds specific alarms related to a component.";

leaf equipment-failure {
type boolean;
default "false";
description
"If true, the hardware indicates that the component's physical equipment
has failed";
}

leaf equipment-mismatch {
type boolean;
default "false";
description
"If true, the hardware indicates that the component inserted into the
affected component's physical location is of a different type than what
is configured";
}
}

}
Loading

0 comments on commit c50a2a2

Please sign in to comment.