diff --git a/proto/pathcomp.proto b/proto/pathcomp.proto index 2570456bba28fd4baa02628aedabed1cc63db10a..9eb650fb9981b4b84f31b63796eec0c7a8e780b6 100644 --- a/proto/pathcomp.proto +++ b/proto/pathcomp.proto @@ -21,8 +21,19 @@ service PathCompService { rpc Compute(PathCompRequest) returns (PathCompReply) {} } +message Algorithm_ShortestPath {} + +message Algorithm_KShortestPath { + uint32 k_inspection = 1; + uint32 k_return = 2; +} + message PathCompRequest { repeated context.Service services = 1; + oneof algorithm { + Algorithm_ShortestPath shortest_path = 10; + Algorithm_KShortestPath k_shortest_path = 11; + } } message PathCompReply { diff --git a/src/pathcomp/service/PathCompServiceServicerImpl.py b/src/pathcomp/service/PathCompServiceServicerImpl.py index 1bb4470b1c2863a04e7be2816f250e5e42fcb500..e1c7251508ea767a38d3102cca8f4edd50cf9170 100644 --- a/src/pathcomp/service/PathCompServiceServicerImpl.py +++ b/src/pathcomp/service/PathCompServiceServicerImpl.py @@ -38,6 +38,8 @@ class PathCompServiceServicerImpl(PathCompServiceServicer): context_client = ContextClient() + # TODO: consider filtering resources + grpc_contexts = context_client.ListContexts(Empty()) grpc_devices = context_client.ListDevices(Empty()) grpc_links = context_client.ListLinks(Empty()) diff --git a/src/pathcomp/tests/Objects.py b/src/pathcomp/tests/Objects.py index a3cf10b789d0fa7cb6fd3fdf3e2802dcb6024ec8..f4785d7ae670efcc5525d6b00c4baf3acf3f22b1 100644 --- a/src/pathcomp/tests/Objects.py +++ b/src/pathcomp/tests/Objects.py @@ -93,8 +93,8 @@ LINK_C2_C3_ID, LINK_C2_C3 = compose_link(DEVICE_C2_ENDPOINTS[1], DEVICE_C3_ENDPO # ----- Service -------------------------------------------------------------------------------------------------------- SERVICE_A1_B1 = compose_service(DEVICE_A1_ENDPOINTS[2], DEVICE_B1_ENDPOINTS[2], constraints=[ - json_constraint('bandwidth', 10.0), - json_constraint('latency_ms', 5.0) + json_constraint('bandwidth[gbps]', 10.0), + json_constraint('latency[ms]', 5.0), ]) # ----- Containers -----------------------------------------------------------------------------------------------------