Commit b359fe30 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into...

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into feat/159-automation-component-skeleton
parents 22bf3dc0 e977852e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -66,6 +66,6 @@ spec:
            pathType: Prefix
            backend:
              service:
                name: qkd-appservice
                name: nbiservice
                port:
                  number: 8005
                  number: 8080
+37 −41
Original line number Diff line number Diff line
@@ -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:
@@ -78,6 +77,3 @@ spec:
      protocol: TCP
      port: 9192
      targetPort: 9192
  - name: http
    port: 8005
    targetPort: 8005
+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;
@@ -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;
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ cd $PROJECTDIR/src
# coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
#     kpi_manager/tests/test_unitary.py
CRDB_SQL_ADDRESS=$(kubectl get service --namespace ${CRDB_NAMESPACE} cockroachdb-public -o 'jsonpath={.spec.clusterIP}')
export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs-telemetry?sslmode=require"
export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_telemetry?sslmode=require"
RCFILE=$PROJECTDIR/coverage/.coveragerc
python3 -m pytest --log-level=DEBUG --log-cli-level=debug --verbose \
    telemetry/tests/test_telemetryDB.py
+5 −0
Original line number Diff line number Diff line
@@ -19,7 +19,12 @@ PROJECTDIR=`pwd`
cd $PROJECTDIR/src
# RCFILE=$PROJECTDIR/coverage/.coveragerc
# coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
#     kpi_manager/tests/test_unitary.py

# python3 kpi_manager/tests/test_unitary.py
export KFK_SERVER_ADDRESS='127.0.0.1:9092'
CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}')
export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_telemetry?sslmode=require"
RCFILE=$PROJECTDIR/coverage/.coveragerc


Loading