-
Notifications
You must be signed in to change notification settings - Fork 88
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
Event mgmt #48
Open
spenugondaa
wants to merge
2
commits into
sonic-net:master
Choose a base branch
from
spenugondaa:event-mgmt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Event mgmt #48
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module sonic-alarm-annot { | ||
|
||
yang-version "1"; | ||
|
||
namespace "http://openconfig.net/yang/annotation/sonic-alarm-annot"; | ||
prefix "salarm-annot"; | ||
|
||
import sonic-alarm { prefix salarm; } | ||
import sonic-extensions { prefix sonic-ext; } | ||
|
||
deviation /salarm:show-alarms { | ||
deviate add { | ||
sonic-ext:rpc-callback "rpc_get_alarms"; | ||
} | ||
} | ||
deviation /salarm:acknowledge-alarms { | ||
deviate add { | ||
sonic-ext:rpc-callback "rpc_acknowledge_alarms"; | ||
} | ||
} | ||
|
||
deviation /salarm:unacknowledge-alarms { | ||
deviate add { | ||
sonic-ext:rpc-callback "rpc_unacknowledge_alarms"; | ||
} | ||
} | ||
|
||
deviation /salarm:sonic-alarm/salarm:ALARM/salarm:ALARM_LIST { | ||
deviate add { | ||
sonic-ext:db-name "EVENT_DB"; | ||
} | ||
} | ||
|
||
deviation /salarm:sonic-alarm/salarm:ALARM_STATS/salarm:ALARM_STATS_LIST { | ||
deviate add { | ||
sonic-ext:db-name "EVENT_DB"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module sonic-event-annot { | ||
|
||
yang-version "1"; | ||
|
||
namespace "http://openconfig.net/yang/annotation/sonic-event-annot"; | ||
prefix "sevent-annot"; | ||
|
||
import sonic-event { prefix sevent; } | ||
import sonic-extensions { prefix sonic-ext; } | ||
|
||
deviation /sevent:show-events { | ||
deviate add { | ||
sonic-ext:rpc-callback "rpc_get_events"; | ||
} | ||
} | ||
|
||
deviation /sevent:sonic-event/sevent:EVENT/sevent:EVENT_LIST { | ||
deviate add { | ||
sonic-ext:db-name "EVENT_DB"; | ||
} | ||
} | ||
|
||
deviation /sevent:sonic-event/sevent:EVENT_STATS/sevent:EVENT_STATS_LIST { | ||
deviate add { | ||
sonic-ext:db-name "EVENT_DB"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module sonic-evprofile-annot { | ||
|
||
yang-version "1"; | ||
|
||
namespace "http://openconfig.net/Azure/sonic-evprofile-annot"; | ||
prefix "evprofile-annot"; | ||
|
||
import sonic-extensions { prefix sonic-ext; } | ||
import sonic-evprofile { prefix sep; } | ||
|
||
deviation /sep:get-evprofile { | ||
deviate add { | ||
sonic-ext:rpc-callback "rpc_getevprofile_cb"; | ||
} | ||
} | ||
|
||
deviation /sep:set-evprofile { | ||
deviate add { | ||
sonic-ext:rpc-callback "rpc_setevprofile_cb"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,283 @@ | ||
module sonic-alarm { | ||
namespace "http://github.com/Azure/sonic-alarm"; | ||
prefix salarm; | ||
yang-version 1.1; | ||
|
||
|
||
import ietf-yang-types { | ||
prefix yang-types; | ||
} | ||
|
||
import sonic-event { prefix event;} | ||
|
||
// meta | ||
organization | ||
"SONiC"; | ||
|
||
contact | ||
"SONiC"; | ||
|
||
description | ||
"This module defines operational state data for SONiC alarms."; | ||
|
||
revision "2021-01-15" { | ||
description | ||
"Initial revision."; | ||
} | ||
|
||
|
||
grouping alarm-state { | ||
|
||
leaf id { | ||
type string; | ||
description "Sequence identifier for an alarm."; | ||
} | ||
|
||
leaf resource { | ||
type string; | ||
description "The item that is under alarm within the device."; | ||
} | ||
|
||
leaf text { | ||
type string; | ||
description "Dynamic message raised with the alarm."; | ||
} | ||
|
||
leaf time-created { | ||
type event:timeticks64; | ||
description | ||
"The time at which the alarm was raised by the system. | ||
This value is expressed date-and-time format."; | ||
} | ||
|
||
leaf type-id { | ||
type string; | ||
description "Type of the alarm raised"; | ||
} | ||
|
||
leaf severity { | ||
type event:severity-type; | ||
description | ||
"Severity of a raised condition."; | ||
} | ||
|
||
leaf acknowledged { | ||
type boolean; | ||
description | ||
"This denotes whether an alarm is acknowledged by the operator. | ||
An acknowledged alarm is not considered in determining the | ||
health of the system."; | ||
} | ||
|
||
leaf acknowledge-time { | ||
type event:timeticks64; | ||
description | ||
"The time at which alarm is acknowledged by the system. | ||
This value is expressed as nanoseconds since the Unix Epoch."; | ||
} | ||
|
||
} | ||
|
||
container sonic-alarm { | ||
|
||
container ALARM { | ||
|
||
list ALARM_LIST { | ||
key "id"; | ||
uses alarm-state; | ||
} | ||
} | ||
|
||
container ALARM_STATS { | ||
|
||
|
||
list ALARM_STATS_LIST { | ||
|
||
key "id"; | ||
leaf id { | ||
type enumeration { | ||
enum state; | ||
} | ||
description | ||
"Table identifier value defined as state."; | ||
} | ||
|
||
leaf alarms { | ||
type uint64; | ||
description | ||
"Total alarms in the system."; | ||
} | ||
|
||
leaf critical { | ||
type uint64; | ||
description | ||
"Total critical alarms in the system."; | ||
} | ||
|
||
leaf major { | ||
type uint64; | ||
description | ||
"Total major alarms in the system."; | ||
} | ||
|
||
leaf minor { | ||
type uint64; | ||
description | ||
"Total minor alarms in the system."; | ||
} | ||
|
||
leaf warning { | ||
type uint64; | ||
description | ||
"Total warnings in the system."; | ||
} | ||
|
||
leaf acknowledged { | ||
type uint64; | ||
description | ||
"Total acknowledged alarms in the system."; | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
rpc acknowledge-alarms { | ||
description | ||
"Acknowledge an alarm on the system."; | ||
|
||
input { | ||
leaf-list id { | ||
type string; | ||
description | ||
"Alarm identifier."; | ||
} | ||
} | ||
output { | ||
leaf status { | ||
type int32; | ||
description | ||
"The status of the operation execution request."; | ||
} | ||
leaf status-detail { | ||
type string; | ||
description | ||
"The detailed status of the operation execution request."; | ||
} | ||
} | ||
} | ||
|
||
rpc unacknowledge-alarms { | ||
description | ||
"Un-acknowledge an alarm on the system."; | ||
|
||
input { | ||
leaf-list id { | ||
type string; | ||
description | ||
"Alarm identifier."; | ||
} | ||
} | ||
output { | ||
leaf status { | ||
type int32; | ||
description | ||
"The status of the operation execution request."; | ||
} | ||
leaf status-detail { | ||
type string; | ||
description | ||
"The detailed status of the operation execution request."; | ||
} | ||
} | ||
} | ||
|
||
|
||
rpc show-alarms { | ||
description | ||
"Get current alarms based on given filter."; | ||
|
||
input { | ||
choice option { | ||
case time { | ||
description | ||
"Filter alarms on given time duration."; | ||
container time { | ||
leaf begin { | ||
type yang-types:date-and-time; | ||
description | ||
"Specify the start time in RFC3339 format (UTC). | ||
For example: 2021-05-12T13:45:45.455Z"; | ||
} | ||
leaf end { | ||
type yang-types:date-and-time; | ||
description | ||
"Specify end time in RFC3339 format (UTC). | ||
For example: 2021-05-12T13:45:45.455Z"; | ||
} | ||
} | ||
} | ||
|
||
case last-interval { | ||
description | ||
"Filter alarms based on last interval."; | ||
leaf interval { | ||
type enumeration { | ||
enum 5_MINUTES; | ||
enum 60_MINUTES; | ||
enum 24_HOURS; | ||
} | ||
description | ||
"Last interval period."; | ||
} | ||
} | ||
|
||
case severity { | ||
description | ||
"Filter events based on severity."; | ||
leaf severity { | ||
type event:severity-type; | ||
description | ||
"Alarm severity"; | ||
} | ||
} | ||
|
||
case id { | ||
description | ||
"Filter alarms on unique ID."; | ||
container id { | ||
leaf begin { | ||
type string; | ||
description | ||
"Begin identifier."; | ||
} | ||
leaf end { | ||
type string; | ||
description | ||
"End identifier."; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
output { | ||
leaf status { | ||
type int32; | ||
description | ||
"Status of the operation execution request."; | ||
} | ||
leaf status-detail { | ||
type string; | ||
description | ||
"Status details of the operation execution request."; | ||
} | ||
container ALARM { | ||
list ALARM_LIST { | ||
key "id"; | ||
uses alarm-state; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All sonic yangs need to be in the buildimage folder.