Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Structured events yang models #21

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e4ee4a2
Add YANG models for structured events
zbud-msft Jul 9, 2022
a8183da
[Arista] Update platform submodule (#11853)
Staphylo Aug 26, 2022
9b7bcf2
Advance submodule sonic-sairedis (#11704)
jimmyzhai Aug 28, 2022
f453cf6
Update swss common submodule for events api (#11858)
zbud-msft Aug 28, 2022
506ad66
[Arista] Fix content of platform.json for DCS-720DT-48S (#11855)
Staphylo Aug 29, 2022
eb08462
[actions] Update github actions label and automerge. (#11736)
liushilongbuaa Aug 29, 2022
bd31be2
[ci] Update reproducible build related pipeline. (#11810)
liushilongbuaa Aug 29, 2022
1d0d61c
Address Review Comment to define SONIC_GLOBAL_DB_CLI in gbsyncd.sh (#…
abdosi Aug 29, 2022
45c8d02
[Build] Increase the size of the installer image (#11869)
xumia Aug 29, 2022
5048f65
Update sensor names for msn4600c for the 5.10 kernel (#11491)
saiarcot895 Aug 29, 2022
6fa111c
Fix error handling when failing to install a deb package (#11846)
saiarcot895 Aug 29, 2022
55f1fb1
Fix vs check install login timeout issue (#11727)
xumia Aug 30, 2022
6839227
[ci] Fix bug involved by PR 11810 which affect official build pipelin…
liushilongbuaa Aug 30, 2022
677b19d
DellEMC: Z9332f - Graceful platform reboot (#10240)
ArunSaravananBalachandran Aug 30, 2022
12c8db0
[Nokia][Nokia-IXR7250E-36x100G & Nokia-IXR7250E-36x400G] Update BCM (…
saksarav-nokia Aug 31, 2022
d2a5dcf
Align API get_device_runtime_metadata() for python version < 3.9 (#11…
abdosi Aug 31, 2022
f92c338
[Arista7050cx3] TD3 SKU changes for pg headroom value after interop t…
developfast Aug 31, 2022
be9af74
Add peer review comments on bgp
zbud-msft Aug 31, 2022
3bf7b3d
Merge branch 'sonic-net:master' into structured_events_yang_models
zbud-msft Aug 31, 2022
e676a52
Add peer review changes + spacing
zbud-msft Aug 31, 2022
bd50c13
Merge branch 'structured_events_yang_models' of github.com:zbud-msft/…
zbud-msft Aug 31, 2022
ca41dde
Add changes to events-swss
zbud-msft Aug 31, 2022
e961ae0
Add peer review changes in pmon swss
zbud-msft Aug 31, 2022
b47e82a
Add review changes dhcp-relay
zbud-msft Aug 31, 2022
f7b8a11
Add peer review changes to host
zbud-msft Sep 1, 2022
247db78
Add changes to severity, leafref
zbud-msft Sep 1, 2022
a98044e
Remove unused grouping
zbud-msft Sep 1, 2022
f60c7d2
Remove redis generic
zbud-msft Sep 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions src/sonic-yang-models/yang-events/sonic-events-bgp.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
module sonic-events-bgp {
namespace "http://github.com/Azure/sonic-events-bgp";
prefix events-bgp;
yang-version 1.1;

import sonic-events-common {
prefix evtcmn;
revision-date 2022-12-01;
}
import openconfig-alarm-types {
prefix oc-alarm-types;
}
import sonic-types {
prefix stypes;
}

revision 2022-12-01 {
description "BGP alert events.";
}

organization
"SONiC";
contact
"SONiC";
description
"SONIC BGP events";

container sonic-events-bgp {
container bgp-state {
oc-alarm-types:MINOR

description "
Declares an event for BGP state for a neighbor IP going up/down.";

leaf ip {
type inet:ip-address;
description "IP of neighbor";
}

leaf status {
type stypes:admin_status;
description "Provides the status as up (true) or down (false)";
}

uses evtcmn:sonic-events-cmn;
}

container notification {
oc-alarm-types:MAJOR

description "
Reports an notification.
The error codes as per IANA.
The other params are as in the message";

leaf major-code {
type uint8;
description "Major IANA error code; [RFC4271][RFC7313]";
}

leaf minor-code {
type uint8;
description "Minor IANA error code; [RFC4271][RFC7313]";
}

leaf ip {
type inet:ip-address;
description "IP of neighbor associated with this notification";
}

leaf ASN {
type uint32;
description "ASN number from the notification";
}

leaf is-sent {
type boolean;
description "true - if this notification was for sent messages; false if it was for received.";
}

uses evtcmn:sonic-events-cmn;
}

container zebra-no-buff {
oc-alarm-types:MAJOR

description "
Declares an event for zebra running out of buffer.
This event does not have any other parameter.
Hence source + tag identifies an event";

uses evtcmn:sonic-events-cmn;
}
}
}
67 changes: 67 additions & 0 deletions src/sonic-yang-models/yang-events/sonic-events-common.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module sonic-events-common {
namespace "http://github.com/Azure/sonic-events-common";
prefix evtcmn;
yang-version 1.1;

organization
"SONiC";
contact
"SONiC";
description
"SONIC Events common definition";
revision 2022-12-01 {
description
"Common reusable definitions";
}

grouping sonic-events-cmn {
leaf timestamp {
type yang::date-and-time;
description "time of the event";
}
}

grouping sonic-events-usage {
leaf usage {
type uint8 {
range "0..100" {
error-message "Incorrect val for %";
}
}
description "Percentage in use";
}

leaf limit {
type uint8 {
range "0..100" {
error-message "Incorrect val for %";
}
}
description "Percentage limit set";
}
}

identity EVENT_SEVERITY {
description
"Base identity for event severities. Severities 2-4
are supported";
}

identity EVENT_SEVERITY_2 {
base EVENT_SEVERITY;
description
"Indicates that the severity level of this type of event is 2";
}

identity EVENT_SEVERITY_3 {
base EVENT_SEVERITY;
description
"Indicates that the severity level of this type of event is 3";
}

identity EVENT_SEVERITY_4 {
base EVENT_SEVERITY;
description
"Indicates that the severity level of this type of event is 4";
}
}
78 changes: 78 additions & 0 deletions src/sonic-yang-models/yang-events/sonic-events-dhcp_relay.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
module sonic-events-dhcp-relay {
namespace "http://github.com/sonic-net/sonic-events-dhcp-relay";
yang-version 1.1;
prefix events-dhcp-relay;

import openconfig-alarm-types {
prefix oc-alarm-types;
}
import sonic-events-common {
prefix evtcmn;
revision-date 2022-12-01;
}
revision 2022-12-01 {
description "dhcp-relay alert events.";
}

organization
"SONiC";
contact
"SONiC";
description
"SONIC dhcp-relay events";

container sonic-events-dhcp-relay {
container dhcp-relay-discard {
oc-alarm-types:MAJOR

description "
Declares an event for dhcp-relay discarding packet on an
interface due to missing IP address assigned.
Params:
name of the interface discarding.
class of the missing IP address as IPv4 or IPv6.";

leaf ip_class {
type enumeration {
enum "IPv4";
enum "IPv6";
}
description "Class of IP address missing";
}

leaf ifname {
type leafref {
path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name";
}
description "Name of the i/f discarding";
}

uses evtcmn:sonic-events-cmn;
}

container dhcp-relay-disparity {
oc-alarm-types:MAJOR

description "
Declares an event for disparity detected in
DHCP Relay behavior by dhcpmon.
parameters:
vlan that shows this disparity
The duration of disparity";

leaf vlan {
type leafref {
path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name";
}
description "Name of the vlan affected";
}

leaf duration {
type uint32;
description "Duration of disparity";
}

uses evtcmn:sonic-events-cmn;
}
}
}
Loading