-
Notifications
You must be signed in to change notification settings - Fork 539
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
[orchagent]: Publish identified events via structured-events channel #2446
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d0f90cf
Add events publish
renukamanavalan d2a770a
Added header file
renukamanavalan d06d4a3
signature fix
renukamanavalan 9cc12ed
syntax
renukamanavalan bc77624
syntax
renukamanavalan 50f125c
syntax
renukamanavalan d159800
syntax
renukamanavalan 8a66584
syntax
renukamanavalan d8f6fa1
syntax
renukamanavalan 74ff2dc
Updated fake code
renukamanavalan 69a9662
Remove if and log messages for event_publish
zbud-msft 460a7ec
Remove if and log messages for event_publish (#1)
zbud-msft a248ba5
Remove event_handle_t from signature and add globally
zbud-msft 3229496
Resolve merge conflicts
zbud-msft 082a260
Remove extern orchdaemon.cpp
zbud-msft e7d4d4d
Merge pull request #2 from renukamanavalan/removeLog
zbud-msft 46f535f
Revert unneeded changes
zbud-msft a3dd21c
Merge pull request #3 from renukamanavalan/removeLog
zbud-msft 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
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#include <map> | ||
#include "orch.h" | ||
#include "port.h" | ||
#include "events.h" | ||
|
||
extern "C" { | ||
#include "sai.h" | ||
|
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
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
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
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
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 |
---|---|---|
|
@@ -55,6 +55,7 @@ extern string gMySwitchType; | |
extern int32_t gVoqMySwitchId; | ||
extern string gMyHostName; | ||
extern string gMyAsicName; | ||
extern event_handle_t g_events_handle; | ||
|
||
#define DEFAULT_SYSTEM_PORT_MTU 9100 | ||
#define VLAN_PREFIX "Vlan" | ||
|
@@ -352,7 +353,8 @@ static bool isValidPortTypeForLagMember(const Port& port) | |
* bridge. By design, SONiC switch starts with all bridge ports removed from | ||
* default VLAN and all ports removed from .1Q bridge. | ||
*/ | ||
PortsOrch::PortsOrch(DBConnector *db, DBConnector *stateDb, vector<table_name_with_pri_t> &tableNames, DBConnector *chassisAppDb) : | ||
PortsOrch::PortsOrch(DBConnector *db, DBConnector *stateDb, vector<table_name_with_pri_t> &tableNames, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please revert this change if its not modified? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
DBConnector *chassisAppDb) : | ||
Orch(db, tableNames), | ||
m_portStateTable(stateDb, STATE_PORT_TABLE_NAME), | ||
port_stat_manager(PORT_STAT_COUNTER_FLEX_COUNTER_GROUP, StatsMode::READ, PORT_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS, false), | ||
|
@@ -2537,6 +2539,8 @@ bool PortsOrch::setHostIntfsOperStatus(const Port& port, bool isUp) const | |
SWSS_LOG_NOTICE("Set operation status %s to host interface %s", | ||
isUp ? "UP" : "DOWN", port.m_alias.c_str()); | ||
|
||
event_params_t params = {{"ifname",port.m_alias},{"status",isUp ? "up" : "down"}}; | ||
event_publish(g_events_handle, "if-state", ¶ms); | ||
return true; | ||
} | ||
|
||
|
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
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.
You may want to revert this
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.
Done