Loading manifests/nginx_ingress_http.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -66,6 +66,6 @@ spec: pathType: Prefix backend: service: name: qkd-appservice name: nbiservice port: number: 8005 number: 8080 manifests/qkd_appservice.yaml +37 −41 Original line number Diff line number Diff line Loading @@ -34,11 +34,10 @@ spec: ports: - containerPort: 10060 - containerPort: 9192 - containerPort: 8005 env: - name: LOG_LEVEL value: "DEBUG" - name: CRDB_DATABASE_APP value: "INFO" - name: CRDB_DATABASE value: "qkd_app" envFrom: - secretRef: Loading Loading @@ -78,6 +77,3 @@ spec: protocol: TCP port: 9192 targetPort: 9192 - name: http port: 8005 targetPort: 8005 proto/qkd_app.proto +36 −9 Original line number Diff line number Diff line // Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package qkd_app; import "context.proto"; // Optare: Change this if you want to change App's structure or enums. // Optare: If a message (structure) is changed it must be changed in src/app/service/database // Define Empty message if you don't want to use google.protobuf.Empty. message Empty {} // Enum representing possible states of a QKD application. enum QKDAppStatusEnum { QKDAPPSTATUS_ON = 0; QKDAPPSTATUS_DISCONNECTED = 1; Loading @@ -13,16 +28,26 @@ enum QKDAppStatusEnum { QKDAPPSTATUS_ZOMBIE = 3; } // Enum representing QKD application types. enum QKDAppTypesEnum { QKDAPPTYPES_INTERNAL = 0; QKDAPPTYPES_CLIENT = 1; } // Message representing a QKDL (Quantum Key Distribution Link) identifier. message QKDLId { context.Uuid qkdl_uuid = 1; } // Define QoS parameters for QKD applications message QoS { uint32 max_bandwidth = 1; // Maximum bandwidth (in bits per second) uint32 min_bandwidth = 2; // Minimum bandwidth (optional) uint32 jitter = 3; // Maximum jitter (in milliseconds) uint32 ttl = 4; // Time-to-live (in seconds) } // Main message representing a QKD application with all required fields. message App { AppId app_id = 1; QKDAppStatusEnum app_status = 2; Loading @@ -32,22 +57,24 @@ message App { repeated QKDLId backing_qkdl_id = 6; context.DeviceId local_device_id = 7; context.DeviceId remote_device_id = 8; QoS qos = 9; // Include QoS in the App message } // Message representing an identifier for an app. message AppId { context.ContextId context_id = 1; context.Uuid app_uuid = 2; } // Service definition for AppService, including app registration and listing. service AppService { rpc RegisterApp(App) returns (context.Empty) {} rpc ListApps(context.ContextId) returns (AppList) {} rpc GetApp(AppId) returns (App) {} rpc DeleteApp (AppId) returns (Empty) {} // Use locally defined Empty } // Message representing a list of apps. message AppList { repeated App apps = 1; } src/common/Constants.py +4 −7 Original line number Diff line number Diff line Loading @@ -114,15 +114,12 @@ DEFAULT_SERVICE_GRPC_PORTS = { # Default HTTP/REST-API service ports DEFAULT_SERVICE_HTTP_PORTS = { ServiceNameEnum.CONTEXT .value : 8080, ServiceNameEnum.NBI .value : 8080, ServiceNameEnum.WEBUI.value : 8004, ServiceNameEnum.QKD_APP .value : 8005, } # Default HTTP/REST-API service base URLs DEFAULT_SERVICE_HTTP_BASEURLS = { ServiceNameEnum.NBI .value : None, ServiceNameEnum.WEBUI.value : None, ServiceNameEnum.QKD_APP .value : None, } src/common/Settings.py +5 −3 Original line number Diff line number Diff line Loading @@ -15,9 +15,11 @@ import logging, os, re, time from typing import Dict, List from common.Constants import ( DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, DEFAULT_LOG_LEVEL, DEFAULT_METRICS_PORT, DEFAULT_SERVICE_GRPC_PORTS, DEFAULT_SERVICE_HTTP_BASEURLS, DEFAULT_SERVICE_HTTP_PORTS, ServiceNameEnum DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, DEFAULT_LOG_LEVEL, DEFAULT_METRICS_PORT, DEFAULT_SERVICE_GRPC_PORTS, DEFAULT_SERVICE_HTTP_BASEURLS, DEFAULT_SERVICE_HTTP_PORTS, ServiceNameEnum ) LOGGER = logging.getLogger(__name__) Loading Loading
manifests/nginx_ingress_http.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -66,6 +66,6 @@ spec: pathType: Prefix backend: service: name: qkd-appservice name: nbiservice port: number: 8005 number: 8080
manifests/qkd_appservice.yaml +37 −41 Original line number Diff line number Diff line Loading @@ -34,11 +34,10 @@ spec: ports: - containerPort: 10060 - containerPort: 9192 - containerPort: 8005 env: - name: LOG_LEVEL value: "DEBUG" - name: CRDB_DATABASE_APP value: "INFO" - name: CRDB_DATABASE value: "qkd_app" envFrom: - secretRef: Loading Loading @@ -78,6 +77,3 @@ spec: protocol: TCP port: 9192 targetPort: 9192 - name: http port: 8005 targetPort: 8005
proto/qkd_app.proto +36 −9 Original line number Diff line number Diff line // Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package qkd_app; import "context.proto"; // Optare: Change this if you want to change App's structure or enums. // Optare: If a message (structure) is changed it must be changed in src/app/service/database // Define Empty message if you don't want to use google.protobuf.Empty. message Empty {} // Enum representing possible states of a QKD application. enum QKDAppStatusEnum { QKDAPPSTATUS_ON = 0; QKDAPPSTATUS_DISCONNECTED = 1; Loading @@ -13,16 +28,26 @@ enum QKDAppStatusEnum { QKDAPPSTATUS_ZOMBIE = 3; } // Enum representing QKD application types. enum QKDAppTypesEnum { QKDAPPTYPES_INTERNAL = 0; QKDAPPTYPES_CLIENT = 1; } // Message representing a QKDL (Quantum Key Distribution Link) identifier. message QKDLId { context.Uuid qkdl_uuid = 1; } // Define QoS parameters for QKD applications message QoS { uint32 max_bandwidth = 1; // Maximum bandwidth (in bits per second) uint32 min_bandwidth = 2; // Minimum bandwidth (optional) uint32 jitter = 3; // Maximum jitter (in milliseconds) uint32 ttl = 4; // Time-to-live (in seconds) } // Main message representing a QKD application with all required fields. message App { AppId app_id = 1; QKDAppStatusEnum app_status = 2; Loading @@ -32,22 +57,24 @@ message App { repeated QKDLId backing_qkdl_id = 6; context.DeviceId local_device_id = 7; context.DeviceId remote_device_id = 8; QoS qos = 9; // Include QoS in the App message } // Message representing an identifier for an app. message AppId { context.ContextId context_id = 1; context.Uuid app_uuid = 2; } // Service definition for AppService, including app registration and listing. service AppService { rpc RegisterApp(App) returns (context.Empty) {} rpc ListApps(context.ContextId) returns (AppList) {} rpc GetApp(AppId) returns (App) {} rpc DeleteApp (AppId) returns (Empty) {} // Use locally defined Empty } // Message representing a list of apps. message AppList { repeated App apps = 1; }
src/common/Constants.py +4 −7 Original line number Diff line number Diff line Loading @@ -114,15 +114,12 @@ DEFAULT_SERVICE_GRPC_PORTS = { # Default HTTP/REST-API service ports DEFAULT_SERVICE_HTTP_PORTS = { ServiceNameEnum.CONTEXT .value : 8080, ServiceNameEnum.NBI .value : 8080, ServiceNameEnum.WEBUI.value : 8004, ServiceNameEnum.QKD_APP .value : 8005, } # Default HTTP/REST-API service base URLs DEFAULT_SERVICE_HTTP_BASEURLS = { ServiceNameEnum.NBI .value : None, ServiceNameEnum.WEBUI.value : None, ServiceNameEnum.QKD_APP .value : None, }
src/common/Settings.py +5 −3 Original line number Diff line number Diff line Loading @@ -15,9 +15,11 @@ import logging, os, re, time from typing import Dict, List from common.Constants import ( DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, DEFAULT_LOG_LEVEL, DEFAULT_METRICS_PORT, DEFAULT_SERVICE_GRPC_PORTS, DEFAULT_SERVICE_HTTP_BASEURLS, DEFAULT_SERVICE_HTTP_PORTS, ServiceNameEnum DEFAULT_GRPC_BIND_ADDRESS, DEFAULT_GRPC_GRACE_PERIOD, DEFAULT_GRPC_MAX_WORKERS, DEFAULT_HTTP_BIND_ADDRESS, DEFAULT_LOG_LEVEL, DEFAULT_METRICS_PORT, DEFAULT_SERVICE_GRPC_PORTS, DEFAULT_SERVICE_HTTP_BASEURLS, DEFAULT_SERVICE_HTTP_PORTS, ServiceNameEnum ) LOGGER = logging.getLogger(__name__) Loading