Skip to content

Commit

Permalink
Merge pull request #54 from datacore-vvarakantham/host-events
Browse files Browse the repository at this point in the history
feat(eventing): event specific details for host events
  • Loading branch information
tiagolobocastro authored Dec 8, 2023
2 parents b591fb0 + c3d4343 commit 2c0e0c1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis/events/protobuf/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,8 @@ message NvmePathEventDetails {
message HostInitiatorEventDetails {
string host_nqn = 1;
string subsystem_nqn = 2;
// The target on which the host is connected to the subsystem - Nexus/Replica
string target = 3;
// Target uuid
string uuid = 4;
}
13 changes: 13 additions & 0 deletions apis/events/src/event_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ impl EventSource {
}
}

/// Add target(nexus/replica) details to host event meta data.
pub fn with_target_data(mut self, target: &str, uuid: &str) -> Self {
if let Some(mut event_details) = self.event_details {
if let Some(mut host_initiator_details) = event_details.host_initiator_details {
host_initiator_details.target = target.to_string();
host_initiator_details.uuid = uuid.to_string();
event_details.host_initiator_details = Some(host_initiator_details);
}
self.event_details = Some(event_details);
}
self
}

/// Add host event specific data to event source.
pub fn with_host_initiator_data(mut self, host_nqn: &str) -> Self {
if let Some(mut event_details) = self.event_details {
Expand Down

0 comments on commit 2c0e0c1

Please sign in to comment.