Commit 6655cdbe authored by Mohammad Ismaeel's avatar Mohammad Ismaeel
Browse files

Integral optical link with optical controller

parent ca8d23f9
Loading
Loading
Loading
Loading
+8 KiB (16 KiB)

File changed.

No diff preview for this file type.

+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ export CRDB_DEPLOY_MODE="single"
export CRDB_DROP_DATABASE_IF_EXISTS=""

# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY="YES"
export CRDB_REDEPLOY=""


# ----- NATS -------------------------------------------------------------------
+1 −0
Original line number Diff line number Diff line
@@ -638,6 +638,7 @@ message OpticalConfigId {
message OpticalConfig {
  OpticalConfigId opticalconfig_id = 1;
  string config = 2;
  DeviceId device_id = 3;
}

message OpticalConfigList {
+10 −1
Original line number Diff line number Diff line
@@ -45,12 +45,21 @@ def channel_get_uuid(
       
    ], extra_details=['Channel name is required to produce a channel UUID'])
    
def device_get_uuid (device_name) : 
    if (len(device_name)> 0):
        return  get_uuid_from_string(device_name)
    raise InvalidArgumentsException([
        ('name', device_name),
    ], extra_details=['Device Name is required to produce Device UUID'])


def opticalconfig_get_uuid(
    device_name : str = '', allow_random : bool = False
) -> str:
    
    if len(device_name) > 0:
        return get_uuid_from_string(device_name)
        device_uuid= device_get_uuid(device_name=device_name)
        return get_uuid_from_string(f"{device_uuid}_opticalconfig")
    if allow_random: return get_uuid_random()

    raise InvalidArgumentsException([
+3 −1
Original line number Diff line number Diff line
@@ -317,8 +317,10 @@ class ContextServiceServicerImpl(ContextServiceServicer, ContextPolicyServiceSer
    def SelectOpticalConfig(self, request : OpticalConfigId, context : grpc.ServicerContext) -> OpticalConfig:
        result = select_opticalconfig(self.db_engine, request)
        optical_config_id = OpticalConfigId()
        device_id = DeviceId()
        optical_config_id.CopyFrom(result.opticalconfig_id)
        return OpticalConfig(config=result.config, opticalconfig_id=optical_config_id)
        device_id.CopyFrom(result.device_id)
        return OpticalConfig(config=result.config, opticalconfig_id=optical_config_id , device_id=device_id)
   
    @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
    def DeleteOpticalConfig (self, request : OpticalConfigId, context : grpc.ServicerContext) -> Empty:
Loading