grpc: removed old client, refactored wrapped client to be the new standard client, removed old client tests, updated documentation

This commit is contained in:
Blake Harnden 2021-05-04 13:29:22 -07:00
parent 924e86da2b
commit 15acdaa40f
14 changed files with 698 additions and 3008 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,7 @@ from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Set, Tuple
import grpc
from core.api.grpc import clientw, configservices_pb2, core_pb2
from core.api.grpc import client, configservices_pb2, core_pb2
from core.api.grpc.wrappers import (
ConfigOption,
ConfigService,
@ -66,7 +66,7 @@ class CoreClient:
"""
self.app: "Application" = app
self.master: tk.Tk = app.master
self._client: clientw.CoreGrpcClient = clientw.CoreGrpcClient(proxy=proxy)
self._client: client.CoreGrpcClient = client.CoreGrpcClient(proxy=proxy)
self.session: Optional[Session] = None
self.user = getpass.getuser()
@ -95,7 +95,7 @@ class CoreClient:
self.handling_events: Optional[grpc.Future] = None
@property
def client(self) -> clientw.CoreGrpcClient:
def client(self) -> client.CoreGrpcClient:
if self.session:
if not self._client.check_session(self.session.id):
throughputs_enabled = self.handling_throughputs is not None

View file

@ -1,7 +1,7 @@
import argparse
import logging
from core.api.grpc import clientw
from core.api.grpc import client
from core.api.grpc.wrappers import NodeType, Position
@ -11,10 +11,10 @@ def log_event(event):
def main(args):
# helper to create interfaces
interface_helper = clientw.InterfaceHelper(ip4_prefix="10.83.0.0/16")
interface_helper = client.InterfaceHelper(ip4_prefix="10.83.0.0/16")
# create grpc client and connect
core = clientw.CoreGrpcClient()
core = client.CoreGrpcClient()
core.connect()
# create session

View file

@ -1,13 +1,13 @@
# required imports
from core.api.grpc import clientw
from core.api.grpc import client
from core.api.grpc.wrappers import NodeType, Position
from core.emane.ieee80211abg import EmaneIeee80211abgModel
# interface helper
iface_helper = clientw.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
iface_helper = client.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
# create grpc client and connect
core = clientw.CoreGrpcClient()
core = client.CoreGrpcClient()
core.connect()
# add session

View file

@ -1,11 +1,11 @@
from core.api.grpc import clientw
from core.api.grpc import client
from core.api.grpc.wrappers import Position
# interface helper
iface_helper = clientw.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
iface_helper = client.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
# create grpc client and connect
core = clientw.CoreGrpcClient()
core = client.CoreGrpcClient()
core.connect()
# add session

View file

@ -1,11 +1,11 @@
from core.api.grpc import clientw
from core.api.grpc import client
from core.api.grpc.wrappers import NodeType, Position
# interface helper
iface_helper = clientw.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
iface_helper = client.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
# create grpc client and connect
core = clientw.CoreGrpcClient()
core = client.CoreGrpcClient()
core.connect()
# add session

View file

@ -1,11 +1,11 @@
from core.api.grpc import clientw
from core.api.grpc import client
from core.api.grpc.wrappers import NodeType, Position
# interface helper
iface_helper = clientw.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
iface_helper = client.InterfaceHelper(ip4_prefix="10.0.0.0/24", ip6_prefix="2001::/64")
# create grpc client and connect
core = clientw.CoreGrpcClient()
core = client.CoreGrpcClient()
core.connect()
# add session

View file

@ -15,7 +15,7 @@ import grpc
import netaddr
from netaddr import EUI, AddrFormatError, IPNetwork
from core.api.grpc.clientw import CoreGrpcClient
from core.api.grpc.client import CoreGrpcClient
from core.api.grpc.wrappers import (
Geo,
Interface,

View file

@ -5,7 +5,7 @@ import sys
from pathlib import Path
from core import utils
from core.api.grpc.clientw import CoreGrpcClient
from core.api.grpc.client import CoreGrpcClient
from core.errors import CoreCommandError
if __name__ == "__main__":

View file

@ -15,7 +15,7 @@ from typing import Dict, Tuple
import grpc
from core import utils
from core.api.grpc.clientw import CoreGrpcClient
from core.api.grpc.client import CoreGrpcClient
from core.api.grpc.wrappers import NodeType
SDT_HOST = "127.0.0.1"

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,7 @@ import pytest
from mock import patch
from core.api.grpc import core_pb2
from core.api.grpc.clientw import CoreGrpcClient, InterfaceHelper, MoveNodesStreamer
from core.api.grpc.client import CoreGrpcClient, InterfaceHelper, MoveNodesStreamer
from core.api.grpc.server import CoreGrpcServer
from core.api.grpc.wrappers import (
ConfigOption,