-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add grpc service to set monitor provided group is, aka optimized ana …
…group Signed-off-by: Alexander Indenbaum <[email protected]>
- Loading branch information
Alexander Indenbaum
committed
Dec 4, 2023
1 parent
5eee6f4
commit 67397b7
Showing
6 changed files
with
77 additions
and
18 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
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,12 @@ | ||
from control.proto import monitor_pb2 | ||
from control.proto.monitor_pb2_grpc import MonitorStub | ||
from control.server import GatewayServer | ||
import grpc | ||
|
||
def set_group_id(group_id: int, server: GatewayServer): | ||
"""Set group ID od the gateway, mocking nvmeof gateway monitor client""" | ||
channel = grpc.insecure_channel(server._monitor_address()) | ||
stub = MonitorStub(channel) | ||
request = monitor_pb2.group_id_req(id=group_id) | ||
stub.group_id(request) | ||
print(f"Set group id {group_id=} using address {server._monitor_address()} successfully.") |
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