-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1513: feat(eventing): Replica events r=datacore-vvarakantham a=datacore-vvarakantham Added replica creation and deletion events. And Replica event specific data(pool name, pool uuid, replica name). Co-authored-by: Vandana Varakantham <yvandana.varakantham@datacore.com>
- Loading branch information
Showing
6 changed files
with
42 additions
and
2 deletions.
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
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,34 @@ | ||
use events_api::event::{ | ||
EventAction, | ||
EventCategory, | ||
EventMessage, | ||
EventMeta, | ||
EventSource, | ||
}; | ||
|
||
use crate::{ | ||
core::{logical_volume::LogicalVolume, MayastorEnvironment}, | ||
eventing::Event, | ||
lvs::lvs_lvol::{Lvol, LvsLvol}, | ||
}; | ||
|
||
// Replica event messages from Lvol data. | ||
impl Event for Lvol { | ||
fn event(&self, event_action: EventAction) -> EventMessage { | ||
let event_source = EventSource::new( | ||
MayastorEnvironment::global_or_default().node_name, | ||
) | ||
.with_replica_data( | ||
self.lvs().name(), | ||
&self.lvs().uuid(), | ||
&self.name(), | ||
); | ||
|
||
EventMessage { | ||
category: EventCategory::Replica as i32, | ||
action: event_action as i32, | ||
target: self.uuid(), | ||
metadata: Some(EventMeta::from_source(event_source)), | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -877,6 +877,7 @@ impl Lvs { | |
} | ||
|
||
info!("{:?}: created", lvol); | ||
lvol.event(EventAction::Create).generate(); | ||
Ok(lvol) | ||
} | ||
|
||
|
Submodule io-engine-dependencies
updated
2 files
+15 −0 | events-api/protobuf/v1/event.proto | |
+18 −2 | events-api/src/event_traits.rs |