diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 713d893cffe4b88cb9b37d64a860f480c9669008..6a00c6eed58ed2421c20acd90f407bd51893bd34 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,9 +28,10 @@ include:
- local: '/src/context/.gitlab-ci.yml'
- local: '/src/device/.gitlab-ci.yml'
- local: '/src/service/.gitlab-ci.yml'
- #- local: '/src/dbscanserving/.gitlab-ci.yml'
- #- local: '/src/opticalattackmitigator/.gitlab-ci.yml'
- #- local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml'
+ - local: '/src/dbscanserving/.gitlab-ci.yml'
+ - local: '/src/opticalattackmitigator/.gitlab-ci.yml'
+ - local: '/src/opticalattackdetector/.gitlab-ci.yml'
+ - local: '/src/opticalattackmanager/.gitlab-ci.yml'
- local: '/src/automation/.gitlab-ci.yml'
- local: '/src/policy/.gitlab-ci.yml'
#- local: '/src/webui/.gitlab-ci.yml'
diff --git a/common_requirements.in b/common_requirements.in
index cb418f0197f1d18980654c8d00102efd191c67dd..39982ebe75dedf8bfaceebe1bfcf986a815ea7ff 100644
--- a/common_requirements.in
+++ b/common_requirements.in
@@ -16,6 +16,7 @@ coverage==6.3
grpcio==1.47.*
grpcio-health-checking==1.47.*
grpcio-tools==1.47.*
+grpclib[protobuf]
prettytable==3.5.0
prometheus-client==0.13.0
protobuf==3.20.*
diff --git a/deploy/tfs.sh b/deploy/tfs.sh
index fd8625cf2563280e8e6a8ff7a714a03a8622a473..a67cbeafc9edb6edf5aa6f5bfe1bc027d2099028 100755
--- a/deploy/tfs.sh
+++ b/deploy/tfs.sh
@@ -175,6 +175,14 @@ echo "# Environment variables for TeraFlowSDN deployment" > $ENV_VARS_SCRIPT
PYTHONPATH=$(pwd)/src
echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT
+echo "Create Redis secret..."
+# first try to delete an old one if exists
+kubectl delete secret redis-secrets --namespace=$TFS_K8S_NAMESPACE
+REDIS_PASSWORD=`uuidgen`
+kubectl create secret generic redis-secrets --namespace=$TFS_K8S_NAMESPACE \
+ --from-literal=REDIS_PASSWORD=$REDIS_PASSWORD
+echo "export REDIS_PASSWORD=${REDIS_PASSWORD}" >> $ENV_VARS_SCRIPT
+
for COMPONENT in $TFS_COMPONENTS; do
echo "Processing '$COMPONENT' component..."
diff --git a/manifests/cachingservice.yaml b/manifests/cachingservice.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..be8fced491a823aace2b7e06be3aad1f6114d245
--- /dev/null
+++ b/manifests/cachingservice.yaml
@@ -0,0 +1,64 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: cachingservice
+spec:
+ selector:
+ matchLabels:
+ app: cachingservice
+ template:
+ metadata:
+ labels:
+ app: cachingservice
+ spec:
+ containers:
+ - name: redis
+ image: redis:7.0-alpine
+ env:
+ - name: REDIS_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: redis-secrets
+ key: REDIS_PASSWORD
+ ports:
+ - containerPort: 6379
+ name: client
+ command: ["redis-server"]
+ args:
+ - --requirepass
+ - $(REDIS_PASSWORD)
+ resources:
+ requests:
+ cpu: 50m
+ memory: 64Mi
+ limits:
+ cpu: 500m
+ memory: 512Mi
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: cachingservice
+spec:
+ type: ClusterIP
+ selector:
+ app: cachingservice
+ ports:
+ - name: redis
+ port: 6379
+ targetPort: 6379
diff --git a/manifests/dbscanservingservice.yaml b/manifests/dbscanservingservice.yaml
index ae920143454da2c63bccc6eb74ea75670bad6eff..b5b8fc437a9b7f47f92defdbc96ee71a56715316 100644
--- a/manifests/dbscanservingservice.yaml
+++ b/manifests/dbscanservingservice.yaml
@@ -31,33 +31,61 @@ spec:
image: labs.etsi.org:5050/tfs/controller/dbscanserving:latest
imagePullPolicy: Always
ports:
- - containerPort: 10006
+ - containerPort: 10008
+ - containerPort: 9192
env:
- name: LOG_LEVEL
- value: "DEBUG"
+ value: "INFO"
readinessProbe:
exec:
- command: ["/bin/grpc_health_probe", "-addr=:10006"]
+ command: ["/bin/grpc_health_probe", "-addr=:10008"]
livenessProbe:
exec:
- command: ["/bin/grpc_health_probe", "-addr=:10006"]
+ command: ["/bin/grpc_health_probe", "-addr=:10008"]
resources:
requests:
cpu: 250m
- memory: 512Mi
+ memory: 128Mi
limits:
- cpu: 700m
+ cpu: 1000m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: dbscanservingservice
+ labels:
+ app: dbscanservingservice
spec:
type: ClusterIP
selector:
app: dbscanservingservice
ports:
- name: grpc
- port: 10006
- targetPort: 10006
+ port: 10008
+ targetPort: 10008
+ - name: metrics
+ port: 9192
+ targetPort: 9192
+---
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+ name: dbscanservingservice-hpa
+spec:
+ scaleTargetRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: dbscanservingservice
+ minReplicas: 1
+ maxReplicas: 20
+ metrics:
+ - type: Resource
+ resource:
+ name: cpu
+ target:
+ type: Utilization
+ averageUtilization: 80
+ #behavior:
+ # scaleDown:
+ # stabilizationWindowSeconds: 30
diff --git a/manifests/opticalattackdetectorservice.yaml b/manifests/opticalattackdetectorservice.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..197c23dd237e5f6271fbab7e47613892c6f58f83
--- /dev/null
+++ b/manifests/opticalattackdetectorservice.yaml
@@ -0,0 +1,96 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: opticalattackdetectorservice
+spec:
+ selector:
+ matchLabels:
+ app: opticalattackdetectorservice
+ template:
+ metadata:
+ labels:
+ app: opticalattackdetectorservice
+ spec:
+ terminationGracePeriodSeconds: 5
+ containers:
+ - name: server
+ image: labs.etsi.org:5050/tfs/controller/opticalattackdetector:latest
+ imagePullPolicy: Always
+ ports:
+ - containerPort: 10006
+ - containerPort: 9192
+ env:
+ - name: LOG_LEVEL
+ value: "INFO"
+ - name: REDIS_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: redis-secrets
+ key: REDIS_PASSWORD
+ readinessProbe:
+ exec:
+ command: ["/bin/grpc_health_probe", "-addr=:10006"]
+ livenessProbe:
+ exec:
+ command: ["/bin/grpc_health_probe", "-addr=:10006"]
+ resources:
+ requests:
+ cpu: 250m
+ memory: 128Mi
+ limits:
+ cpu: 1000m
+ memory: 1024Mi
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: opticalattackdetectorservice
+ labels:
+ app: opticalattackdetectorservice
+spec:
+ type: ClusterIP
+ selector:
+ app: opticalattackdetectorservice
+ ports:
+ - name: grpc
+ port: 10006
+ targetPort: 10006
+ - name: metrics
+ port: 9192
+ targetPort: 9192
+---
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+ name: opticalattackdetectorservice-hpa
+spec:
+ scaleTargetRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: opticalattackdetectorservice
+ minReplicas: 1
+ maxReplicas: 20
+ metrics:
+ - type: Resource
+ resource:
+ name: cpu
+ target:
+ type: Utilization
+ averageUtilization: 80
+ #behavior:
+ # scaleDown:
+ # stabilizationWindowSeconds: 30
diff --git a/manifests/opticalcentralizedattackdetectorservice.yaml b/manifests/opticalattackmanagerservice.yaml
similarity index 52%
rename from manifests/opticalcentralizedattackdetectorservice.yaml
rename to manifests/opticalattackmanagerservice.yaml
index 13d4d97c222699544dc051564ec1609cad7ed7e1..f9838bcbb1c0d86e5d3a22d8ed982b533f984eb3 100644
--- a/manifests/opticalcentralizedattackdetectorservice.yaml
+++ b/manifests/opticalattackmanagerservice.yaml
@@ -15,49 +15,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
- name: opticalcentralizedattackdetectorservice
+ name: opticalattackmanagerservice
spec:
selector:
matchLabels:
- app: opticalcentralizedattackdetectorservice
+ app: opticalattackmanagerservice
+ replicas: 1
template:
metadata:
labels:
- app: opticalcentralizedattackdetectorservice
+ app: opticalattackmanagerservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
- image: labs.etsi.org:5050/tfs/controller/opticalcentralizedattackdetector:latest
+ image: labs.etsi.org:5050/tfs/controller/opticalattackmanager:latest
imagePullPolicy: Always
ports:
- containerPort: 10005
- envFrom:
- - secretRef:
- name: monitoring-secrets
- readinessProbe:
- exec:
- command: ["/bin/grpc_health_probe", "-addr=:10005"]
- livenessProbe:
- exec:
- command: ["/bin/grpc_health_probe", "-addr=:10005"]
+ - containerPort: 9192
+ env:
+ - name: LOG_LEVEL
+ value: "INFO"
+ - name: MONITORING_INTERVAL
+ value: "30"
+ - name: OPTICALATTACKMANAGERSERVICE_LOOP_MIN_WORKERS
+ value: "2" # remember to align this with the resource limits
+ - name: OPTICALATTACKMANAGERSERVICE_LOOP_MAX_WORKERS
+ value: "10" # remember to align this with the resource limits
+ - name: REDIS_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: redis-secrets
+ key: REDIS_PASSWORD
resources:
requests:
cpu: 250m
- memory: 512Mi
+ memory: 128Mi
limits:
- cpu: 700m
- memory: 1024Mi
+ cpu: 10000m
+ memory: 10240Mi
---
apiVersion: v1
kind: Service
metadata:
- name: opticalcentralizedattackdetectorservice
+ name: opticalattackmanagerservice
+ labels:
+ app: opticalattackmanagerservice
spec:
type: ClusterIP
selector:
- app: opticalcentralizedattackdetectorservice
+ app: opticalattackmanagerservice
ports:
- name: grpc
port: 10005
targetPort: 10005
+ - name: metrics
+ port: 9192
+ targetPort: 9192
diff --git a/manifests/opticalattackmitigatorservice.yaml b/manifests/opticalattackmitigatorservice.yaml
index bfac05e40917aeca1f55c68ebf845937b46c9cdb..4d148b347157bd310ec6c921670f0434315e6e27 100644
--- a/manifests/opticalattackmitigatorservice.yaml
+++ b/manifests/opticalattackmitigatorservice.yaml
@@ -32,9 +32,10 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: 10007
+ - containerPort: 9192
env:
- name: LOG_LEVEL
- value: "DEBUG"
+ value: "INFO"
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10007"]
@@ -44,15 +45,17 @@ spec:
resources:
requests:
cpu: 250m
- memory: 512Mi
+ memory: 128Mi
limits:
- cpu: 700m
+ cpu: 1000m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: opticalattackmitigatorservice
+ labels:
+ app: opticalattackmitigatorservice
spec:
type: ClusterIP
selector:
@@ -61,3 +64,28 @@ spec:
- name: grpc
port: 10007
targetPort: 10007
+ - name: metrics
+ port: 9192
+ targetPort: 9192
+---
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+ name: opticalattackmitigatorservice-hpa
+spec:
+ scaleTargetRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: opticalattackmitigatorservice
+ minReplicas: 1
+ maxReplicas: 20
+ metrics:
+ - type: Resource
+ resource:
+ name: cpu
+ target:
+ type: Utilization
+ averageUtilization: 80
+ #behavior:
+ # scaleDown:
+ # stabilizationWindowSeconds: 30
diff --git a/manifests/servicemonitors.yaml b/manifests/servicemonitors.yaml
index ec929f757cdf5468a7db7a7c1f1e755611d5327b..e77216af2a723cef8a4c5f468ef564625ea810f1 100644
--- a/manifests/servicemonitors.yaml
+++ b/manifests/servicemonitors.yaml
@@ -359,3 +359,119 @@ spec:
any: false
matchNames:
- tfs # namespace where the app is running
+---
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ namespace: monitoring # namespace where prometheus is running
+ name: tfs-dbscanservingservice-metric
+ labels:
+ app: dbscanservingservice
+ #release: prometheus
+ #release: prom # name of the release
+ # ( VERY IMPORTANT: You need to know the correct release name by viewing
+ # the servicemonitor of Prometheus itself: Without the correct name,
+ # Prometheus cannot identify the metrics of the Flask app as the target.)
+spec:
+ selector:
+ matchLabels:
+ # Target app service
+ #namespace: tfs
+ app: dbscanservingservice # same as above
+ #release: prometheus # same as above
+ endpoints:
+ - port: metrics # named port in target app
+ scheme: http
+ path: /metrics # path to scrape
+ interval: 5s # scrape interval
+ namespaceSelector:
+ any: false
+ matchNames:
+ - tfs # namespace where the app is running
+---
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ namespace: monitoring # namespace where prometheus is running
+ name: tfs-opticalattackmitigatorservice-metric
+ labels:
+ app: opticalattackmitigatorservice
+ #release: prometheus
+ #release: prom # name of the release
+ # ( VERY IMPORTANT: You need to know the correct release name by viewing
+ # the servicemonitor of Prometheus itself: Without the correct name,
+ # Prometheus cannot identify the metrics of the Flask app as the target.)
+spec:
+ selector:
+ matchLabels:
+ # Target app service
+ #namespace: tfs
+ app: opticalattackmitigatorservice # same as above
+ #release: prometheus # same as above
+ endpoints:
+ - port: metrics # named port in target app
+ scheme: http
+ path: /metrics # path to scrape
+ interval: 5s # scrape interval
+ namespaceSelector:
+ any: false
+ matchNames:
+ - tfs # namespace where the app is running
+---
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ namespace: monitoring # namespace where prometheus is running
+ name: tfs-opticalattackdetectorservice-metric
+ labels:
+ app: opticalattackdetectorservice
+ #release: prometheus
+ #release: prom # name of the release
+ # ( VERY IMPORTANT: You need to know the correct release name by viewing
+ # the servicemonitor of Prometheus itself: Without the correct name,
+ # Prometheus cannot identify the metrics of the Flask app as the target.)
+spec:
+ selector:
+ matchLabels:
+ # Target app service
+ #namespace: tfs
+ app: opticalattackdetectorservice # same as above
+ #release: prometheus # same as above
+ endpoints:
+ - port: metrics # named port in target app
+ scheme: http
+ path: /metrics # path to scrape
+ interval: 5s # scrape interval
+ namespaceSelector:
+ any: false
+ matchNames:
+ - tfs # namespace where the app is running
+---
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ namespace: monitoring # namespace where prometheus is running
+ name: tfs-opticalattackmanagerservice-metric
+ labels:
+ app: opticalattackmanagerservice
+ #release: prometheus
+ #release: prom # name of the release
+ # ( VERY IMPORTANT: You need to know the correct release name by viewing
+ # the servicemonitor of Prometheus itself: Without the correct name,
+ # Prometheus cannot identify the metrics of the Flask app as the target.)
+spec:
+ selector:
+ matchLabels:
+ # Target app service
+ #namespace: tfs
+ app: opticalattackmanagerservice # same as above
+ #release: prometheus # same as above
+ endpoints:
+ - port: metrics # named port in target app
+ scheme: http
+ path: /metrics # path to scrape
+ interval: 5s # scrape interval
+ namespaceSelector:
+ any: false
+ matchNames:
+ - tfs # namespace where the app is running
\ No newline at end of file
diff --git a/proto/generate_code_python.sh b/proto/generate_code_python.sh
index 5c5db5444d3ef31570019abbcd7eab4f1a305a48..14f403b37a80e4b29c81ffc13c4e327195841d2c 100755
--- a/proto/generate_code_python.sh
+++ b/proto/generate_code_python.sh
@@ -38,5 +38,8 @@ EOF
# Generate Python code
python3 -m grpc_tools.protoc -I=./ --python_out=src/python/ --grpc_python_out=src/python/ *.proto
+# new line added to generate protobuf for the `grpclib` library
+python3 -m grpc_tools.protoc -I=./ --python_out=src/python/asyncio --grpclib_python_out=src/python/asyncio *.proto
+
# Arrange generated code imports to enable imports from arbitrary subpackages
find src/python -type f -iname *.py -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
diff --git a/proto/centralized_attack_detector.proto b/proto/optical_attack_detector.proto
similarity index 62%
rename from proto/centralized_attack_detector.proto
rename to proto/optical_attack_detector.proto
index 7b4fc35f07b079955d4c347ecf3f728abd0292f5..ebe3b5e06163c6e5a3bf7889065d5bb31923dd89 100644
--- a/proto/centralized_attack_detector.proto
+++ b/proto/optical_attack_detector.proto
@@ -14,19 +14,19 @@
// protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3
syntax = "proto3";
-package centralized_attack_detector;
+package optical_attack_detector;
import "context.proto";
import "monitoring.proto";
-service CentralizedAttackDetectorService {
- rpc NotifyServiceUpdate (context.Service ) returns (context.Empty) {}
+service OpticalAttackDetectorService {
- // rpc that triggers the attack detection loop
- rpc DetectAttack (context.Empty ) returns (context.Empty) {}
+ // rpc that executes the detection loop for a particular service
+ rpc DetectAttack (DetectionRequest) returns (context.Empty) {}
- // rpc called by the distributed component to report KPIs
- rpc ReportSummarizedKpi (monitoring.KpiList) returns (context.Empty) {}
+}
- rpc ReportKpi (monitoring.KpiList) returns (context.Empty) {}
+message DetectionRequest {
+ context.ServiceId service_id = 1;
+ monitoring.KpiId kpi_id = 2;
}
diff --git a/proto/optical_centralized_attack_detector.proto b/proto/optical_centralized_attack_detector.proto
deleted file mode 100644
index 98ffeddc81c7533fccfd118075732a3f7799264f..0000000000000000000000000000000000000000
--- a/proto/optical_centralized_attack_detector.proto
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-// protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3
-syntax = "proto3";
-package centralized_attack_detector;
-
-import "context.proto";
-import "monitoring.proto";
-
-service OpticalCentralizedAttackDetectorService {
- rpc NotifyServiceUpdate (context.Service ) returns (context.Empty) {}
-
- // rpc that triggers the attack detection loop
- rpc DetectAttack (context.Empty ) returns (context.Empty) {}
-
- // rpc called by the distributed component to report KPIs
- rpc ReportSummarizedKpi (monitoring.KpiList) returns (context.Empty) {}
-
- rpc ReportKpi (monitoring.KpiList) returns (context.Empty) {}
-}
diff --git a/src/dbscanserving/proto/__init__.py b/proto/src/python/asyncio/__init__.py
similarity index 99%
rename from src/dbscanserving/proto/__init__.py
rename to proto/src/python/asyncio/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/dbscanserving/proto/__init__.py
+++ b/proto/src/python/asyncio/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/common/Constants.py b/src/common/Constants.py
index a8e66f7d42cadc7f5cae4d1f42c2a3a0fad599b2..ed1c1475ad3c69cfb9bd650f0d99f33c6cf0f2bc 100644
--- a/src/common/Constants.py
+++ b/src/common/Constants.py
@@ -36,21 +36,26 @@ INTERDOMAIN_TOPOLOGY_NAME = 'inter' # contains the abstract inter-domain top
# Default service names
class ServiceNameEnum(Enum):
- CONTEXT = 'context'
- DEVICE = 'device'
- SERVICE = 'service'
- SLICE = 'slice'
- AUTOMATION = 'automation'
- POLICY = 'policy'
- MONITORING = 'monitoring'
- DLT = 'dlt'
- COMPUTE = 'compute'
- CYBERSECURITY = 'cybersecurity'
- INTERDOMAIN = 'interdomain'
- L3_AM = 'l3-attackmitigator'
- L3_CAD = 'l3-centralizedattackdetector'
- PATHCOMP = 'pathcomp'
- WEBUI = 'webui'
+ CONTEXT = 'context'
+ DEVICE = 'device'
+ SERVICE = 'service'
+ SLICE = 'slice'
+ AUTOMATION = 'automation'
+ POLICY = 'policy'
+ MONITORING = 'monitoring'
+ DLT = 'dlt'
+ COMPUTE = 'compute'
+ CYBERSECURITY = 'cybersecurity'
+ INTERDOMAIN = 'interdomain'
+ PATHCOMP = 'pathcomp'
+ L3_AM = 'l3-attackmitigator'
+ L3_CAD = 'l3-centralizedattackdetector'
+ WEBUI = 'webui'
+ DBSCANSERVING = 'dbscanserving'
+ OPTICALATTACKMANAGER = 'opticalattackmanager'
+ OPTICALATTACKDETECTOR = 'opticalattackdetector'
+ OPTICALATTACKMITIGATOR = 'opticalattackmitigator'
+ CACHING = 'caching'
# Used for test and debugging only
DLT_GATEWAY = 'dltgateway'
@@ -58,20 +63,23 @@ class ServiceNameEnum(Enum):
# Default gRPC service ports
DEFAULT_SERVICE_GRPC_PORTS = {
- ServiceNameEnum.CONTEXT .value : 1010,
- ServiceNameEnum.DEVICE .value : 2020,
- ServiceNameEnum.SERVICE .value : 3030,
- ServiceNameEnum.SLICE .value : 4040,
- ServiceNameEnum.AUTOMATION .value : 5050,
- ServiceNameEnum.POLICY .value : 6060,
- ServiceNameEnum.MONITORING .value : 7070,
- ServiceNameEnum.DLT .value : 8080,
- ServiceNameEnum.COMPUTE .value : 9090,
- ServiceNameEnum.CYBERSECURITY.value : 10000,
- ServiceNameEnum.L3_CAD .value : 10001,
- ServiceNameEnum.L3_AM .value : 10002,
- ServiceNameEnum.INTERDOMAIN .value : 10010,
- ServiceNameEnum.PATHCOMP .value : 10020,
+ ServiceNameEnum.CONTEXT .value : 1010,
+ ServiceNameEnum.DEVICE .value : 2020,
+ ServiceNameEnum.SERVICE .value : 3030,
+ ServiceNameEnum.SLICE .value : 4040,
+ ServiceNameEnum.AUTOMATION .value : 5050,
+ ServiceNameEnum.POLICY .value : 6060,
+ ServiceNameEnum.MONITORING .value : 7070,
+ ServiceNameEnum.DLT .value : 8080,
+ ServiceNameEnum.COMPUTE .value : 9090,
+ ServiceNameEnum.L3_CAD .value : 10001,
+ ServiceNameEnum.L3_AM .value : 10002,
+ ServiceNameEnum.DBSCANSERVING .value : 10008,
+ ServiceNameEnum.OPTICALATTACKDETECTOR .value : 10006,
+ ServiceNameEnum.OPTICALATTACKMITIGATOR .value : 10007,
+ ServiceNameEnum.OPTICALATTACKMANAGER .value : 10005,
+ ServiceNameEnum.INTERDOMAIN .value : 10010,
+ ServiceNameEnum.PATHCOMP .value : 10020,
# Used for test and debugging only
ServiceNameEnum.DLT_GATEWAY .value : 50051,
diff --git a/src/dbscanserving/.gitlab-ci.yml b/src/dbscanserving/.gitlab-ci.yml
index 0acb3e0a7ffb339e800092020fcb2616b3044b15..5d5204cdd26d56aa8e47f056c8f3b84db1a1ceb3 100644
--- a/src/dbscanserving/.gitlab-ci.yml
+++ b/src/dbscanserving/.gitlab-ci.yml
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# build, tag and push the Docker image to the gitlab registry
+# Build, tag, and push the Docker image to the GitLab Docker registry
build dbscanserving:
variables:
IMAGE_NAME: 'dbscanserving' # name of the microservice
@@ -21,24 +21,23 @@ build dbscanserving:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/
+ - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
after_script:
- docker images --filter="dangling=true" --quiet | xargs -r docker rmi
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- changes:
- src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py
- - src/$IMAGE_NAME/tests/Dockerfile
- manifests/${IMAGE_NAME}service.yaml
- .gitlab-ci.yml
-# apply unit test to the dbscanserving component
-unit test dbscanserving:
+# Apply unit test to the component
+unit_test dbscanserving:
variables:
IMAGE_NAME: 'dbscanserving' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
@@ -48,14 +47,17 @@ unit test dbscanserving:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi
- - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi
+ - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME container is not in the system"; fi
script:
- docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- - docker run --name $IMAGE_NAME -d -p 10006:10006 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
+ - docker run --name $IMAGE_NAME -d -p 10008:10008 -v "$PWD/src/$IMAGE_NAME/tests:/home/${IMAGE_NAME}/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
- sleep 5
- docker ps -a
- docker logs $IMAGE_NAME
- - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml"
+ - docker exec ps -a
+ - sleep 5
+ - docker logs $IMAGE_NAME
+ - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/home/${IMAGE_NAME}/results/${IMAGE_NAME}_report.xml"
- docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing"
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
after_script:
@@ -78,27 +80,27 @@ unit test dbscanserving:
# Deployment of the dbscanserving service in Kubernetes Cluster
-deploy dbscanserving:
- variables:
- IMAGE_NAME: 'dbscanserving' # name of the microservice
- IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
- stage: deploy
- needs:
- - unit test dbscanserving
- # - integ_test execute
- script:
- - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
- - kubectl version
- - kubectl get all
- - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
- - kubectl get all
- # environment:
- # name: test
- # url: https://example.com
- # kubernetes:
- # namespace: test
- rules:
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- when: manual
- - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- when: manual
\ No newline at end of file
+# deploy dbscanserving:
+# variables:
+# IMAGE_NAME: 'dbscanserving' # name of the microservice
+# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
+# stage: deploy
+# needs:
+# - unit test dbscanserving
+# # - integ_test execute
+# script:
+# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
+# - kubectl version
+# - kubectl get all
+# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
+# - kubectl get all
+# # environment:
+# # name: test
+# # url: https://example.com
+# # kubernetes:
+# # namespace: test
+# rules:
+# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
+# when: manual
+# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+# when: manual
\ No newline at end of file
diff --git a/src/dbscanserving/Config.py b/src/dbscanserving/Config.py
index e7f7904b0b12cb58cf82d97d2247e57ed339b247..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/dbscanserving/Config.py
+++ b/src/dbscanserving/Config.py
@@ -11,16 +11,3 @@
# 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.
-
-import logging
-
-# General settings
-LOG_LEVEL = logging.DEBUG
-
-# gRPC settings
-GRPC_SERVICE_PORT = 10006
-GRPC_MAX_WORKERS = 10
-GRPC_GRACE_PERIOD = 60
-
-# Prometheus settings
-METRICS_PORT = 9192
diff --git a/src/dbscanserving/Dockerfile b/src/dbscanserving/Dockerfile
index 8328ff4d5ecf8dd373bb5b5e4534c941d6307146..5bbf0d215d7eb87f391f8115efe0c92e519dbf46 100644
--- a/src/dbscanserving/Dockerfile
+++ b/src/dbscanserving/Dockerfile
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM python:3-slim
+FROM python:3.9-slim
# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
@@ -27,22 +27,55 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
+# Creating a user for security reasons
+RUN groupadd -r teraflow && useradd -u 1001 --no-log-init -r -m -g teraflow teraflow
+USER teraflow
+
+RUN mkdir -p /home/teraflow/controller/common
+
+# set working directory
+WORKDIR /home/teraflow/controller
+
+# Get Python packages per module
+ENV VIRTUAL_ENV=/home/teraflow/venv
+RUN python3 -m venv ${VIRTUAL_ENV}
+ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
+
# Get generic Python packages
-RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools
+RUN python3 -m pip install --upgrade pip
+RUN python3 -m pip install --upgrade setuptools wheel
+RUN python3 -m pip install --upgrade pip-tools
+
+# Get common Python packages
+# Note: this step enables sharing the previous Docker build steps among all the Python components
+COPY --chown=teraflow:teraflow common_requirements.in common_requirements.in
+RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
+RUN python3 -m pip install -r common_requirements.txt
+
+# Add common files into working directory
+WORKDIR /home/teraflow/controller/common
+COPY --chown=teraflow:teraflow src/common/. ./
+RUN rm -rf proto
-# Set working directory
-WORKDIR /var/teraflow
+# Create proto sub-folder, copy .proto files, and generate Python code
+WORKDIR /home/teraflow/controller/common/proto
+COPY --chown=teraflow:teraflow proto/*.proto ./
+RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
+RUN rm *.proto
+RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
# Create module sub-folders
-RUN mkdir -p /var/teraflow/dbscanserving
+RUN mkdir -p /home/teraflow/controller/dbscanserving
+WORKDIR /home/teraflow/controller
# Get Python packages per module
-COPY dbscanserving/requirements.in dbscanserving/requirements.in
-RUN pip-compile --output-file=dbscanserving/requirements.txt dbscanserving/requirements.in
+COPY --chown=teraflow:teraflow ./src/dbscanserving/requirements.in dbscanserving/requirements.in
+# consider common and specific requirements to avoid inconsistencies with dependencies
+RUN pip-compile --quiet --output-file=dbscanserving/requirements.txt dbscanserving/requirements.in common_requirements.in
RUN python3 -m pip install -r dbscanserving/requirements.txt
-COPY common/. common
-COPY dbscanserving/. dbscanserving
+# Add component files into working directory
+COPY --chown=teraflow:teraflow ./src/dbscanserving/. dbscanserving
# Start dbscanserving service
ENTRYPOINT ["python", "-m", "dbscanserving.service"]
diff --git a/src/dbscanserving/__init__.py b/src/dbscanserving/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/dbscanserving/__init__.py
+++ b/src/dbscanserving/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/dbscanserving/client/DbscanServingClient.py b/src/dbscanserving/client/DbscanServingClient.py
index ce259d0f25dc2515ed49537f5527443cb552c7c1..d8a74948d8c68b1ffabb1fc12c7d04a4817b90e0 100644
--- a/src/dbscanserving/client/DbscanServingClient.py
+++ b/src/dbscanserving/client/DbscanServingClient.py
@@ -12,37 +12,62 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import grpc, logging
-from common.tools.client.RetryDecorator import retry, delay_exponential
-from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse
-from dbscanserving.proto.dbscanserving_pb2_grpc import DetectorStub
+import logging
+from typing import Counter
+
+import grpc
+
+from common.Constants import ServiceNameEnum
+from common.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse
+from common.proto.dbscanserving_pb2_grpc import DetectorStub
+from common.Settings import get_service_host, get_service_port_grpc
+from common.tools.client.RetryDecorator import delay_exponential, retry
LOGGER = logging.getLogger(__name__)
MAX_RETRIES = 15
DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0)
-RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect')
+RETRY_DECORATOR = retry(
+ max_retries=MAX_RETRIES,
+ delay_function=DELAY_FUNCTION,
+ prepare_method_name="connect",
+)
+
class DbscanServingClient:
- def __init__(self, address, port):
- self.endpoint = '{:s}:{:s}'.format(str(address), str(port))
- LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint)))
+ def __init__(self, host=None, port=None):
+ if not host:
+ host = get_service_host(ServiceNameEnum.DBSCANSERVING)
+ if not port:
+ port = get_service_port_grpc(ServiceNameEnum.DBSCANSERVING)
+
+ self.endpoint = "{:s}:{:s}".format(str(host), str(port))
+ LOGGER.debug("Creating channel to {:s}...".format(str(self.endpoint)))
self.channel = None
self.stub = None
self.connect()
- LOGGER.debug('Channel created')
+ LOGGER.debug("Channel created")
def connect(self):
self.channel = grpc.insecure_channel(self.endpoint)
self.stub = DetectorStub(self.channel)
def close(self):
- if(self.channel is not None): self.channel.close()
+ if self.channel is not None:
+ self.channel.close()
self.channel = None
self.stub = None
@RETRY_DECORATOR
- def Detect(self, request : DetectionRequest) -> DetectionResponse:
- LOGGER.debug('Detect request: {:s}'.format(str(request)))
- response = self.stub.Detect(request)
- LOGGER.debug('Detect result: {:s}'.format(str(response)))
+ def Detect(self, request: DetectionRequest) -> DetectionResponse:
+ LOGGER.debug(
+ "Detect request with {} samples and {} features".format(
+ request.num_samples, request.num_features
+ )
+ )
+ response: DetectionResponse = self.stub.Detect(request)
+ LOGGER.debug(
+ "Detect result with {} cluster indices [{}]".format(
+ len(response.cluster_indices), Counter(response.cluster_indices)
+ )
+ )
return response
diff --git a/src/dbscanserving/client/__init__.py b/src/dbscanserving/client/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/dbscanserving/client/__init__.py
+++ b/src/dbscanserving/client/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/dbscanserving/genproto.sh b/src/dbscanserving/genproto.sh
deleted file mode 100755
index 449cffdebc5207dc17868b428504475bfab606d6..0000000000000000000000000000000000000000
--- a/src/dbscanserving/genproto.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash -eu
-#
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-# Make folder containing the script the root folder for its execution
-cd $(dirname $0)
-
-rm -rf proto/*.py
-rm -rf proto/__pycache__
-tee proto/__init__.py << EOF > /dev/null
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-EOF
-
-# building current service protos
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto dbscanserving.proto
-
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/dbscanserving_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/dbscanserving_pb2_grpc.py
diff --git a/src/dbscanserving/proto/dbscanserving_pb2.py b/src/dbscanserving/proto/dbscanserving_pb2.py
deleted file mode 100644
index f2d6c37c7c567394d3b12392a1fa4e0f748f6625..0000000000000000000000000000000000000000
--- a/src/dbscanserving/proto/dbscanserving_pb2.py
+++ /dev/null
@@ -1,244 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: dbscanserving.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='dbscanserving.proto',
- package='dbscanserving',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x13\x64\x62scanserving.proto\x12\rdbscanserving\"\x1a\n\x06Sample\x12\x10\n\x08\x66\x65\x61tures\x18\x01 \x03(\x02\"\xc2\x01\n\x10\x44\x65tectionRequest\x12\x0b\n\x03\x65ps\x18\x01 \x01(\x02\x12\x13\n\x0bmin_samples\x18\x02 \x01(\x05\x12%\n\x06metric\x18\x03 \x01(\x0e\x32\x15.dbscanserving.Metric\x12\x13\n\x0bnum_samples\x18\x04 \x01(\x05\x12\x14\n\x0cnum_features\x18\x05 \x01(\x05\x12&\n\x07samples\x18\x06 \x03(\x0b\x32\x15.dbscanserving.Sample\x12\x12\n\nidentifier\x18\x07 \x01(\x05\",\n\x11\x44\x65tectionResponse\x12\x17\n\x0f\x63luster_indices\x18\x01 \x03(\x05*\x17\n\x06Metric\x12\r\n\tEUCLIDEAN\x10\x00\x32W\n\x08\x44\x65tector\x12K\n\x06\x44\x65tect\x12\x1f.dbscanserving.DetectionRequest\x1a .dbscanserving.DetectionResponseb\x06proto3'
-)
-
-_METRIC = _descriptor.EnumDescriptor(
- name='Metric',
- full_name='dbscanserving.Metric',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='EUCLIDEAN', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=309,
- serialized_end=332,
-)
-_sym_db.RegisterEnumDescriptor(_METRIC)
-
-Metric = enum_type_wrapper.EnumTypeWrapper(_METRIC)
-EUCLIDEAN = 0
-
-
-
-_SAMPLE = _descriptor.Descriptor(
- name='Sample',
- full_name='dbscanserving.Sample',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='features', full_name='dbscanserving.Sample.features', index=0,
- number=1, type=2, cpp_type=6, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=38,
- serialized_end=64,
-)
-
-
-_DETECTIONREQUEST = _descriptor.Descriptor(
- name='DetectionRequest',
- full_name='dbscanserving.DetectionRequest',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='eps', full_name='dbscanserving.DetectionRequest.eps', index=0,
- number=1, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='min_samples', full_name='dbscanserving.DetectionRequest.min_samples', index=1,
- number=2, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='metric', full_name='dbscanserving.DetectionRequest.metric', index=2,
- number=3, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='num_samples', full_name='dbscanserving.DetectionRequest.num_samples', index=3,
- number=4, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='num_features', full_name='dbscanserving.DetectionRequest.num_features', index=4,
- number=5, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='samples', full_name='dbscanserving.DetectionRequest.samples', index=5,
- number=6, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='identifier', full_name='dbscanserving.DetectionRequest.identifier', index=6,
- number=7, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=67,
- serialized_end=261,
-)
-
-
-_DETECTIONRESPONSE = _descriptor.Descriptor(
- name='DetectionResponse',
- full_name='dbscanserving.DetectionResponse',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='cluster_indices', full_name='dbscanserving.DetectionResponse.cluster_indices', index=0,
- number=1, type=5, cpp_type=1, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=263,
- serialized_end=307,
-)
-
-_DETECTIONREQUEST.fields_by_name['metric'].enum_type = _METRIC
-_DETECTIONREQUEST.fields_by_name['samples'].message_type = _SAMPLE
-DESCRIPTOR.message_types_by_name['Sample'] = _SAMPLE
-DESCRIPTOR.message_types_by_name['DetectionRequest'] = _DETECTIONREQUEST
-DESCRIPTOR.message_types_by_name['DetectionResponse'] = _DETECTIONRESPONSE
-DESCRIPTOR.enum_types_by_name['Metric'] = _METRIC
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-Sample = _reflection.GeneratedProtocolMessageType('Sample', (_message.Message,), {
- 'DESCRIPTOR' : _SAMPLE,
- '__module__' : 'dbscanserving_pb2'
- # @@protoc_insertion_point(class_scope:dbscanserving.Sample)
- })
-_sym_db.RegisterMessage(Sample)
-
-DetectionRequest = _reflection.GeneratedProtocolMessageType('DetectionRequest', (_message.Message,), {
- 'DESCRIPTOR' : _DETECTIONREQUEST,
- '__module__' : 'dbscanserving_pb2'
- # @@protoc_insertion_point(class_scope:dbscanserving.DetectionRequest)
- })
-_sym_db.RegisterMessage(DetectionRequest)
-
-DetectionResponse = _reflection.GeneratedProtocolMessageType('DetectionResponse', (_message.Message,), {
- 'DESCRIPTOR' : _DETECTIONRESPONSE,
- '__module__' : 'dbscanserving_pb2'
- # @@protoc_insertion_point(class_scope:dbscanserving.DetectionResponse)
- })
-_sym_db.RegisterMessage(DetectionResponse)
-
-
-
-_DETECTOR = _descriptor.ServiceDescriptor(
- name='Detector',
- full_name='dbscanserving.Detector',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=334,
- serialized_end=421,
- methods=[
- _descriptor.MethodDescriptor(
- name='Detect',
- full_name='dbscanserving.Detector.Detect',
- index=0,
- containing_service=None,
- input_type=_DETECTIONREQUEST,
- output_type=_DETECTIONRESPONSE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_DETECTOR)
-
-DESCRIPTOR.services_by_name['Detector'] = _DETECTOR
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/dbscanserving/proto/dbscanserving_pb2_grpc.py b/src/dbscanserving/proto/dbscanserving_pb2_grpc.py
deleted file mode 100644
index 895ced1484df2101bb055f28b6a6d3631e7e68da..0000000000000000000000000000000000000000
--- a/src/dbscanserving/proto/dbscanserving_pb2_grpc.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
-"""Client and server classes corresponding to protobuf-defined services."""
-import grpc
-
-from . import dbscanserving_pb2 as dbscanserving__pb2
-
-
-class DetectorStub(object):
- """Missing associated documentation comment in .proto file."""
-
- def __init__(self, channel):
- """Constructor.
-
- Args:
- channel: A grpc.Channel.
- """
- self.Detect = channel.unary_unary(
- '/dbscanserving.Detector/Detect',
- request_serializer=dbscanserving__pb2.DetectionRequest.SerializeToString,
- response_deserializer=dbscanserving__pb2.DetectionResponse.FromString,
- )
-
-
-class DetectorServicer(object):
- """Missing associated documentation comment in .proto file."""
-
- def Detect(self, request, context):
- """Missing associated documentation comment in .proto file."""
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
-
-def add_DetectorServicer_to_server(servicer, server):
- rpc_method_handlers = {
- 'Detect': grpc.unary_unary_rpc_method_handler(
- servicer.Detect,
- request_deserializer=dbscanserving__pb2.DetectionRequest.FromString,
- response_serializer=dbscanserving__pb2.DetectionResponse.SerializeToString,
- ),
- }
- generic_handler = grpc.method_handlers_generic_handler(
- 'dbscanserving.Detector', rpc_method_handlers)
- server.add_generic_rpc_handlers((generic_handler,))
-
-
- # This class is part of an EXPERIMENTAL API.
-class Detector(object):
- """Missing associated documentation comment in .proto file."""
-
- @staticmethod
- def Detect(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/dbscanserving.Detector/Detect',
- dbscanserving__pb2.DetectionRequest.SerializeToString,
- dbscanserving__pb2.DetectionResponse.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/src/dbscanserving/requirements.in b/src/dbscanserving/requirements.in
index 4499fc694c408b17bba4278a509e23ff6e8cf101..83af2a77d2b7dc65f40695f49f6caddb15b1991c 100644
--- a/src/dbscanserving/requirements.in
+++ b/src/dbscanserving/requirements.in
@@ -12,11 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-grpcio-health-checking
-prometheus-client
-pytest
-pytest-benchmark
-grpcio
scikit-learn
-coverage
\ No newline at end of file
diff --git a/src/dbscanserving/requirements.txt b/src/dbscanserving/requirements.txt
deleted file mode 100644
index 067cdbc2620fabe5805f26055690212a0648d5d8..0000000000000000000000000000000000000000
--- a/src/dbscanserving/requirements.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-
-#
-# This file is autogenerated by pip-compile with python 3.9
-# To update, run:
-#
-# pip-compile --output-file=requirements.txt requirements.in
-#
-attrs==21.2.0
- # via pytest
-grpcio==1.42.0
- # via
- # -r requirements.in
- # grpcio-health-checking
-grpcio-health-checking==1.42.0
- # via -r requirements.in
-iniconfig==1.1.1
- # via pytest
-joblib==1.1.0
- # via scikit-learn
-numpy==1.21.4
- # via
- # scikit-learn
- # scipy
-packaging==21.3
- # via pytest
-pluggy==1.0.0
- # via pytest
-prometheus-client==0.12.0
- # via -r requirements.in
-protobuf==3.19.1
- # via grpcio-health-checking
-py==1.11.0
- # via pytest
-py-cpuinfo==8.0.0
- # via pytest-benchmark
-pyparsing==3.0.6
- # via packaging
-pytest==6.2.5
- # via
- # -r requirements.in
- # pytest-benchmark
-pytest-benchmark==3.4.1
- # via -r requirements.in
-scikit-learn==1.0.1
- # via -r requirements.in
-scipy==1.7.3
- # via scikit-learn
-six==1.16.0
- # via grpcio
-threadpoolctl==3.0.0
- # via scikit-learn
-toml==0.10.2
- # via pytest
diff --git a/src/dbscanserving/service/DbscanService.py b/src/dbscanserving/service/DbscanService.py
index 632e4056050bfc44da069d7b706eb7b70a16bb34..834baa8c224cbb695f91941a02d57d5a591feb07 100644
--- a/src/dbscanserving/service/DbscanService.py
+++ b/src/dbscanserving/service/DbscanService.py
@@ -12,59 +12,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import grpc
import logging
-from concurrent import futures
-from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH
-from grpc_health.v1.health_pb2 import HealthCheckResponse
-from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server
-from dbscanserving.proto.dbscanserving_pb2_grpc import add_DetectorServicer_to_server
-from dbscanserving.service.DbscanServiceServicerImpl import DbscanServiceServicerImpl
-from dbscanserving.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD
-BIND_ADDRESS = '0.0.0.0'
-LOGGER = logging.getLogger(__name__)
+from common.Constants import ServiceNameEnum
+from common.proto.dbscanserving_pb2_grpc import add_DetectorServicer_to_server
+from common.Settings import get_service_port_grpc
+from common.tools.service.GenericGrpcService import GenericGrpcService
-class DbscanService:
- def __init__(
- self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS,
- grace_period=GRPC_GRACE_PERIOD):
+from dbscanserving.service.DbscanServiceServicerImpl import \
+ DbscanServiceServicerImpl
- self.address = address
- self.port = port
- self.endpoint = None
- self.max_workers = max_workers
- self.grace_period = grace_period
- self.dbscan_servicer = None
- self.health_servicer = None
- self.pool = None
- self.server = None
+LOGGER = logging.getLogger(__name__)
- def start(self):
- self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port))
- LOGGER.debug('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format(
- str(self.endpoint), str(self.max_workers)))
- self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers)
- self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,))
+class DbscanService(GenericGrpcService):
+ def __init__(self, cls_name: str = __name__):
+ port = get_service_port_grpc(ServiceNameEnum.DBSCANSERVING)
+ super().__init__(port, cls_name=cls_name)
self.dbscan_servicer = DbscanServiceServicerImpl()
- add_DetectorServicer_to_server(self.dbscan_servicer, self.server)
-
- self.health_servicer = HealthServicer(
- experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1))
- add_HealthServicer_to_server(self.health_servicer, self.server)
- port = self.server.add_insecure_port(self.endpoint)
- self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port))
- LOGGER.info('Listening on {:s}...'.format(self.endpoint))
- self.server.start()
- self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member
-
- LOGGER.debug('Service started')
-
- def stop(self):
- LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period)))
- self.health_servicer.enter_graceful_shutdown()
- self.server.stop(self.grace_period)
- LOGGER.debug('Service stopped')
+ def install_servicers(self):
+ add_DetectorServicer_to_server(self.dbscan_servicer, self.server)
diff --git a/src/dbscanserving/service/DbscanServiceServicerImpl.py b/src/dbscanserving/service/DbscanServiceServicerImpl.py
index e71aac7b4c5899f9f5a01c5427666e8e34944b99..ac4f4c90b51f31de36c6c3b05cf5064840786018 100644
--- a/src/dbscanserving/service/DbscanServiceServicerImpl.py
+++ b/src/dbscanserving/service/DbscanServiceServicerImpl.py
@@ -12,32 +12,43 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import os, grpc, logging
+import logging
+
+import grpc
from sklearn.cluster import DBSCAN
-from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method
-from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse
-from dbscanserving.proto.dbscanserving_pb2_grpc import DetectorServicer
+
+from common.method_wrappers.Decorator import (MetricsPool,
+ safe_and_metered_rpc_method)
+from common.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse
+from common.proto.dbscanserving_pb2_grpc import DetectorServicer
LOGGER = logging.getLogger(__name__)
-METRICS_POOL = MetricsPool('DbscanServing', 'RPC')
+METRICS_POOL = MetricsPool("DBSCANServing", "RPC")
class DbscanServiceServicerImpl(DetectorServicer):
-
def __init__(self):
- LOGGER.debug('Creating Servicer...')
- LOGGER.debug('Servicer Created')
+ LOGGER.debug("Creating Servicer...")
+ LOGGER.debug("Servicer Created")
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
- def Detect(self, request : DetectionRequest, context : grpc.ServicerContext) -> DetectionResponse:
+ def Detect(
+ self, request: DetectionRequest, context: grpc.ServicerContext
+ ) -> DetectionResponse:
if request.num_samples != len(request.samples):
- context.set_details("The sample dimension declared does not match with the number of samples received.")
- LOGGER.debug(f"The sample dimension declared does not match with the number of samples received. Declared: {request.num_samples} - Received: {len(request.samples)}")
+ context.set_details(
+ f"The sample dimension declared ({request.num_samples}) does not match with the number of samples received ({len(request.samples)})."
+ )
+ LOGGER.debug(
+ f"The sample dimension declared does not match with the number of samples received. Declared: {request.num_samples} - Received: {len(request.samples)}"
+ )
context.set_code(grpc.StatusCode.INVALID_ARGUMENT)
return DetectionResponse()
# TODO: implement the validation of the features dimension
- clusters = DBSCAN(eps=request.eps, min_samples=request.min_samples).fit_predict([[x for x in sample.features] for sample in request.samples])
+ clusters = DBSCAN(eps=request.eps, min_samples=request.min_samples).fit_predict(
+ [[x for x in sample.features] for sample in request.samples]
+ )
response = DetectionResponse()
for cluster in clusters:
response.cluster_indices.append(cluster)
diff --git a/src/dbscanserving/service/__init__.py b/src/dbscanserving/service/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/dbscanserving/service/__init__.py
+++ b/src/dbscanserving/service/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/dbscanserving/service/__main__.py b/src/dbscanserving/service/__main__.py
index 391229969bb719760897c706e280cfa4566ba7f9..fc0f8346e01b7ec30c4404990148915981ba1cd7 100644
--- a/src/dbscanserving/service/__main__.py
+++ b/src/dbscanserving/service/__main__.py
@@ -12,53 +12,55 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import os, logging, signal, sys, time, threading, multiprocessing
+import logging
+import signal
+import sys
+import threading
+
+from common.Settings import get_log_level, get_metrics_port
from prometheus_client import start_http_server
-from common.Settings import get_setting
-from dbscanserving.Config import (
- GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT)
+
from dbscanserving.service.DbscanService import DbscanService
terminate = threading.Event()
LOGGER = None
-def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
- LOGGER.warning('Terminate signal received')
+
+def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
+ LOGGER.warning("Terminate signal received")
terminate.set()
-def main():
- global LOGGER # pylint: disable=global-statement
- service_port = get_setting('DBSCANSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT)
- max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS )
- grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD)
- log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL )
- metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT )
+def main():
+ global LOGGER # pylint: disable=global-statement
+ log_level = get_log_level()
logging.basicConfig(level=log_level)
LOGGER = logging.getLogger(__name__)
- signal.signal(signal.SIGINT, signal_handler)
+ signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
- LOGGER.info('Starting...')
+ LOGGER.info("Starting...")
# Start metrics server
+ metrics_port = get_metrics_port()
start_http_server(metrics_port)
# Starting CentralizedCybersecurity service
- grpc_service = DbscanService(
- port=service_port, max_workers=max_workers, grace_period=grace_period)
+ grpc_service = DbscanService()
grpc_service.start()
# Wait for Ctrl+C or termination signal
- while not terminate.wait(timeout=0.1): pass
+ while not terminate.wait(timeout=1):
+ pass
- LOGGER.info('Terminating...')
+ LOGGER.info("Terminating...")
grpc_service.stop()
- LOGGER.info('Bye')
+ LOGGER.info("Bye")
return 0
-if __name__ == '__main__':
+
+if __name__ == "__main__":
sys.exit(main())
diff --git a/src/dbscanserving/tests/__init__.py b/src/dbscanserving/tests/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/dbscanserving/tests/__init__.py
+++ b/src/dbscanserving/tests/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/dbscanserving/tests/test_unitary.py b/src/dbscanserving/tests/test_unitary.py
index b23a1a726634465a418b3b3eeb4bc9f0ac6d3f87..7349978e51cf5be8aa2f9899a91de91e13d1ae7e 100644
--- a/src/dbscanserving/tests/test_unitary.py
+++ b/src/dbscanserving/tests/test_unitary.py
@@ -12,32 +12,52 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import random, logging, pytest, numpy
-from dbscanserving.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD
+import logging
+import os
+import random
+from unittest.mock import patch
+
+import pytest
+
+from common.proto.dbscanserving_pb2 import (DetectionRequest,
+ DetectionResponse, Sample)
+
from dbscanserving.client.DbscanServingClient import DbscanServingClient
+from dbscanserving.Config import GRPC_SERVICE_PORT
from dbscanserving.service.DbscanService import DbscanService
-from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse, Sample
-port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
+port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
-@pytest.fixture(scope='session')
+
+@pytest.fixture(scope="session")
def dbscanserving_service():
- _service = DbscanService(
- port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD)
+ _service = DbscanService(port=port)
_service.start()
yield _service
_service.stop()
-@pytest.fixture(scope='session')
+
+@pytest.fixture(scope="session")
def dbscanserving_client():
- _client = DbscanServingClient(address='127.0.0.1', port=port)
- yield _client
+ with patch.dict(
+ os.environ,
+ {
+ "DBSCANSERVINGSERVICE_SERVICE_HOST": "127.0.0.1",
+ "DBSCANSERVINGSERVICE_SERVICE_PORT_GRPC": str(port),
+ },
+ clear=True,
+ ):
+ _client = DbscanServingClient()
+ yield _client
_client.close()
-def test_detection_correct(dbscanserving_service, dbscanserving_client: DbscanServingClient):
+
+def test_detection_correct(
+ dbscanserving_service, dbscanserving_client: DbscanServingClient
+):
request: DetectionRequest = DetectionRequest()
request.num_samples = 310
@@ -48,25 +68,28 @@ def test_detection_correct(dbscanserving_service, dbscanserving_client: DbscanSe
for _ in range(200):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(0., 10.))
+ grpc_sample.features.append(random.uniform(0.0, 10.0))
request.samples.append(grpc_sample)
-
+
for _ in range(100):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(50., 60.))
+ grpc_sample.features.append(random.uniform(50.0, 60.0))
request.samples.append(grpc_sample)
-
+
for _ in range(10):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(5000., 6000.))
+ grpc_sample.features.append(random.uniform(5000.0, 6000.0))
request.samples.append(grpc_sample)
response: DetectionResponse = dbscanserving_client.Detect(request)
assert len(response.cluster_indices) == 310
-def test_detection_incorrect(dbscanserving_service, dbscanserving_client: DbscanServingClient):
+
+def test_detection_incorrect(
+ dbscanserving_service, dbscanserving_client: DbscanServingClient
+):
request: DetectionRequest = DetectionRequest()
request.num_samples = 210
@@ -77,25 +100,28 @@ def test_detection_incorrect(dbscanserving_service, dbscanserving_client: Dbscan
for _ in range(200):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(0., 10.))
+ grpc_sample.features.append(random.uniform(0.0, 10.0))
request.samples.append(grpc_sample)
-
+
for _ in range(100):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(50., 60.))
+ grpc_sample.features.append(random.uniform(50.0, 60.0))
request.samples.append(grpc_sample)
-
+
for _ in range(10):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(5000., 6000.))
+ grpc_sample.features.append(random.uniform(5000.0, 6000.0))
request.samples.append(grpc_sample)
with pytest.raises(Exception):
- response: DetectionResponse = dbscanserving_client.Detect(request)
+ _: DetectionResponse = dbscanserving_client.Detect(request)
-def test_detection_clusters(dbscanserving_service, dbscanserving_client: DbscanServingClient):
+
+def test_detection_clusters(
+ dbscanserving_service, dbscanserving_client: DbscanServingClient
+):
request: DetectionRequest = DetectionRequest()
request.num_samples = 310
@@ -106,19 +132,19 @@ def test_detection_clusters(dbscanserving_service, dbscanserving_client: DbscanS
for _ in range(200):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(0., 10.))
+ grpc_sample.features.append(random.uniform(0.0, 10.0))
request.samples.append(grpc_sample)
-
+
for _ in range(100):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(50., 60.))
+ grpc_sample.features.append(random.uniform(50.0, 60.0))
request.samples.append(grpc_sample)
-
+
for _ in range(10):
grpc_sample = Sample()
for __ in range(100):
- grpc_sample.features.append(random.uniform(5000., 6000.))
+ grpc_sample.features.append(random.uniform(5000.0, 6000.0))
request.samples.append(grpc_sample)
response: DetectionResponse = dbscanserving_client.Detect(request)
diff --git a/src/opticalattackdetector/.gitlab-ci.yml b/src/opticalattackdetector/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b06725852a573a41b0cf97dd0bdfa527847fe6fc
--- /dev/null
+++ b/src/opticalattackdetector/.gitlab-ci.yml
@@ -0,0 +1,103 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+# build, tag and push the Docker image to the gitlab registry
+build opticalattackdetector:
+ variables:
+ IMAGE_NAME: 'opticalattackdetector' # name of the microservice
+ IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
+ stage: build
+ before_script:
+ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
+ script:
+ - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
+ - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
+ - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
+ after_script:
+ - docker images --filter="dangling=true" --quiet | xargs -r docker rmi
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+ - changes:
+ - src/$IMAGE_NAME/**/*.{py,in,yml}
+ - src/$IMAGE_NAME/Dockerfile
+ - src/$IMAGE_NAME/tests/*.py
+ - src/$IMAGE_NAME/tests/Dockerfile
+ - manifests/${IMAGE_NAME}service.yaml
+ - .gitlab-ci.yml
+
+# apply unit test to the opticalattackdetector component
+unit_test opticalattackdetector:
+ variables:
+ IMAGE_NAME: 'opticalattackdetector' # name of the microservice
+ IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
+ stage: unit_test
+ needs:
+ - build opticalattackdetector
+ before_script:
+ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
+ - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi
+ - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi
+ script:
+ - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
+ - docker run --name $IMAGE_NAME -d -p 10006:10006 --env-file "$PWD/src/$IMAGE_NAME/.env" -v "$PWD/src/$IMAGE_NAME/tests:/home/${IMAGE_NAME}/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
+ - sleep 5
+ - docker ps -a
+ - docker logs $IMAGE_NAME
+ - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/home/${IMAGE_NAME}/results/${IMAGE_NAME}_report.xml; coverage xml -o /home/${IMAGE_NAME}/results/${IMAGE_NAME}_coverage.xml; coverage report --include='${IMAGE_NAME}/*' --show-missing"
+ coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
+ after_script:
+ - docker rm -f $IMAGE_NAME
+ - docker network rm teraflowbridge
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+ - changes:
+ - src/$IMAGE_NAME/**/*.{py,in,yml}
+ - src/$IMAGE_NAME/Dockerfile
+ - src/$IMAGE_NAME/tests/*.py
+ - src/$IMAGE_NAME/tests/Dockerfile
+ - manifests/${IMAGE_NAME}service.yaml
+ - .gitlab-ci.yml
+ artifacts:
+ when: always
+ reports:
+ junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml
+
+
+# Deployment of the opticalattackdetector service in Kubernetes Cluster
+# deploy opticalattackdetector:
+# variables:
+# IMAGE_NAME: 'opticalattackdetector' # name of the microservice
+# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
+# stage: deploy
+# needs:
+# - unit test opticalattackdetector
+# # - integ_test execute
+# script:
+# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
+# - kubectl version
+# - kubectl get all
+# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
+# - kubectl get all
+# # environment:
+# # name: test
+# # url: https://example.com
+# # kubernetes:
+# # namespace: test
+# rules:
+# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
+# when: manual
+# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+# when: manual
\ No newline at end of file
diff --git a/src/opticalattackdetector/Config.py b/src/opticalattackdetector/Config.py
new file mode 100644
index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf
--- /dev/null
+++ b/src/opticalattackdetector/Config.py
@@ -0,0 +1,13 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
diff --git a/src/opticalattackdetector/Dockerfile b/src/opticalattackdetector/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..6607a22b72a311bad90197d430980d3977e8531f
--- /dev/null
+++ b/src/opticalattackdetector/Dockerfile
@@ -0,0 +1,86 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+FROM python:3.9-slim
+
+# Install dependencies
+RUN apt-get --yes --quiet --quiet update && \
+ apt-get --yes --quiet --quiet install wget g++ && \
+ rm -rf /var/lib/apt/lists/*
+
+# Set Python to show logs as they occur
+ENV PYTHONUNBUFFERED=0
+ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
+
+# Download the gRPC health probe
+RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
+ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
+ chmod +x /bin/grpc_health_probe
+
+# Creating a user for security reasons
+RUN groupadd -r teraflow && useradd -u 1001 --no-log-init -r -m -g teraflow teraflow
+USER teraflow
+
+# set working directory
+RUN mkdir -p /home/teraflow/controller/common/
+WORKDIR /home/teraflow/controller
+
+# Get Python packages per module
+ENV VIRTUAL_ENV=/home/teraflow/venv
+RUN python3 -m venv ${VIRTUAL_ENV}
+ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
+
+# Get generic Python packages
+RUN python3 -m pip install --upgrade pip
+RUN python3 -m pip install --upgrade setuptools wheel
+RUN python3 -m pip install --upgrade pip-tools
+
+# Get common Python packages
+# Note: this step enables sharing the previous Docker build steps among all the Python components
+COPY --chown=teraflow:teraflow common_requirements.in common_requirements.in
+RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
+RUN python3 -m pip install -r common_requirements.txt
+
+# Add common files into working directory
+WORKDIR /home/teraflow/controller/common
+COPY --chown=teraflow:teraflow src/common/. ./
+
+# Create proto sub-folder, copy .proto files, and generate Python code
+WORKDIR /home/teraflow/controller/common/proto
+RUN touch __init__.py
+COPY --chown=teraflow:teraflow proto/*.proto ./
+RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
+RUN rm *.proto
+RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
+
+# Create module sub-folders
+RUN mkdir -p /home/teraflow/controller/opticalattackdetector
+WORKDIR /home/teraflow/controller
+
+# Get Python packages per module
+COPY --chown=teraflow:teraflow src/opticalattackdetector/requirements.in opticalattackdetector/requirements.in
+# consider common and specific requirements to avoid inconsistencies with dependencies
+RUN pip-compile --quiet --output-file=opticalattackdetector/requirements.txt opticalattackdetector/requirements.in common_requirements.in
+RUN python3 -m pip install -r opticalattackdetector/requirements.txt
+
+# Add files into working directory
+COPY --chown=teraflow:teraflow src/context/. context
+COPY --chown=teraflow:teraflow src/service/. service
+COPY --chown=teraflow:teraflow src/monitoring/. monitoring
+COPY --chown=teraflow:teraflow src/dbscanserving/. dbscanserving
+COPY --chown=teraflow:teraflow src/opticalattackmitigator/. opticalattackmitigator
+COPY --chown=teraflow:teraflow src/opticalattackdetector/. opticalattackdetector
+
+# Start opticalattackdetector service
+ENTRYPOINT ["python", "-m", "opticalattackdetector.service"]
diff --git a/src/opticalattackmitigator/proto/__init__.py b/src/opticalattackdetector/__init__.py
similarity index 99%
rename from src/opticalattackmitigator/proto/__init__.py
rename to src/opticalattackdetector/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/proto/__init__.py
+++ b/src/opticalattackdetector/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackdetector/client/OpticalAttackDetectorClient.py b/src/opticalattackdetector/client/OpticalAttackDetectorClient.py
new file mode 100644
index 0000000000000000000000000000000000000000..3b95227ade65cdfb4a47830dee461c57bfc7dbfb
--- /dev/null
+++ b/src/opticalattackdetector/client/OpticalAttackDetectorClient.py
@@ -0,0 +1,69 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import logging
+
+import grpc
+
+from common.Constants import ServiceNameEnum
+from common.proto.context_pb2 import Empty
+from common.proto.optical_attack_detector_pb2_grpc import \
+ OpticalAttackDetectorServiceStub
+from common.Settings import get_service_host, get_service_port_grpc
+from common.tools.client.RetryDecorator import delay_exponential, retry
+from common.tools.grpc.Tools import grpc_message_to_json
+
+LOGGER = logging.getLogger(__name__)
+MAX_RETRIES = 15
+DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0)
+RETRY_DECORATOR = retry(
+ max_retries=MAX_RETRIES,
+ delay_function=DELAY_FUNCTION,
+ prepare_method_name="connect",
+)
+
+
+class OpticalAttackDetectorClient:
+ def __init__(self, host=None, port=None):
+ if not host:
+ host = get_service_host(ServiceNameEnum.OPTICALATTACKDETECTOR)
+ if not port:
+ port = get_service_port_grpc(ServiceNameEnum.OPTICALATTACKDETECTOR)
+ self.endpoint = "{:s}:{:s}".format(str(host), str(port))
+ LOGGER.debug("Creating channel to {:s}...".format(str(self.endpoint)))
+ self.channel = None
+ self.stub = None
+ self.connect()
+ LOGGER.debug("Channel created")
+
+ def connect(self):
+ self.channel = grpc.insecure_channel(self.endpoint)
+ self.stub = OpticalAttackDetectorServiceStub(self.channel)
+
+ def close(self):
+ if self.channel is not None:
+ self.channel.close()
+ self.channel = None
+ self.stub = None
+
+ @RETRY_DECORATOR
+ def DetectAttack(self, request: Empty) -> Empty:
+ LOGGER.debug(
+ "DetectAttack request: {:s}".format(str(grpc_message_to_json(request)))
+ )
+ response = self.stub.DetectAttack(request)
+ LOGGER.debug(
+ "DetectAttack result: {:s}".format(str(grpc_message_to_json(response)))
+ )
+ return response
diff --git a/src/opticalcentralizedattackdetector/__init__.py b/src/opticalattackdetector/client/__init__.py
similarity index 99%
rename from src/opticalcentralizedattackdetector/__init__.py
rename to src/opticalattackdetector/client/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalcentralizedattackdetector/__init__.py
+++ b/src/opticalattackdetector/client/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackdetector/requirements.in b/src/opticalattackdetector/requirements.in
new file mode 100644
index 0000000000000000000000000000000000000000..b69d4dd786500686fef4e04fd5b6096d5648cfc6
--- /dev/null
+++ b/src/opticalattackdetector/requirements.in
@@ -0,0 +1,16 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+numpy
+redis
diff --git a/src/opticalattackdetector/service/OpticalAttackDetectorService.py b/src/opticalattackdetector/service/OpticalAttackDetectorService.py
new file mode 100644
index 0000000000000000000000000000000000000000..2128d79b4dcdaf4fa0f12cd1fd96ba56669d48f9
--- /dev/null
+++ b/src/opticalattackdetector/service/OpticalAttackDetectorService.py
@@ -0,0 +1,38 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import logging
+
+from common.Constants import ServiceNameEnum
+from common.proto.optical_attack_detector_pb2_grpc import \
+ add_OpticalAttackDetectorServiceServicer_to_server
+from common.Settings import get_service_port_grpc
+from common.tools.service.GenericGrpcService import GenericGrpcService
+
+from opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl import \
+ OpticalAttackDetectorServiceServicerImpl
+
+LOGGER = logging.getLogger(__name__)
+
+
+class OpticalAttackDetectorService(GenericGrpcService):
+ def __init__(self, cls_name: str = __name__):
+ port = get_service_port_grpc(ServiceNameEnum.OPTICALATTACKDETECTOR)
+ super().__init__(port, cls_name=cls_name)
+ self.opticalattackdetector_servicer = OpticalAttackDetectorServiceServicerImpl()
+
+ def install_servicers(self):
+ add_OpticalAttackDetectorServiceServicer_to_server(
+ self.opticalattackdetector_servicer, self.server
+ )
diff --git a/src/opticalattackdetector/service/OpticalAttackDetectorServiceServicerImpl.py b/src/opticalattackdetector/service/OpticalAttackDetectorServiceServicerImpl.py
new file mode 100644
index 0000000000000000000000000000000000000000..11016037ee36f3b63726f7cc9fe398609c4f451b
--- /dev/null
+++ b/src/opticalattackdetector/service/OpticalAttackDetectorServiceServicerImpl.py
@@ -0,0 +1,232 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import logging
+import pickle
+import random
+
+import grpc
+import numpy as np
+import redis
+from prometheus_client import Histogram
+
+from common.Constants import ServiceNameEnum
+from common.method_wrappers.Decorator import (MetricsPool, MetricTypeEnum,
+ safe_and_metered_rpc_method)
+from common.proto import dbscanserving_pb2 as dbscan
+from common.proto import optical_attack_detector_pb2 as oad
+from common.proto.context_pb2 import Empty
+from common.proto.monitoring_pb2 import Kpi
+from common.proto.optical_attack_detector_pb2_grpc import \
+ OpticalAttackDetectorServiceServicer
+from common.proto.optical_attack_mitigator_pb2 import (AttackDescription,
+ AttackResponse)
+from common.Settings import get_service_host, get_setting
+from common.tools.timestamp.Converters import timestamp_utcnow_to_float
+from dbscanserving.client.DbscanServingClient import DbscanServingClient
+from monitoring.client.MonitoringClient import MonitoringClient
+from opticalattackmitigator.client.OpticalAttackMitigatorClient import \
+ OpticalAttackMitigatorClient
+
+LOGGER = logging.getLogger(__name__)
+
+METRICS_POOL = MetricsPool("OpticalAttackDetector", "RPC")
+
+METRICS_POOL_DETAILS = MetricsPool(
+ "OpticalAttackDetector",
+ "execution",
+ labels={
+ "operation": "",
+ "step": "",
+ },
+)
+
+METRIC_LABELS = dict(operation="detect")
+HISTOGRAM_DURATION: Histogram = METRICS_POOL_DETAILS.get_or_create(
+ "details", MetricTypeEnum.HISTOGRAM_DURATION
+)
+
+monitoring_client: MonitoringClient = MonitoringClient()
+dbscanserving_client: DbscanServingClient = DbscanServingClient()
+attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient()
+
+redis_host = get_service_host(ServiceNameEnum.CACHING)
+r = None
+if redis_host is not None:
+ redis_port = int(get_setting("CACHINGSERVICE_SERVICE_PORT_REDIS", default=6379))
+ redis_password = get_setting("REDIS_PASSWORD")
+
+ r = redis.Redis(host=redis_host, port=redis_port, password=redis_password)
+ r.ping()
+
+# detecting preloading of the stats
+path = get_setting("PATH_OPM_INFORMATION_SUMMARY", default=None)
+if path is not None and len(path) > 0:
+ with open(path, "rb") as file:
+ opm_information_stats = pickle.load(file)
+ LOGGER.info("Using provided dataset: {}".format(path))
+else:
+ opm_information_stats = None
+
+WAD_WINDOW = 20
+WAD_SAMPLES = 9
+
+
+class OpticalAttackDetectorServiceServicerImpl(OpticalAttackDetectorServiceServicer):
+ def __init__(self):
+ LOGGER.debug("Creating Servicer...")
+ LOGGER.debug("Servicer Created")
+
+ @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
+ def DetectAttack(
+ self, request: oad.DetectionRequest, context: grpc.ServicerContext
+ ) -> Empty:
+
+ s_uuid = request.service_id.service_uuid.uuid
+
+ # detect if specific configuration is required
+ # to set the variable on the fly, try:
+ # https://stackoverflow.com/questions/45050050/can-i-modify-containers-environment-variables-without-restarting-pod-using-kube
+ _temp = r.get("CLASS_SERVICE_{}".format(s_uuid.replace("-", "_")))
+ if _temp is not None and len(_temp) > 0:
+ _class = int(_temp)
+ else: # if not, assume no attack is present
+ _class = 0
+ LOGGER.debug("Using class {} for service {}".format(_class, s_uuid))
+
+ _temp = r.get("PREVIOUS_CLASS_SERVICE_{}".format(s_uuid.replace("-", "_")))
+ if _temp is not None and int(_temp) != 0 and _class == 0:
+ # if value changed to no-attack
+ # reset the experiment
+ r.delete("opm_{}".format(s_uuid.replace("-", "_")))
+ r.set("PREVIOUS_CLASS_SERVICE_{}".format(s_uuid.replace("-", "_")), _class)
+
+ # code used to validate resiliency against failures and timeouts
+ # if random.random() > 0.5:
+ # time.sleep(10)
+
+ # run attack detection for every service
+ detection_request: dbscan.DetectionRequest = dbscan.DetectionRequest()
+ detection_request.num_samples = 310
+ detection_request.num_features = 11
+
+ # checking if we have enough samples already for this service
+ length = r.llen("opm_{}".format(s_uuid.replace("-", "_")))
+ if length < detection_request.num_samples:
+ # if the number of samples is not sufficient,
+ # we insert new samples
+ for _ in range(detection_request.num_samples - length):
+ detection_sample = []
+ if opm_information_stats is not None:
+ for col in range(1, len(opm_information_stats.columns), 2):
+ name = opm_information_stats.columns[col][0]
+ # [result.columns[x][0] for x in range(1, len(result.columns), 2)]
+ detection_sample.append(
+ np.random.normal(
+ loc=opm_information_stats[name]["mean"][_class],
+ scale=opm_information_stats[name]["std"][_class],
+ )
+ )
+ else:
+ for __ in range(detection_request.num_features):
+ detection_sample.append(random.uniform(0.0, 10.0))
+ # push the sample into the list
+ r.rpush(
+ "opm_{}".format(s_uuid.replace("-", "_")),
+ pickle.dumps(tuple(detection_sample)),
+ )
+
+ # remove the oldest sample from the list
+ r.lpop("opm_{}".format(s_uuid.replace("-", "_")))
+
+ # generate the latest sample
+ detection_sample = []
+ if opm_information_stats is not None:
+
+ for col in range(1, len(opm_information_stats.columns), 2):
+ name = opm_information_stats.columns[col][0]
+ # [result.columns[x][0] for x in range(1, len(result.columns), 2)]
+ detection_sample.append(
+ np.random.normal(
+ loc=opm_information_stats[name]["mean"][_class],
+ scale=opm_information_stats[name]["std"][_class],
+ )
+ )
+
+ # generate data based on the stats based on the configuration of
+ # https://dx.doi.org/10.1109/JLT.2020.2987032
+ detection_request.eps = 1.0
+ detection_request.min_samples = 5
+ else:
+ detection_request.eps = 100.5
+ detection_request.min_samples = 5
+
+ if _class == 0:
+ for __ in range(detection_request.num_features):
+ detection_sample.append(random.uniform(0.0, 10.0))
+ else: # if not, assume no attack is present
+ for __ in range(detection_request.num_features):
+ detection_sample.append(random.uniform(5000.0, 6000.0))
+
+ # adding the sample to the cache and recovering the cache
+ with HISTOGRAM_DURATION.labels(step="cachefetch", **METRIC_LABELS).time():
+ r.rpush(
+ "opm_{}".format(s_uuid.replace("-", "_")),
+ pickle.dumps(tuple(detection_sample)),
+ )
+ cached_samples = r.lrange("opm_{}".format(s_uuid.replace("-", "_")), 0, -1)
+ LOGGER.info(
+ "Recovered {} samples from the cache".format(len(cached_samples))
+ )
+
+ for raw_sample in cached_samples:
+ sample = pickle.loads(raw_sample)
+ detection_sample = dbscan.Sample()
+ for feature in sample:
+ detection_sample.features.append(feature)
+ detection_request.samples.append(detection_sample)
+
+ with HISTOGRAM_DURATION.labels(step="uldetection", **METRIC_LABELS).time():
+ response: dbscan.DetectionResponse = dbscanserving_client.Detect(
+ detection_request
+ )
+
+ # including KPI
+ kpi = Kpi()
+ kpi.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid
+ kpi.timestamp.timestamp = timestamp_utcnow_to_float()
+ # implementing WAD from https://ieeexplore.ieee.org/abstract/document/9064530
+ if response.cluster_indices[-WAD_WINDOW:].count(-1) >= WAD_SAMPLES:
+ kpi.kpi_value.int32Val = 1
+ LOGGER.info(
+ "Attack detected for service {}".format(
+ request.service_id.service_uuid.uuid
+ )
+ )
+ else:
+ kpi.kpi_value.int32Val = 0
+
+ with HISTOGRAM_DURATION.labels(step="includekpi", **METRIC_LABELS).time():
+ monitoring_client.IncludeKpi(kpi)
+
+ # if -1 in response.cluster_indices: # attack detected
+ if kpi.kpi_value.int32Val == -1:
+ attack = AttackDescription()
+ attack.cs_id.uuid = request.service_id.service_uuid.uuid
+ with HISTOGRAM_DURATION.labels(step="mitigation", **METRIC_LABELS).time():
+ # with MITIGATION_RESPONSE_TIME.time():
+ response: AttackResponse = attack_mitigator_client.NotifyAttack(attack)
+
+ # if attack is detected, run the attack mitigator
+ return Empty()
diff --git a/src/opticalcentralizedattackdetector/client/__init__.py b/src/opticalattackdetector/service/__init__.py
similarity index 99%
rename from src/opticalcentralizedattackdetector/client/__init__.py
rename to src/opticalattackdetector/service/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalcentralizedattackdetector/client/__init__.py
+++ b/src/opticalattackdetector/service/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackdetector/service/__main__.py b/src/opticalattackdetector/service/__main__.py
new file mode 100644
index 0000000000000000000000000000000000000000..27706fce44d9635fcdaf1cc64a2dfb6292fc7833
--- /dev/null
+++ b/src/opticalattackdetector/service/__main__.py
@@ -0,0 +1,91 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import logging
+import signal
+import sys
+import threading
+
+from prometheus_client import start_http_server
+
+from common.Constants import ServiceNameEnum
+from common.Settings import (ENVVAR_SUFIX_SERVICE_HOST,
+ ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name,
+ get_log_level, get_metrics_port,
+ wait_for_environment_variables)
+
+from opticalattackdetector.client.OpticalAttackDetectorClient import \
+ OpticalAttackDetectorClient
+from opticalattackdetector.service.OpticalAttackDetectorService import \
+ OpticalAttackDetectorService
+
+terminate = threading.Event()
+LOGGER = None
+
+client: OpticalAttackDetectorClient = None
+
+
+def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
+ LOGGER.warning("Terminate signal received")
+ terminate.set()
+
+
+def main():
+ global LOGGER # pylint: disable=global-statement
+
+ log_level = get_log_level()
+ logging.basicConfig(level=log_level)
+ LOGGER = logging.getLogger(__name__)
+
+ wait_for_environment_variables(
+ [
+ get_env_var_name(ServiceNameEnum.DBSCANSERVING, ENVVAR_SUFIX_SERVICE_HOST),
+ get_env_var_name(
+ ServiceNameEnum.DBSCANSERVING, ENVVAR_SUFIX_SERVICE_PORT_GRPC
+ ),
+ get_env_var_name(
+ ServiceNameEnum.OPTICALATTACKMITIGATOR, ENVVAR_SUFIX_SERVICE_HOST
+ ),
+ get_env_var_name(
+ ServiceNameEnum.OPTICALATTACKMITIGATOR, ENVVAR_SUFIX_SERVICE_PORT_GRPC
+ ),
+ ]
+ )
+
+ signal.signal(signal.SIGINT, signal_handler)
+ signal.signal(signal.SIGTERM, signal_handler)
+
+ LOGGER.info("Starting...")
+
+ # Start metrics server
+ metrics_port = get_metrics_port()
+ start_http_server(metrics_port)
+
+ # Starting CentralizedCybersecurity service
+ grpc_service = OpticalAttackDetectorService()
+ grpc_service.start()
+
+ # Wait for Ctrl+C or termination signal
+ while not terminate.wait(timeout=1):
+ pass
+
+ LOGGER.info("Terminating...")
+ grpc_service.stop()
+
+ LOGGER.info("Bye")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/src/opticalattackdetector/tests/__init__.py b/src/opticalattackdetector/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf
--- /dev/null
+++ b/src/opticalattackdetector/tests/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
diff --git a/src/opticalattackdetector/tests/example_objects.py b/src/opticalattackdetector/tests/example_objects.py
new file mode 100644
index 0000000000000000000000000000000000000000..aa9b7b82c5e4d9d4d4158bd0a01e6843cfe88872
--- /dev/null
+++ b/src/opticalattackdetector/tests/example_objects.py
@@ -0,0 +1,247 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+from copy import deepcopy
+
+from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID
+from common.proto.context_pb2 import (ConfigActionEnum, DeviceDriverEnum,
+ DeviceOperationalStatusEnum,
+ ServiceStatusEnum, ServiceTypeEnum)
+
+# Some example objects to be used by the tests
+
+# Helper methods
+def config_rule(action, resource_value):
+ return {"action": action, "resource_value": resource_value}
+
+
+def endpoint_id(topology_id, device_id, endpoint_uuid):
+ return {
+ "topology_id": deepcopy(topology_id),
+ "device_id": deepcopy(device_id),
+ "endpoint_uuid": {"uuid": endpoint_uuid},
+ }
+
+
+def endpoint(topology_id, device_id, endpoint_uuid, endpoint_type):
+ return {
+ "endpoint_id": endpoint_id(topology_id, device_id, endpoint_uuid),
+ "endpoint_type": endpoint_type,
+ }
+
+
+# use "deepcopy" to prevent propagating forced changes during tests
+CONTEXT_ID = {"context_uuid": {"uuid": DEFAULT_CONTEXT_UUID}}
+CONTEXT = {
+ "context_id": deepcopy(CONTEXT_ID),
+ "topology_ids": [],
+ "service_ids": [],
+}
+
+CONTEXT_ID_2 = {"context_uuid": {"uuid": "test"}}
+CONTEXT_2 = {
+ "context_id": deepcopy(CONTEXT_ID_2),
+ "topology_ids": [],
+ "service_ids": [],
+}
+
+TOPOLOGY_ID = {
+ "context_id": deepcopy(CONTEXT_ID),
+ "topology_uuid": {"uuid": DEFAULT_TOPOLOGY_UUID},
+}
+TOPOLOGY = {
+ "topology_id": deepcopy(TOPOLOGY_ID),
+ "device_ids": [],
+ "link_ids": [],
+}
+
+DEVICE1_UUID = "DEV1"
+DEVICE1_ID = {"device_uuid": {"uuid": DEVICE1_UUID}}
+DEVICE1 = {
+ "device_id": deepcopy(DEVICE1_ID),
+ "device_type": "packet-router",
+ "device_config": {
+ "config_rules": [
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "value1"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "value2"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "value3"),
+ ]
+ },
+ "device_operational_status": DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
+ "device_drivers": [
+ DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG,
+ DeviceDriverEnum.DEVICEDRIVER_P4,
+ ],
+ "device_endpoints": [
+ endpoint(TOPOLOGY_ID, DEVICE1_ID, "EP2", "port-packet-100G"),
+ endpoint(TOPOLOGY_ID, DEVICE1_ID, "EP3", "port-packet-100G"),
+ endpoint(TOPOLOGY_ID, DEVICE1_ID, "EP100", "port-packet-10G"),
+ ],
+}
+
+DEVICE2_UUID = "DEV2"
+DEVICE2_ID = {"device_uuid": {"uuid": DEVICE2_UUID}}
+DEVICE2 = {
+ "device_id": deepcopy(DEVICE2_ID),
+ "device_type": "packet-router",
+ "device_config": {
+ "config_rules": [
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "dev/rsrc1/value", "value4"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "dev/rsrc2/value", "value5"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "dev/rsrc3/value", "value6"),
+ ]
+ },
+ "device_operational_status": DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
+ "device_drivers": [
+ DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG,
+ DeviceDriverEnum.DEVICEDRIVER_P4,
+ ],
+ "device_endpoints": [
+ endpoint(TOPOLOGY_ID, DEVICE2_ID, "EP1", "port-packet-100G"),
+ endpoint(TOPOLOGY_ID, DEVICE2_ID, "EP3", "port-packet-100G"),
+ endpoint(TOPOLOGY_ID, DEVICE2_ID, "EP100", "port-packet-10G"),
+ ],
+}
+
+DEVICE3_UUID = "DEV3"
+DEVICE3_ID = {"device_uuid": {"uuid": DEVICE3_UUID}}
+DEVICE3 = {
+ "device_id": deepcopy(DEVICE3_ID),
+ "device_type": "packet-router",
+ "device_config": {
+ "config_rules": [
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "dev/rsrc1/value", "value4"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "dev/rsrc2/value", "value5"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "dev/rsrc3/value", "value6"),
+ ]
+ },
+ "device_operational_status": DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
+ "device_drivers": [
+ DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG,
+ DeviceDriverEnum.DEVICEDRIVER_P4,
+ ],
+ "device_endpoints": [
+ endpoint(TOPOLOGY_ID, DEVICE3_ID, "EP1", "port-packet-100G"),
+ endpoint(TOPOLOGY_ID, DEVICE3_ID, "EP2", "port-packet-100G"),
+ endpoint(TOPOLOGY_ID, DEVICE3_ID, "EP100", "port-packet-10G"),
+ ],
+}
+
+LINK_DEV1_DEV2_UUID = "DEV1/EP2 ==> DEV2/EP1"
+LINK_DEV1_DEV2_ID = {"link_uuid": {"uuid": LINK_DEV1_DEV2_UUID}}
+LINK_DEV1_DEV2 = {
+ "link_id": deepcopy(LINK_DEV1_DEV2_ID),
+ "link_endpoint_ids": [
+ endpoint_id(TOPOLOGY_ID, DEVICE1_ID, "EP2"),
+ endpoint_id(TOPOLOGY_ID, DEVICE2_ID, "EP1"),
+ ],
+}
+
+LINK_DEV2_DEV3_UUID = "DEV2/EP3 ==> DEV3/EP2"
+LINK_DEV2_DEV3_ID = {"link_uuid": {"uuid": LINK_DEV2_DEV3_UUID}}
+LINK_DEV2_DEV3 = {
+ "link_id": deepcopy(LINK_DEV2_DEV3_ID),
+ "link_endpoint_ids": [
+ endpoint_id(TOPOLOGY_ID, DEVICE2_ID, "EP3"),
+ endpoint_id(TOPOLOGY_ID, DEVICE3_ID, "EP2"),
+ ],
+}
+
+LINK_DEV1_DEV3_UUID = "DEV1/EP3 ==> DEV3/EP1"
+LINK_DEV1_DEV3_ID = {"link_uuid": {"uuid": LINK_DEV1_DEV3_UUID}}
+LINK_DEV1_DEV3 = {
+ "link_id": deepcopy(LINK_DEV1_DEV3_ID),
+ "link_endpoint_ids": [
+ endpoint_id(TOPOLOGY_ID, DEVICE1_ID, "EP3"),
+ endpoint_id(TOPOLOGY_ID, DEVICE3_ID, "EP1"),
+ ],
+}
+
+SERVICE_DEV1_DEV2_UUID = "SVC:DEV1/EP100-DEV2/EP100"
+SERVICE_DEV1_DEV2_ID = {
+ "context_id": deepcopy(CONTEXT_ID),
+ "service_uuid": {"uuid": SERVICE_DEV1_DEV2_UUID},
+}
+SERVICE_DEV1_DEV2 = {
+ "service_id": deepcopy(SERVICE_DEV1_DEV2_ID),
+ "service_type": ServiceTypeEnum.SERVICETYPE_L3NM,
+ "service_endpoint_ids": [
+ endpoint_id(TOPOLOGY_ID, DEVICE1_ID, "EP100"),
+ endpoint_id(TOPOLOGY_ID, DEVICE2_ID, "EP100"),
+ ],
+ # 'service_constraints': [
+ # {'constraint_type': 'latency_ms', 'constraint_value': '15.2'},
+ # {'constraint_type': 'jitter_us', 'constraint_value': '1.2'},
+ # ],
+ "service_status": {"service_status": ServiceStatusEnum.SERVICESTATUS_ACTIVE},
+ "service_config": {
+ "config_rules": [
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc1/value", "value7"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc2/value", "value8"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc3/value", "value9"),
+ ]
+ },
+}
+
+SERVICE_DEV1_DEV3_UUID = "SVC:DEV1/EP100-DEV3/EP100"
+SERVICE_DEV1_DEV3_ID = {
+ "context_id": deepcopy(CONTEXT_ID),
+ "service_uuid": {"uuid": SERVICE_DEV1_DEV3_UUID},
+}
+SERVICE_DEV1_DEV3 = {
+ "service_id": deepcopy(SERVICE_DEV1_DEV3_ID),
+ "service_type": ServiceTypeEnum.SERVICETYPE_L3NM,
+ "service_endpoint_ids": [
+ endpoint_id(TOPOLOGY_ID, DEVICE1_ID, "EP100"),
+ endpoint_id(TOPOLOGY_ID, DEVICE3_ID, "EP100"),
+ ],
+ # 'service_constraints': [
+ # {'constraint_type': 'latency_ms', 'constraint_value': '5.8'},
+ # {'constraint_type': 'jitter_us', 'constraint_value': '0.1'},
+ # ],
+ "service_status": {"service_status": ServiceStatusEnum.SERVICESTATUS_ACTIVE},
+ "service_config": {
+ "config_rules": [
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc1/value", "value7"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc2/value", "value8"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc3/value", "value9"),
+ ]
+ },
+}
+
+SERVICE_DEV2_DEV3_UUID = "SVC:DEV2/EP100-DEV3/EP100"
+SERVICE_DEV2_DEV3_ID = {
+ "context_id": deepcopy(CONTEXT_ID),
+ "service_uuid": {"uuid": SERVICE_DEV2_DEV3_UUID},
+}
+SERVICE_DEV2_DEV3 = {
+ "service_id": deepcopy(SERVICE_DEV2_DEV3_ID),
+ "service_type": ServiceTypeEnum.SERVICETYPE_L3NM,
+ "service_endpoint_ids": [
+ endpoint_id(TOPOLOGY_ID, DEVICE2_ID, "EP100"),
+ endpoint_id(TOPOLOGY_ID, DEVICE3_ID, "EP100"),
+ ],
+ # 'service_constraints': [
+ # {'constraint_type': 'latency_ms', 'constraint_value': '23.1'},
+ # {'constraint_type': 'jitter_us', 'constraint_value': '3.4'},
+ # ],
+ "service_status": {"service_status": ServiceStatusEnum.SERVICESTATUS_ACTIVE},
+ "service_config": {
+ "config_rules": [
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc1/value", "value7"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc2/value", "value8"),
+ config_rule(ConfigActionEnum.CONFIGACTION_SET, "svc/rsrc3/value", "value9"),
+ ]
+ },
+}
diff --git a/src/opticalattackdetector/tests/test_unitary.py b/src/opticalattackdetector/tests/test_unitary.py
new file mode 100644
index 0000000000000000000000000000000000000000..72e3a4ac124bd034a76461baee316ab0f1139ed9
--- /dev/null
+++ b/src/opticalattackdetector/tests/test_unitary.py
@@ -0,0 +1,100 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import logging
+import os
+from unittest.mock import patch
+
+import pytest
+from common.Constants import (DEFAULT_GRPC_GRACE_PERIOD,
+ DEFAULT_GRPC_MAX_WORKERS)
+from common.proto import dbscanserving_pb2 as dbscan
+from common.proto.optical_attack_detector_pb2 import DetectionRequest
+
+from opticalattackdetector.client.OpticalAttackDetectorClient import \
+ OpticalAttackDetectorClient
+from opticalattackdetector.Config import GRPC_SERVICE_PORT
+from opticalattackdetector.service.OpticalAttackDetectorService import \
+ OpticalAttackDetectorService
+
+# from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
+
+port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
+
+LOGGER = logging.getLogger(__name__)
+LOGGER.setLevel(logging.DEBUG)
+
+
+@pytest.fixture(scope="session")
+def optical_attack_detector_service():
+ with patch.dict(
+ os.environ,
+ {
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_PORT_GRPC": str(port),
+ "DBSCANSERVINGSERVICE_SERVICE_HOST": "127.0.0.1",
+ "DBSCANSERVINGSERVICE_SERVICE_PORT_GRPC": str(port),
+ },
+ clear=True,
+ ):
+ _service = OpticalAttackDetectorService(
+ port=port,
+ max_workers=DEFAULT_GRPC_MAX_WORKERS,
+ grace_period=DEFAULT_GRPC_GRACE_PERIOD,
+ )
+ _service.start()
+ yield _service
+ _service.stop()
+
+
+@pytest.fixture(scope="session")
+def optical_attack_detector_client(optical_attack_detector_service):
+ with patch.dict(
+ os.environ,
+ {
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_PORT_GRPC": str(port),
+ "DBSCANSERVINGSERVICE_SERVICE_HOST": "127.0.0.1",
+ "DBSCANSERVINGSERVICE_SERVICE_PORT_GRPC": str(port),
+ },
+ clear=True,
+ ):
+ _client = OpticalAttackDetectorClient()
+ yield _client
+ _client.close()
+
+
+def test_detect_attack(
+ optical_attack_detector_client: OpticalAttackDetectorClient,
+):
+ message = dbscan.DetectionResponse()
+ message.cluster_indices.extend([0, 1, -1, -1, -1])
+ with patch(
+ "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.attack_mitigator_client"
+ ) as mitigator, patch(
+ "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.monitoring_client"
+ ) as monitoring, patch(
+ "opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.dbscanserving_client.Detect",
+ # TODO: return dumb object with "cluster_indices" attribute
+ # idea: create new response object
+ return_value=message,
+ ) as dbscanserving:
+ request: DetectionRequest = DetectionRequest()
+ request.service_id.context_id.context_uuid.uuid = ""
+ request.service_id.service_uuid.uuid = str("")
+ request.kpi_id.kpi_id.uuid = ""
+ optical_attack_detector_client.DetectAttack(request)
+ mitigator.NotifyAttack.assert_called_once()
+ monitoring.IncludeKpi.assert_called_once()
+ dbscanserving.assert_called_once()
diff --git a/src/opticalcentralizedattackdetector/.gitlab-ci.yml b/src/opticalattackmanager/.gitlab-ci.yml
similarity index 62%
rename from src/opticalcentralizedattackdetector/.gitlab-ci.yml
rename to src/opticalattackmanager/.gitlab-ci.yml
index 3db4de3f177cfb1478bc306067564e9a293e0737..08136e4900d184d4923d9690322b76f7f2ef9fcc 100644
--- a/src/opticalcentralizedattackdetector/.gitlab-ci.yml
+++ b/src/opticalattackmanager/.gitlab-ci.yml
@@ -12,49 +12,50 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# build, tag and push the Docker image to the gitlab registry
-build opticalcentralizedattackdetector:
+# Build, tag, and push the Docker image to the GitLab Docker registry
+build opticalattackmanager:
variables:
- IMAGE_NAME: 'opticalcentralizedattackdetector' # name of the microservice
+ IMAGE_NAME: 'opticalattackmanager' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
stage: build
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/
+ - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
after_script:
- docker images --filter="dangling=true" --quiet | xargs -r docker rmi
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- changes:
+ - src/common/**/*.py
+ - proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py
- - src/$IMAGE_NAME/tests/Dockerfile
- manifests/${IMAGE_NAME}service.yaml
- .gitlab-ci.yml
-# apply unit test to the opticalcentralizedattackdetector component
-unit test opticalcentralizedattackdetector:
+# Apply unit test to the component
+unit_test opticalattackmanager:
variables:
- IMAGE_NAME: 'opticalcentralizedattackdetector' # name of the microservice
+ IMAGE_NAME: 'opticalattackmanager' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
stage: unit_test
needs:
- - build opticalcentralizedattackdetector
+ - build opticalattackmanager
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi
- if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi
script:
- docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- - docker run --name $IMAGE_NAME -d -p 10005:10005 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
- - sleep 5
+ - docker run --name $IMAGE_NAME -d -p 10005:10005 -v "$PWD/src/$IMAGE_NAME/tests:/home/teraflow/$IMAGE_NAME/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
- docker ps -a
- - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml"
+ - docker logs $IMAGE_NAME
+ - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/home/teraflow/$IMAGE_NAME/results/${IMAGE_NAME}_report.xml"
- docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing"
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
after_script:
@@ -62,42 +63,43 @@ unit test opticalcentralizedattackdetector:
- docker network rm teraflowbridge
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+ - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- changes:
+ - src/common/**/*.py
+ - proto/*.proto
- src/$IMAGE_NAME/**/*.{py,in,yml}
- src/$IMAGE_NAME/Dockerfile
- src/$IMAGE_NAME/tests/*.py
- src/$IMAGE_NAME/tests/Dockerfile
- - manifests/$IMAGE_NAMEservice.yaml
+ - manifests/${IMAGE_NAME}service.yaml
- .gitlab-ci.yml
artifacts:
- when: always
- reports:
- junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml
-
+ when: always
+ reports:
+ junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml
-# Deployment of the opticalcentralizedattackdetector service in Kubernetes Cluster
-deploy opticalcentralizedattackdetector:
- variables:
- IMAGE_NAME: 'opticalcentralizedattackdetector' # name of the microservice
- IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
- stage: deploy
- needs:
- - unit test opticalcentralizedattackdetector
- # - integ_test execute
- script:
- - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
- - kubectl version
- - kubectl get all
- - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
- - kubectl get all
- # environment:
- # name: test
- # url: https://example.com
- # kubernetes:
- # namespace: test
- rules:
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- when: manual
- - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- when: manual
\ No newline at end of file
+# Deployment of the service in Kubernetes Cluster
+# deploy opticalattackmanager:
+# variables:
+# IMAGE_NAME: 'opticalattackmanager' # name of the microservice
+# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
+# stage: deploy
+# needs:
+# - unit test opticalattackmanager
+# # - integ_test execute
+# script:
+# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
+# - kubectl version
+# - kubectl get all
+# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
+# - kubectl get all
+# # environment:
+# # name: test
+# # url: https://example.com
+# # kubernetes:
+# # namespace: test
+# rules:
+# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
+# when: manual
+# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+# when: manual
diff --git a/src/opticalattackmanager/Config.py b/src/opticalattackmanager/Config.py
new file mode 100644
index 0000000000000000000000000000000000000000..7cbb8423de9118b5e79e96b535e3831aa469b7b2
--- /dev/null
+++ b/src/opticalattackmanager/Config.py
@@ -0,0 +1,15 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+MONITORING_INTERVAL = 10 # monitoring interval in seconds
diff --git a/src/opticalattackmanager/Dockerfile b/src/opticalattackmanager/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..d97a5c6f38d42205a97404a4685c4a1cca157f8d
--- /dev/null
+++ b/src/opticalattackmanager/Dockerfile
@@ -0,0 +1,93 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+FROM python:3.9-slim
+
+# Install dependencies
+RUN apt-get --yes --quiet --quiet update && \
+ apt-get --yes --quiet --quiet install wget g++ nano && \
+ rm -rf /var/lib/apt/lists/*
+
+# TODO: remove nano from installation
+
+# Set Python to show logs as they occur
+ENV PYTHONUNBUFFERED=0
+ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
+
+# Download the gRPC health probe
+RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
+ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
+ chmod +x /bin/grpc_health_probe
+
+# Creating a user for security reasons
+RUN groupadd -r teraflow && useradd -u 1001 --no-log-init -r -m -g teraflow teraflow
+USER teraflow
+
+# set working directory
+RUN mkdir -p /home/teraflow/controller/common/
+WORKDIR /home/teraflow/controller
+
+# Get Python packages per module
+ENV VIRTUAL_ENV=/home/teraflow/venv
+RUN python3 -m venv ${VIRTUAL_ENV}
+ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
+
+# Get generic Python packages
+RUN python3 -m pip install --upgrade pip
+RUN python3 -m pip install --upgrade setuptools wheel
+RUN python3 -m pip install --upgrade pip-tools
+
+# Get common Python packages
+# Note: this step enables sharing the previous Docker build steps among all the Python components
+COPY --chown=teraflow:teraflow common_requirements.in common_requirements.in
+COPY --chown=teraflow:teraflow src/opticalattackmanager/requirements.in opticalattackmanager/requirements.in
+RUN sed -i '/protobuf/d' common_requirements.in && sed -i '/grpc/d' common_requirements.in
+RUN pip-compile --output-file=common_requirements.txt common_requirements.in opticalattackmanager/requirements.in
+RUN python3 -m pip install -r common_requirements.txt
+
+# Get Python packages per module
+# COPY --chown=opticalattackmanager:opticalattackmanager src/opticalattackmanager/requirements.in opticalattackmanager/requirements.in
+# RUN pip-compile --quiet --output-file=opticalattackmanager/requirements.txt opticalattackmanager/requirements.in
+# RUN python3 -m pip install -r opticalattackmanager/requirements.txt
+
+# Add common files into working directory
+WORKDIR /home/teraflow/controller/common
+COPY --chown=teraflow:teraflow src/common/. ./
+
+# Create proto sub-folder, copy .proto files, and generate Python code
+WORKDIR /home/teraflow/controller/common/proto
+RUN touch __init__.py
+RUN mkdir -p /home/teraflow/controller/common/proto/asyncio
+RUN touch asyncio/__init__.py
+COPY --chown=teraflow:teraflow proto/*.proto ./
+RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
+# new line added to generate protobuf for the `grpclib` library
+RUN python3 -m grpc_tools.protoc -I=./ --python_out=./asyncio --grpclib_python_out=./asyncio *.proto
+RUN rm *.proto
+RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
+
+# Create module sub-folders
+RUN mkdir -p /home/teraflow/controller/opticalattackmanager
+WORKDIR /home/teraflow/controller
+
+# Add files into working directory
+COPY --chown=teraflow:teraflow src/context/. context
+COPY --chown=teraflow:teraflow src/monitoring/. monitoring
+COPY --chown=teraflow:teraflow src/dbscanserving/. dbscanserving
+COPY --chown=teraflow:teraflow src/opticalattackdetector/. opticalattackdetector
+COPY --chown=teraflow:teraflow src/opticalattackmitigator/. opticalattackmitigator
+COPY --chown=teraflow:teraflow src/opticalattackmanager/. opticalattackmanager
+
+# Start opticalattackmanager service
+ENTRYPOINT ["python", "-m", "opticalattackmanager.service"]
diff --git a/src/opticalattackmanager/__init__.py b/src/opticalattackmanager/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf
--- /dev/null
+++ b/src/opticalattackmanager/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
diff --git a/src/opticalattackmanager/requirements.in b/src/opticalattackmanager/requirements.in
new file mode 100644
index 0000000000000000000000000000000000000000..6f2b2b7d36ddab234f6d1f874ad3eb86173ce654
--- /dev/null
+++ b/src/opticalattackmanager/requirements.in
@@ -0,0 +1,19 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+grpcio==1.49.*
+grpcio-health-checking==1.49.*
+grpcio-tools==1.49.*
+grpclib[protobuf]
+redis
diff --git a/src/opticalattackmanager/service/__init__.py b/src/opticalattackmanager/service/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf
--- /dev/null
+++ b/src/opticalattackmanager/service/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
diff --git a/src/opticalattackmanager/service/__main__.py b/src/opticalattackmanager/service/__main__.py
new file mode 100644
index 0000000000000000000000000000000000000000..7c3c8b0526f1d8b06b92143ad43635d560b5153b
--- /dev/null
+++ b/src/opticalattackmanager/service/__main__.py
@@ -0,0 +1,558 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import asyncio
+import logging
+import math
+import pickle
+import signal
+import sys
+import time
+from concurrent.futures import ProcessPoolExecutor
+from multiprocessing import Event, Manager, Process
+from typing import Dict, List
+
+import redis
+from prometheus_client import Counter, Gauge, Histogram, start_http_server
+
+from common.Constants import ServiceNameEnum
+from common.proto.context_pb2 import (
+ ContextIdList,
+ Empty,
+ EventTypeEnum,
+ Service,
+ ServiceIdList,
+ ServiceTypeEnum,
+)
+from common.proto.kpi_sample_types_pb2 import KpiSampleType
+from common.proto.monitoring_pb2 import KpiDescriptor
+from common.Settings import (
+ ENVVAR_SUFIX_SERVICE_HOST,
+ ENVVAR_SUFIX_SERVICE_PORT_GRPC,
+ get_env_var_name,
+ get_log_level,
+ get_metrics_port,
+ get_service_host,
+ get_setting,
+ wait_for_environment_variables,
+)
+from common.tools.grpc.Tools import grpc_message_to_json_string
+from context.client.ContextClient import ContextClient
+from context.client.EventsCollector import EventsCollector
+from monitoring.client.MonitoringClient import MonitoringClient
+from opticalattackmanager.Config import MONITORING_INTERVAL
+from opticalattackmanager.utils.monitor import delegate_services
+
+terminate = Event()
+LOGGER = None
+
+# SERVICE_LIST_MODE:
+# 1 => use Redis
+LIST_REDIS_MODE = 1
+# 2 => use shared list
+LIST_SHARED_MODE = 2
+SERVICE_LIST_MODE = int(
+ get_setting("OPTICALATTACKMANAGER_SERVICE_LIST_MODE", default=1)
+)
+SERVICE_LIST_KEY = get_setting(
+ "OPTICALATTACKMANAGER_SERVICE_LIST_KEY", default="opt-sec:active-services"
+)
+MIN_NUMBER_WORKERS = int(
+ get_setting("OPTICALATTACKMANAGERSERVICE_LOOP_MIN_WORKERS", default=2)
+)
+MAX_NUMBER_WORKERS = int(
+ get_setting("OPTICALATTACKMANAGERSERVICE_LOOP_MAX_WORKERS", default=10)
+)
+
+# Create a metric to track time spent and requests made.
+# TODO: adjust histogram buckets to more realistic values
+LOOP_TIME = Histogram(
+ "tfs_opticalattackmanager_loop_seconds",
+ "Time taken by each security loop",
+ buckets=(
+ 1.0, 2.5, 5.0, 7.5, 10.0, 12.5,
+ 15.0, 17.5, 20.0, 22.5, 25.0, 27.5,
+ 30.0, 32.5, 35.0, 37.5, 40.0,
+ 42.5, 45.0, 47.5,
+ 50.0, 52.5, 55.0, 57.5,
+ 60.0, 70.0, 80.0, 90.0, 100.0,
+ float("inf"),
+ ),
+)
+
+CURRENT_SERVICES = Gauge(
+ "tfs_opticalattackmanager_active_services",
+ "Active optical services currently in the network",
+)
+
+NUMBER_WORKERS = Gauge(
+ "tfs_opticalattackmanager_number_workers",
+ "Number of workers being used by the loop",
+)
+
+DESIRED_MONITORING_INTERVAL = Gauge(
+ "tfs_opticalattackmanager_desired_monitoring_interval",
+ "Desired loop monitoring interval",
+)
+
+DROP_COUNTER = Counter(
+ "tfs_opticalattackmanager_dropped_assessments",
+ "Dropped assessments due to detector timeout",
+)
+
+global service_list
+global cache
+
+
+def append_service(
+ info: Dict[str, str], service_list: List = None, cache: redis.Redis = None
+) -> None:
+ if SERVICE_LIST_MODE == LIST_REDIS_MODE:
+ cache.lpush(SERVICE_LIST_KEY, pickle.dumps(info))
+ elif SERVICE_LIST_MODE == LIST_SHARED_MODE:
+ service_list.append(info)
+
+
+def delete_service(
+ info: Dict[str, str], service_list: List = None, cache: redis.Redis = None
+) -> None:
+ # here we need to test if the service exists in the list because it has been
+ # already deleted and there is not way of knowing if it is optical or not
+ if SERVICE_LIST_MODE == LIST_REDIS_MODE:
+ service_list = cache.lrange(SERVICE_LIST_KEY, 0, -1)
+ for encoded in service_list:
+ service = pickle.loads(encoded)
+ if (
+ service["service"] == info["service"]
+ and service["context"] == info["context"]
+ ):
+ cache.lrem(SERVICE_LIST_KEY, 1, encoded)
+ break
+ elif SERVICE_LIST_MODE == LIST_SHARED_MODE:
+ # find service and remove it from the list of currently monitored
+ for service in service_list:
+ if (
+ service["service"] == info["service"]
+ and service["context"] == info["context"]
+ ):
+ service_list.remove(service)
+ break
+
+
+def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
+ LOGGER.warning("Terminate signal received")
+ terminate.set()
+
+
+def create_kpi(client: MonitoringClient, service_id):
+ # create kpi
+ kpi_description: KpiDescriptor = KpiDescriptor()
+ kpi_description.kpi_description = "Security status of service {}".format(service_id)
+ kpi_description.service_id.service_uuid.uuid = service_id
+ kpi_description.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_UNKNOWN
+ new_kpi = client.SetKpi(kpi_description)
+ LOGGER.debug("Created KPI {}: ".format(grpc_message_to_json_string(new_kpi)))
+ return new_kpi
+
+
+def get_context_updates(terminate, service_list, cache):
+ # to make sure we are thread safe...
+ LOGGER.info("Connecting with context and monitoring components...")
+ context_client: ContextClient = ContextClient()
+ monitoring_client: MonitoringClient = MonitoringClient()
+
+ events_collector: EventsCollector = EventsCollector(
+ context_client,
+ log_events_received=True,
+ activate_connection_collector=False,
+ activate_context_collector=False,
+ activate_device_collector=False,
+ activate_link_collector=False,
+ activate_slice_collector=False,
+ activate_topology_collector=False,
+ activate_service_collector=True,
+ )
+ events_collector.start()
+
+ LOGGER.info("Connected with components successfully... Waiting for events...")
+
+ time.sleep(20)
+
+ while not terminate.wait(timeout=5):
+ event = events_collector.get_event(block=True, timeout=1)
+ if event is None:
+ LOGGER.debug("No event received")
+ continue # no event received
+ LOGGER.debug("Event received: {}".format(grpc_message_to_json_string(event)))
+ if event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE:
+ service: Service = context_client.GetService(event.service_id)
+ # only add if service is of type TAPI
+ if (
+ service.service_type
+ == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE
+ ):
+ LOGGER.info(
+ "Service created: {}".format(
+ grpc_message_to_json_string(event.service_id)
+ )
+ )
+ kpi_id = create_kpi(
+ monitoring_client, event.service_id.service_uuid.uuid
+ )
+
+ append_service(
+ {
+ "context": event.service_id.context_id.context_uuid.uuid,
+ "service": event.service_id.service_uuid.uuid,
+ "kpi": kpi_id.kpi_id.uuid,
+ },
+ service_list=service_list,
+ cache=cache,
+ )
+
+ elif event.event.event_type == EventTypeEnum.EVENTTYPE_REMOVE:
+ # cannot fetch service details because it does not exist anymore
+ LOGGER.info(
+ "Service removed: {}".format(
+ grpc_message_to_json_string(event.service_id)
+ )
+ )
+ delete_service(
+ {
+ "service": event.service_id.service_uuid.uuid,
+ "context": event.service_id.context_id.context_uuid.uuid,
+ },
+ service_list=service_list,
+ cache=cache,
+ )
+
+ events_collector.stop()
+
+
+def get_number_workers(
+ cur_value: int, cur_duration: float, desired_duration: float
+) -> int:
+ factor = cur_duration / desired_duration
+ desired_number = cur_value * factor
+ new_value = min(
+ MAX_NUMBER_WORKERS, max(MIN_NUMBER_WORKERS, math.ceil(desired_number))
+ )
+ return new_value
+
+
+async def monitor_services(terminate, service_list=None, cache=None):
+
+ host = get_service_host(ServiceNameEnum.OPTICALATTACKDETECTOR)
+ port = get_metrics_port(ServiceNameEnum.OPTICALATTACKDETECTOR)
+
+ cur_number_workers = MIN_NUMBER_WORKERS
+ desired_monitoring_interval = 30 # defaults to 30 seconds
+ DESIRED_MONITORING_INTERVAL.set(desired_monitoring_interval)
+
+ event_loop = asyncio.get_running_loop()
+
+ LOGGER.info("Starting execution of the async loop")
+
+ while not terminate.is_set():
+ # we account the entire set of procedures as the loop time
+ start_time = time.time()
+
+ # obtain desired monitoring interval
+ temp = cache.get("MONITORING_INTERVAL")
+ if temp is not None:
+ new_desired_monitoring_interval = int(temp)
+ else:
+ # if not set in Redis, fallback to the environment variable
+ new_desired_monitoring_interval = int(
+ get_setting("MONITORING_INTERVAL", default=MONITORING_INTERVAL)
+ )
+ cache.set("MONITORING_INTERVAL", new_desired_monitoring_interval)
+
+ # only reports when changes happen
+ if desired_monitoring_interval != new_desired_monitoring_interval:
+ LOGGER.info(
+ "Changing monitoring interval from {} [sec.] to {} [sec.]".format(
+ desired_monitoring_interval, new_desired_monitoring_interval
+ )
+ )
+ desired_monitoring_interval = new_desired_monitoring_interval
+ DESIRED_MONITORING_INTERVAL.set(desired_monitoring_interval)
+
+ pool_executor = ProcessPoolExecutor(max_workers=cur_number_workers)
+ NUMBER_WORKERS.set(cur_number_workers)
+
+ current_list = []
+ if SERVICE_LIST_MODE == LIST_REDIS_MODE:
+ current_list.extend(
+ [
+ pickle.loads(service)
+ for service in cache.lrange(SERVICE_LIST_KEY, 0, -1)
+ ]
+ )
+ elif SERVICE_LIST_MODE == LIST_SHARED_MODE:
+ current_list.extend(service_list)
+
+ CURRENT_SERVICES.set(len(current_list))
+
+ if len(current_list) == 0:
+ LOGGER.info(
+ f"No services to monitor... {desired_monitoring_interval} [sec.] / {cur_number_workers} workers"
+ )
+
+ duration = time.time() - start_time
+
+ # calculate new number of workers
+ cur_number_workers = get_number_workers(
+ cur_number_workers, duration, desired_monitoring_interval
+ )
+
+ LOOP_TIME.observe(0) # ignore internal procedure time
+ time.sleep(desired_monitoring_interval - duration)
+ continue
+
+ LOGGER.info(
+ "Starting new monitoring cycle for {} sec. with {} for {} "
+ "services with {} workers...".format(
+ desired_monitoring_interval,
+ "REDIS" if SERVICE_LIST_MODE == 1 else "local",
+ len(current_list),
+ cur_number_workers,
+ )
+ )
+
+ # start standard implementation
+ # tasks = []
+ # for service in current_list:
+ # aw = detect_attack(
+ # host,
+ # port,
+ # service["context"],
+ # service["service"],
+ # service["kpi"],
+ # # allow at most 90% of the monitoring interval to succeed
+ # monitoring_interval * 0.9,
+ # )
+ # tasks.append(aw)
+ # [await aw for aw in tasks]
+ # end standard implementation
+
+ # start pool implementation
+ if len(current_list) == 0: # guard clause to re-check if services still there
+ LOGGER.info(
+ f"No services to monitor... "
+ f"{desired_monitoring_interval} / {cur_number_workers}"
+ )
+
+ duration = time.time() - start_time
+
+ # calculate new number of workers
+ cur_number_workers = get_number_workers(
+ cur_number_workers, duration, desired_monitoring_interval
+ )
+
+ LOOP_TIME.observe(0)
+ time.sleep(desired_monitoring_interval - duration)
+ continue
+
+ # process to get (close to) equal slices:
+ # https://stackoverflow.com/questions/2130016/splitting-a-list-into-n-parts-of-approximately-equal-length
+ k, m = divmod(len(current_list), cur_number_workers)
+ if k == 0: # happens when a single process is working
+ k = m
+ m = 0
+ # dividing async work across multiple processes:
+ # https://stackoverflow.com/questions/69729488/how-to-run-multiple-asyncio-loops-inside-syncrhonous-sub-processes-inside-a-main
+ # https://stackoverflow.com/questions/65557258/typeerror-cant-pickle-coroutine-objects-when-i-am-using-asyncio-loop-run-in-ex
+ # https://stackoverflow.com/questions/69741177/run-multiple-async-loops-in-separate-processes-within-a-main-async-app
+ tasks = [
+ event_loop.run_in_executor(
+ pool_executor,
+ delegate_services,
+ current_list,
+ i * k + min(i, m), # first index
+ (i + 1) * k + min(i + 1, m), # last index
+ host,
+ port,
+ DROP_COUNTER,
+ desired_monitoring_interval * 0.9,
+ )
+ for i in range(cur_number_workers)
+ ]
+ # await for all tasks to finish
+ await asyncio.gather(*tasks)
+
+ end_time = time.time()
+
+ duration = end_time - start_time
+ LOOP_TIME.observe(duration)
+ LOGGER.info(
+ "Monitoring loop with {} services took {:.3f} seconds ({:.2f}%)... "
+ "Waiting for {:.2f} seconds...".format(
+ len(current_list),
+ duration,
+ (duration / desired_monitoring_interval) * 100,
+ desired_monitoring_interval - duration,
+ )
+ )
+
+ # calculate new number of workers
+ cur_number_workers = get_number_workers(
+ cur_number_workers, duration, desired_monitoring_interval * 0.9
+ )
+ LOGGER.info(f"New number of workers: {cur_number_workers}")
+
+ if duration / desired_monitoring_interval > 0.9:
+ LOGGER.warning(
+ "Monitoring loop is taking {} % of the desired time "
+ "({} seconds)".format(
+ (duration / desired_monitoring_interval) * 100,
+ desired_monitoring_interval,
+ )
+ )
+ if desired_monitoring_interval - duration > 0:
+ time.sleep(desired_monitoring_interval - duration)
+
+
+def main():
+ global LOGGER # pylint: disable=global-statement
+
+ log_level = get_log_level()
+ logging.basicConfig(level=log_level)
+ LOGGER = logging.getLogger(__name__)
+
+ logging.getLogger("hpack").setLevel(logging.CRITICAL)
+
+ wait_for_environment_variables(
+ [
+ get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST),
+ get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC),
+ get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_HOST),
+ get_env_var_name(
+ ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC
+ ),
+ get_env_var_name(
+ ServiceNameEnum.OPTICALATTACKDETECTOR, ENVVAR_SUFIX_SERVICE_HOST
+ ),
+ get_env_var_name(
+ ServiceNameEnum.OPTICALATTACKDETECTOR, ENVVAR_SUFIX_SERVICE_PORT_GRPC
+ ),
+ ]
+ )
+
+ signal.signal(signal.SIGINT, signal_handler)
+ signal.signal(signal.SIGTERM, signal_handler)
+
+ LOGGER.info("Starting...")
+
+ # Start metrics server
+ metrics_port = get_metrics_port()
+ start_http_server(metrics_port)
+
+ if SERVICE_LIST_MODE not in [1, 2]:
+ LOGGER.critical(
+ "Service mode has wrong configuration. Value: {}.".format(SERVICE_LIST_MODE)
+ )
+
+ redis_host = get_service_host(ServiceNameEnum.CACHING)
+ if redis_host is not None:
+ redis_port = int(get_setting("CACHINGSERVICE_SERVICE_PORT_REDIS", default=6379))
+ redis_password = get_setting("REDIS_PASSWORD")
+ LOGGER.debug(f"Redis password: {redis_password}")
+
+ service_list = None
+ cache = None
+ if SERVICE_LIST_MODE == LIST_REDIS_MODE:
+ cache = redis.Redis(host=redis_host, port=redis_port, password=redis_password)
+ cache.ping()
+
+ # clean the existing list that will be populated later on in this function
+ cache.delete(SERVICE_LIST_KEY)
+ elif SERVICE_LIST_MODE == LIST_SHARED_MODE:
+ # creating a thread-safe list to be shared among threads
+ service_list = Manager().list()
+
+ LOGGER.info("Connecting with context component...")
+ context_client: ContextClient = ContextClient()
+ monitoring_client: MonitoringClient = MonitoringClient()
+ LOGGER.info("Connected successfully...")
+
+ if get_setting("TESTING", default=False):
+ # if testing, create dummy services
+ kpi_id = create_kpi(monitoring_client, "1213")
+ append_service(
+ {"context": "admin", "service": "1213", "kpi": kpi_id.kpi_id.uuid},
+ service_list=service_list,
+ cache=cache,
+ )
+ kpi_id = create_kpi(monitoring_client, "1456")
+ append_service(
+ {"context": "admin", "service": "1456", "kpi": kpi_id.kpi_id.uuid},
+ service_list=service_list,
+ cache=cache,
+ )
+
+ context_ids: ContextIdList = context_client.ListContextIds(Empty())
+
+ # populate with initial services
+ for context_id in context_ids.context_ids:
+ context_services: ServiceIdList = context_client.ListServiceIds(context_id)
+ for service_id in context_services.service_ids:
+ service: Service = context_client.GetService(service_id)
+ if (
+ service.service_type
+ == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE
+ ):
+ # in case of a service restart, monitoring component will not duplicate KPIs
+ # but rather return the existing KPI if that's the case
+ kpi_id = create_kpi(monitoring_client, service_id.service_uuid.uuid)
+ append_service(
+ {
+ "context": context_id.context_uuid.uuid,
+ "service": service_id.service_uuid.uuid,
+ "kpi": kpi_id.kpi_id.uuid,
+ },
+ service_list=service_list,
+ cache=cache,
+ )
+
+ context_client.close()
+ monitoring_client.close()
+
+ # starting background process to monitor service addition/removal
+ process_context = Process(
+ target=get_context_updates, args=(terminate, service_list, cache)
+ )
+ process_context.start()
+
+ time.sleep(5) # wait for the context updates to startup
+
+ # runs the async loop in the background
+ loop = asyncio.get_event_loop()
+ loop.run_until_complete(monitor_services(terminate, service_list, cache))
+ # asyncio.create_task(monitor_services(service_list))
+
+ # Wait for Ctrl+C or termination signal
+ while not terminate.wait(timeout=1):
+ pass
+
+ LOGGER.info("Terminating...")
+ process_context.kill()
+ # process_security_loop.kill()
+
+ LOGGER.info("Bye")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/src/opticalattackmanager/tests/__init__.py b/src/opticalattackmanager/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf
--- /dev/null
+++ b/src/opticalattackmanager/tests/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
diff --git a/src/opticalattackmanager/tests/test_unitary.py b/src/opticalattackmanager/tests/test_unitary.py
new file mode 100644
index 0000000000000000000000000000000000000000..5d29079d7c2c2bfbe1313c974c528e5211317e8f
--- /dev/null
+++ b/src/opticalattackmanager/tests/test_unitary.py
@@ -0,0 +1,120 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import logging
+import os
+from unittest.mock import patch
+
+import pytest
+
+from common.Constants import (DEFAULT_GRPC_GRACE_PERIOD,
+ DEFAULT_GRPC_MAX_WORKERS,
+ DEFAULT_SERVICE_GRPC_PORTS, ServiceNameEnum)
+from common.proto import dbscanserving_pb2 as dbscan
+from common.proto.optical_attack_detector_pb2 import DetectionRequest
+from opticalattackdetector.client.OpticalAttackDetectorClient import \
+ OpticalAttackDetectorClient
+from opticalattackdetector.Config import GRPC_SERVICE_PORT
+from opticalattackdetector.service.OpticalAttackDetectorService import \
+ OpticalAttackDetectorService
+
+# from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
+
+port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
+
+LOGGER = logging.getLogger(__name__)
+LOGGER.setLevel(logging.DEBUG)
+
+
+@pytest.fixture(scope="session")
+def optical_attack_detector_service():
+ with patch.dict(
+ os.environ,
+ {
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_PORT_GRPC": str(
+ 1000
+ + DEFAULT_SERVICE_GRPC_PORTS.get(
+ ServiceNameEnum.OPTICALATTACKDETECTOR.value
+ )
+ ),
+ "OPTICALATTACKMITIGATORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKMITIGATORSERVICE_SERVICE_PORT_GRPC": str(
+ 1000
+ + DEFAULT_SERVICE_GRPC_PORTS.get(
+ ServiceNameEnum.OPTICALATTACKMITIGATOR.value
+ )
+ ),
+ "DBSCANSERVINGSERVICE_SERVICE_HOST": "127.0.0.1",
+ "DBSCANSERVINGSERVICE_SERVICE_PORT_GRPC": str(
+ 1000
+ + DEFAULT_SERVICE_GRPC_PORTS.get(ServiceNameEnum.DBSCANSERVING.value)
+ ),
+ },
+ clear=True,
+ ):
+ _service = OpticalAttackDetectorService(
+ port=port,
+ max_workers=DEFAULT_GRPC_MAX_WORKERS,
+ grace_period=DEFAULT_GRPC_GRACE_PERIOD,
+ )
+ # mocker_context_client = mock.patch('opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.context_client')
+ # mocker_context_client.start()
+
+ # mocker_influx_db = mock.patch('opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.influxdb_client')
+ # mocker_influx_db.start()
+
+ _service.start()
+ yield _service
+ _service.stop()
+ # mocker_context_client.stop()
+ # mocker_influx_db.stop()
+
+
+@pytest.fixture(scope="session")
+def optical_attack_detector_client(optical_attack_detector_service):
+ with patch.dict(
+ os.environ,
+ {
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKDETECTORSERVICE_SERVICE_PORT_GRPC": str(
+ 1000
+ + DEFAULT_SERVICE_GRPC_PORTS.get(
+ ServiceNameEnum.OPTICALATTACKDETECTOR.value
+ )
+ ),
+ "OPTICALATTACKMITIGATORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKMITIGATORSERVICE_SERVICE_PORT_GRPC": str(
+ 1000
+ + DEFAULT_SERVICE_GRPC_PORTS.get(
+ ServiceNameEnum.OPTICALATTACKMITIGATOR.value
+ )
+ ),
+ "DBSCANSERVINGSERVICE_SERVICE_HOST": "127.0.0.1",
+ "DBSCANSERVINGSERVICE_SERVICE_PORT_GRPC": str(
+ 1000
+ + DEFAULT_SERVICE_GRPC_PORTS.get(ServiceNameEnum.DBSCANSERVING.value)
+ ),
+ },
+ clear=True,
+ ):
+ _client = OpticalAttackDetectorClient()
+ yield _client
+ _client.close()
+
+
+def test_detect_attack(
+ optical_attack_detector_client: OpticalAttackDetectorClient,
+):
+ LOGGER.info("placeholder")
diff --git a/src/opticalattackmanager/utils/__init__.py b/src/opticalattackmanager/utils/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf
--- /dev/null
+++ b/src/opticalattackmanager/utils/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
diff --git a/src/opticalattackmanager/utils/monitor.py b/src/opticalattackmanager/utils/monitor.py
new file mode 100644
index 0000000000000000000000000000000000000000..0d37cd0effdbb9cb10ca5454ef75d138a3d5fb4a
--- /dev/null
+++ b/src/opticalattackmanager/utils/monitor.py
@@ -0,0 +1,83 @@
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+import asyncio
+import logging
+
+from grpclib.client import Channel
+from prometheus_client import Counter
+
+from common.proto.asyncio.optical_attack_detector_grpc import \
+ OpticalAttackDetectorServiceStub
+from common.proto.asyncio.optical_attack_detector_pb2 import DetectionRequest
+
+LOGGER = logging.getLogger(__name__)
+
+
+async def detect_attack(
+ host: str,
+ port: int,
+ context_id: str,
+ service_id: str,
+ kpi_id: str,
+ drop_counter: Counter,
+ timeout: float = 20.0,
+) -> None:
+ try:
+ LOGGER.debug("Sending request for {}...".format(service_id))
+ async with Channel(host, port) as channel:
+ stub = OpticalAttackDetectorServiceStub(channel)
+
+ request: DetectionRequest = DetectionRequest()
+ request.service_id.context_id.context_uuid.uuid = context_id
+ request.service_id.service_uuid.uuid = str(service_id)
+
+ request.kpi_id.kpi_id.uuid = kpi_id
+
+ await stub.DetectAttack(request, timeout=timeout)
+ LOGGER.debug("Monitoring finished for {}/{}".format(service_id, kpi_id))
+ except Exception as e:
+ LOGGER.warning(
+ "Exception while processing service_id {}/{}".format(service_id, kpi_id)
+ )
+ # LOGGER.exception(e)
+ drop_counter.inc()
+
+
+def delegate_services(
+ service_list,
+ start_index: int,
+ end_index: int,
+ host: str,
+ port: str,
+ drop_counter: Counter,
+ monitoring_interval: float,
+):
+ async def run_internal_loop():
+ tasks = []
+ for service in service_list[start_index:end_index]:
+ aw = detect_attack(
+ host,
+ port,
+ service["context"],
+ service["service"],
+ service["kpi"],
+ drop_counter,
+ # allow at most 90% of the monitoring interval to succeed
+ monitoring_interval * 0.9,
+ )
+ tasks.append(aw)
+ [await aw for aw in tasks]
+
+ asyncio.run(run_internal_loop())
diff --git a/src/opticalattackmitigator/.gitlab-ci.yml b/src/opticalattackmitigator/.gitlab-ci.yml
index 92968348b3f7ad9b35f39e6f6d86e5df180499ac..44f13aa20f0a19e24e3188bd0c2315f581b2e006 100644
--- a/src/opticalattackmitigator/.gitlab-ci.yml
+++ b/src/opticalattackmitigator/.gitlab-ci.yml
@@ -21,7 +21,7 @@ build opticalattackmitigator:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/
+ - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile .
- docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
after_script:
@@ -38,7 +38,7 @@ build opticalattackmitigator:
- .gitlab-ci.yml
# apply unit test to the opticalattackmitigator component
-unit test opticalattackmitigator:
+unit_test opticalattackmitigator:
variables:
IMAGE_NAME: 'opticalattackmitigator' # name of the microservice
IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
@@ -51,11 +51,10 @@ unit test opticalattackmitigator:
- if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi
script:
- docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG"
- - docker run --name $IMAGE_NAME -d -p 10007:10007 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
+ - docker run --name $IMAGE_NAME -d -p 10007:10007 -v "$PWD/src/$IMAGE_NAME/tests:/home/${IMAGE_NAME}/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG
- sleep 5
- docker ps -a
- - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml"
- - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing"
+ - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=DEBUG --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/home/${IMAGE_NAME}/results/${IMAGE_NAME}_report.xml; coverage xml -o /home/${IMAGE_NAME}/results/${IMAGE_NAME}_coverage.xml; coverage report --include='${IMAGE_NAME}/*' --show-missing"
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
after_script:
- docker rm -f $IMAGE_NAME
@@ -77,27 +76,27 @@ unit test opticalattackmitigator:
# Deployment of the opticalattackmitigator service in Kubernetes Cluster
-deploy opticalattackmitigator:
- variables:
- IMAGE_NAME: 'opticalattackmitigator' # name of the microservice
- IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
- stage: deploy
- needs:
- - unit test opticalattackmitigator
- # - integ_test execute
- script:
- - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
- - kubectl version
- - kubectl get all
- - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
- - kubectl get all
- # environment:
- # name: test
- # url: https://example.com
- # kubernetes:
- # namespace: test
- rules:
- - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
- when: manual
- - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
- when: manual
\ No newline at end of file
+# deploy opticalattackmitigator:
+# variables:
+# IMAGE_NAME: 'opticalattackmitigator' # name of the microservice
+# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc)
+# stage: deploy
+# needs:
+# - unit test opticalattackmitigator
+# # - integ_test execute
+# script:
+# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml'
+# - kubectl version
+# - kubectl get all
+# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml"
+# - kubectl get all
+# # environment:
+# # name: test
+# # url: https://example.com
+# # kubernetes:
+# # namespace: test
+# rules:
+# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)'
+# when: manual
+# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"'
+# when: manual
\ No newline at end of file
diff --git a/src/opticalattackmitigator/Config.py b/src/opticalattackmitigator/Config.py
index 09ae554ad2e0abce66c7638144c07b2e0b740ae9..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/Config.py
+++ b/src/opticalattackmitigator/Config.py
@@ -11,16 +11,3 @@
# 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.
-
-import logging
-
-# General settings
-LOG_LEVEL = logging.DEBUG
-
-# gRPC settings
-GRPC_SERVICE_PORT = 10007
-GRPC_MAX_WORKERS = 10
-GRPC_GRACE_PERIOD = 60
-
-# Prometheus settings
-METRICS_PORT = 9192
diff --git a/src/opticalattackmitigator/Dockerfile b/src/opticalattackmitigator/Dockerfile
index e3ba175b7616c88b7208c7476195786dffaa83d1..2efb2f4d25d301b47fb9ac87faf6bbc6366f8d48 100644
--- a/src/opticalattackmitigator/Dockerfile
+++ b/src/opticalattackmitigator/Dockerfile
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM python:3-slim
+FROM python:3.9-slim
# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
@@ -27,23 +27,54 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
+# Creating a user for security reasons
+RUN groupadd -r teraflow && useradd -u 1001 --no-log-init -r -m -g teraflow teraflow
+USER teraflow
+
+# set working directory
+RUN mkdir -p /home/teraflow/controller/common/
+WORKDIR /home/teraflow/controller
+
+# Get Python packages per module
+ENV VIRTUAL_ENV=/home/teraflow/venv
+RUN python3 -m venv ${VIRTUAL_ENV}
+ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
+
# Get generic Python packages
-RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools
+RUN python3 -m pip install --upgrade pip
+RUN python3 -m pip install --upgrade setuptools wheel
+RUN python3 -m pip install --upgrade pip-tools
+
+# Get common Python packages
+# Note: this step enables sharing the previous Docker build steps among all the Python components
+COPY --chown=teraflow:teraflow common_requirements.in common_requirements.in
+RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
+RUN python3 -m pip install -r common_requirements.txt
+
+# Add common files into working directory
+WORKDIR /home/teraflow/controller/common
+COPY --chown=teraflow:teraflow src/common/. ./
-# Set working directory
-WORKDIR /var/teraflow
+# Create proto sub-folder, copy .proto files, and generate Python code
+WORKDIR /home/teraflow/controller/common/proto
+RUN touch __init__.py
+COPY --chown=teraflow:teraflow proto/*.proto ./
+RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
+RUN rm *.proto
+RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \;
# Create module sub-folders
-RUN mkdir -p /var/teraflow/opticalattackmitigator
+RUN mkdir -p /home/teraflow/controller/opticalattackmitigator
+WORKDIR /home/teraflow/controller
# Get Python packages per module
-COPY opticalattackmitigator/requirements.in opticalattackmitigator/requirements.in
-RUN pip-compile --output-file=opticalattackmitigator/requirements.txt opticalattackmitigator/requirements.in
+COPY --chown=teraflow:teraflow src/opticalattackmitigator/requirements.in opticalattackmitigator/requirements.in
+# consider common and specific requirements to avoid inconsistencies with dependencies
+RUN pip-compile --quiet --output-file=opticalattackmitigator/requirements.txt opticalattackmitigator/requirements.in common_requirements.in
RUN python3 -m pip install -r opticalattackmitigator/requirements.txt
# Add files into working directory
-COPY common/. common
-COPY opticalattackmitigator/. opticalattackmitigator
+COPY --chown=teraflow:teraflow src/opticalattackmitigator/. opticalattackmitigator
# Start opticalattackmitigator service
ENTRYPOINT ["python", "-m", "opticalattackmitigator.service"]
diff --git a/src/opticalattackmitigator/__init__.py b/src/opticalattackmitigator/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/__init__.py
+++ b/src/opticalattackmitigator/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py b/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py
index 9aa24c696d346f8fb9874412cc1e2e18cfd018fe..4d283202b95a840a6cbe84daf373a806f5a1f463 100644
--- a/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py
+++ b/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py
@@ -12,37 +12,58 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import grpc, logging
-from common.tools.client.RetryDecorator import retry, delay_exponential
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2 import AttackDescription, AttackResponse
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2_grpc import AttackMitigatorStub
+import logging
+
+import grpc
+
+from common.Constants import ServiceNameEnum
+from common.proto.optical_attack_mitigator_pb2 import (AttackDescription,
+ AttackResponse)
+from common.proto.optical_attack_mitigator_pb2_grpc import AttackMitigatorStub
+from common.Settings import get_service_host, get_service_port_grpc
+from common.tools.client.RetryDecorator import delay_exponential, retry
+from common.tools.grpc.Tools import grpc_message_to_json
LOGGER = logging.getLogger(__name__)
MAX_RETRIES = 15
DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0)
-RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect')
+RETRY_DECORATOR = retry(
+ max_retries=MAX_RETRIES,
+ delay_function=DELAY_FUNCTION,
+ prepare_method_name="connect",
+)
+
class OpticalAttackMitigatorClient:
- def __init__(self, address, port):
- self.endpoint = '{:s}:{:s}'.format(str(address), str(port))
- LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint)))
+ def __init__(self, host=None, port=None):
+ if not host:
+ host = get_service_host(ServiceNameEnum.OPTICALATTACKMITIGATOR)
+ if not port:
+ port = get_service_port_grpc(ServiceNameEnum.OPTICALATTACKMITIGATOR)
+ self.endpoint = "{:s}:{:s}".format(str(host), str(port))
+ LOGGER.debug("Creating channel to {:s}...".format(str(self.endpoint)))
self.channel = None
self.stub = None
self.connect()
- LOGGER.debug('Channel created')
+ LOGGER.debug("Channel created")
def connect(self):
self.channel = grpc.insecure_channel(self.endpoint)
self.stub = AttackMitigatorStub(self.channel)
def close(self):
- if(self.channel is not None): self.channel.close()
+ if self.channel is not None:
+ self.channel.close()
self.channel = None
self.stub = None
@RETRY_DECORATOR
- def NotifyAttack(self, request : AttackDescription) -> AttackResponse:
- LOGGER.debug('NotifyAttack request: {:s}'.format(str(request)))
+ def NotifyAttack(self, request: AttackDescription) -> AttackResponse:
+ LOGGER.debug(
+ "NotifyAttack request: {:s}".format(str(grpc_message_to_json(request)))
+ )
response = self.stub.NotifyAttack(request)
- LOGGER.debug('NotifyAttack result: {:s}'.format(str(response)))
+ LOGGER.debug(
+ "NotifyAttack result: {:s}".format(str(grpc_message_to_json(response)))
+ )
return response
diff --git a/src/opticalattackmitigator/client/__init__.py b/src/opticalattackmitigator/client/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/client/__init__.py
+++ b/src/opticalattackmitigator/client/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackmitigator/genproto.sh b/src/opticalattackmitigator/genproto.sh
deleted file mode 100755
index 4cb0103b2428605c32cebc142c39dcdc764a3551..0000000000000000000000000000000000000000
--- a/src/opticalattackmitigator/genproto.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash -eu
-#
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-# Make folder containing the script the root folder for its execution
-cd $(dirname $0)
-
-rm -rf proto/*.py
-rm -rf proto/__pycache__
-tee proto/__init__.py << EOF > /dev/null
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-EOF
-
-# building protos of services used
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto
-
-rm proto/context_pb2_grpc.py
-rm proto/kpi_sample_types_pb2_grpc.py
-
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py
-
-# building current service protos
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto optical_attack_mitigator.proto
-
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/optical_attack_mitigator_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/optical_attack_mitigator_pb2_grpc.py
diff --git a/src/opticalattackmitigator/proto/context_pb2.py b/src/opticalattackmitigator/proto/context_pb2.py
deleted file mode 100644
index 50d501d3ac053ad644554331af26e3c40cd426a1..0000000000000000000000000000000000000000
--- a/src/opticalattackmitigator/proto/context_pb2.py
+++ /dev/null
@@ -1,3071 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: context.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import kpi_sample_types_pb2 as kpi__sample__types__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='context.proto',
- package='context',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3'
- ,
- dependencies=[kpi__sample__types__pb2.DESCRIPTOR,])
-
-_EVENTTYPEENUM = _descriptor.EnumDescriptor(
- name='EventTypeEnum',
- full_name='context.EventTypeEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_CREATE', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_UPDATE', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_REMOVE', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4310,
- serialized_end=4416,
-)
-_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM)
-
-EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM)
-_DEVICEDRIVERENUM = _descriptor.EnumDescriptor(
- name='DeviceDriverEnum',
- full_name='context.DeviceDriverEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_OPENCONFIG', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_P4', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_ONF_TR_352', index=5, number=5,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4419,
- serialized_end=4616,
-)
-_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM)
-
-DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM)
-_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor(
- name='DeviceOperationalStatusEnum',
- full_name='context.DeviceOperationalStatusEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4619,
- serialized_end=4762,
-)
-_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM)
-
-DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM)
-_SERVICETYPEENUM = _descriptor.EnumDescriptor(
- name='ServiceTypeEnum',
- full_name='context.ServiceTypeEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_UNKNOWN', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_L3NM', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_L2NM', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4765,
- serialized_end=4894,
-)
-_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM)
-
-ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM)
-_SERVICESTATUSENUM = _descriptor.EnumDescriptor(
- name='ServiceStatusEnum',
- full_name='context.ServiceStatusEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_PLANNED', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_ACTIVE', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4897,
- serialized_end=5033,
-)
-_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM)
-
-ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM)
-_SLICESTATUSENUM = _descriptor.EnumDescriptor(
- name='SliceStatusEnum',
- full_name='context.SliceStatusEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_PLANNED', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_INIT', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_ACTIVE', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_DEINIT', index=4, number=4,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=5036,
- serialized_end=5175,
-)
-_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM)
-
-SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM)
-_CONFIGACTIONENUM = _descriptor.EnumDescriptor(
- name='ConfigActionEnum',
- full_name='context.ConfigActionEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='CONFIGACTION_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='CONFIGACTION_SET', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='CONFIGACTION_DELETE', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=5177,
- serialized_end=5270,
-)
-_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM)
-
-ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM)
-EVENTTYPE_UNDEFINED = 0
-EVENTTYPE_CREATE = 1
-EVENTTYPE_UPDATE = 2
-EVENTTYPE_REMOVE = 3
-DEVICEDRIVER_UNDEFINED = 0
-DEVICEDRIVER_OPENCONFIG = 1
-DEVICEDRIVER_TRANSPORT_API = 2
-DEVICEDRIVER_P4 = 3
-DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4
-DEVICEDRIVER_ONF_TR_352 = 5
-DEVICEOPERATIONALSTATUS_UNDEFINED = 0
-DEVICEOPERATIONALSTATUS_DISABLED = 1
-DEVICEOPERATIONALSTATUS_ENABLED = 2
-SERVICETYPE_UNKNOWN = 0
-SERVICETYPE_L3NM = 1
-SERVICETYPE_L2NM = 2
-SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3
-SERVICESTATUS_UNDEFINED = 0
-SERVICESTATUS_PLANNED = 1
-SERVICESTATUS_ACTIVE = 2
-SERVICESTATUS_PENDING_REMOVAL = 3
-SLICESTATUS_UNDEFINED = 0
-SLICESTATUS_PLANNED = 1
-SLICESTATUS_INIT = 2
-SLICESTATUS_ACTIVE = 3
-SLICESTATUS_DEINIT = 4
-CONFIGACTION_UNDEFINED = 0
-CONFIGACTION_SET = 1
-CONFIGACTION_DELETE = 2
-
-
-
-_EMPTY = _descriptor.Descriptor(
- name='Empty',
- full_name='context.Empty',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=50,
- serialized_end=57,
-)
-
-
-_UUID = _descriptor.Descriptor(
- name='Uuid',
- full_name='context.Uuid',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='uuid', full_name='context.Uuid.uuid', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=59,
- serialized_end=79,
-)
-
-
-_EVENT = _descriptor.Descriptor(
- name='Event',
- full_name='context.Event',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='timestamp', full_name='context.Event.timestamp', index=0,
- number=1, type=1, cpp_type=5, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='event_type', full_name='context.Event.event_type', index=1,
- number=2, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=81,
- serialized_end=151,
-)
-
-
-_CONTEXTID = _descriptor.Descriptor(
- name='ContextId',
- full_name='context.ContextId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_uuid', full_name='context.ContextId.context_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=153,
- serialized_end=201,
-)
-
-
-_CONTEXT = _descriptor.Descriptor(
- name='Context',
- full_name='context.Context',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.Context.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='topology_ids', full_name='context.Context.topology_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_ids', full_name='context.Context.service_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='controller', full_name='context.Context.controller', index=3,
- number=4, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=204,
- serialized_end=386,
-)
-
-
-_CONTEXTIDLIST = _descriptor.Descriptor(
- name='ContextIdList',
- full_name='context.ContextIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_ids', full_name='context.ContextIdList.context_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=388,
- serialized_end=444,
-)
-
-
-_CONTEXTLIST = _descriptor.Descriptor(
- name='ContextList',
- full_name='context.ContextList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='contexts', full_name='context.ContextList.contexts', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=446,
- serialized_end=495,
-)
-
-
-_CONTEXTEVENT = _descriptor.Descriptor(
- name='ContextEvent',
- full_name='context.ContextEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.ContextEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.ContextEvent.context_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=497,
- serialized_end=582,
-)
-
-
-_TOPOLOGYID = _descriptor.Descriptor(
- name='TopologyId',
- full_name='context.TopologyId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.TopologyId.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=584,
- serialized_end=674,
-)
-
-
-_TOPOLOGY = _descriptor.Descriptor(
- name='Topology',
- full_name='context.Topology',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topology_id', full_name='context.Topology.topology_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_ids', full_name='context.Topology.device_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='link_ids', full_name='context.Topology.link_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=676,
- serialized_end=802,
-)
-
-
-_TOPOLOGYIDLIST = _descriptor.Descriptor(
- name='TopologyIdList',
- full_name='context.TopologyIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=804,
- serialized_end=863,
-)
-
-
-_TOPOLOGYLIST = _descriptor.Descriptor(
- name='TopologyList',
- full_name='context.TopologyList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topologies', full_name='context.TopologyList.topologies', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=865,
- serialized_end=918,
-)
-
-
-_TOPOLOGYEVENT = _descriptor.Descriptor(
- name='TopologyEvent',
- full_name='context.TopologyEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.TopologyEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='topology_id', full_name='context.TopologyEvent.topology_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=920,
- serialized_end=1008,
-)
-
-
-_DEVICEID = _descriptor.Descriptor(
- name='DeviceId',
- full_name='context.DeviceId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='device_uuid', full_name='context.DeviceId.device_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1010,
- serialized_end=1056,
-)
-
-
-_DEVICE = _descriptor.Descriptor(
- name='Device',
- full_name='context.Device',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='device_id', full_name='context.Device.device_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_type', full_name='context.Device.device_type', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_config', full_name='context.Device.device_config', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_operational_status', full_name='context.Device.device_operational_status', index=3,
- number=4, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_drivers', full_name='context.Device.device_drivers', index=4,
- number=5, type=14, cpp_type=8, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_endpoints', full_name='context.Device.device_endpoints', index=5,
- number=6, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1059,
- serialized_end=1341,
-)
-
-
-_DEVICECONFIG = _descriptor.Descriptor(
- name='DeviceConfig',
- full_name='context.DeviceConfig',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='config_rules', full_name='context.DeviceConfig.config_rules', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1343,
- serialized_end=1400,
-)
-
-
-_DEVICEIDLIST = _descriptor.Descriptor(
- name='DeviceIdList',
- full_name='context.DeviceIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='device_ids', full_name='context.DeviceIdList.device_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1402,
- serialized_end=1455,
-)
-
-
-_DEVICELIST = _descriptor.Descriptor(
- name='DeviceList',
- full_name='context.DeviceList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='devices', full_name='context.DeviceList.devices', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1457,
- serialized_end=1503,
-)
-
-
-_DEVICEEVENT = _descriptor.Descriptor(
- name='DeviceEvent',
- full_name='context.DeviceEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.DeviceEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_id', full_name='context.DeviceEvent.device_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1505,
- serialized_end=1587,
-)
-
-
-_LINKID = _descriptor.Descriptor(
- name='LinkId',
- full_name='context.LinkId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='link_uuid', full_name='context.LinkId.link_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1589,
- serialized_end=1631,
-)
-
-
-_LINK = _descriptor.Descriptor(
- name='Link',
- full_name='context.Link',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='link_id', full_name='context.Link.link_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1633,
- serialized_end=1721,
-)
-
-
-_LINKIDLIST = _descriptor.Descriptor(
- name='LinkIdList',
- full_name='context.LinkIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='link_ids', full_name='context.LinkIdList.link_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1723,
- serialized_end=1770,
-)
-
-
-_LINKLIST = _descriptor.Descriptor(
- name='LinkList',
- full_name='context.LinkList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='links', full_name='context.LinkList.links', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1772,
- serialized_end=1812,
-)
-
-
-_LINKEVENT = _descriptor.Descriptor(
- name='LinkEvent',
- full_name='context.LinkEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.LinkEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='link_id', full_name='context.LinkEvent.link_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1814,
- serialized_end=1890,
-)
-
-
-_SERVICEID = _descriptor.Descriptor(
- name='ServiceId',
- full_name='context.ServiceId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.ServiceId.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_uuid', full_name='context.ServiceId.service_uuid', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1892,
- serialized_end=1980,
-)
-
-
-_SERVICE = _descriptor.Descriptor(
- name='Service',
- full_name='context.Service',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='service_id', full_name='context.Service.service_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_type', full_name='context.Service.service_type', index=1,
- number=2, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_constraints', full_name='context.Service.service_constraints', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_status', full_name='context.Service.service_status', index=4,
- number=5, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_config', full_name='context.Service.service_config', index=5,
- number=6, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1983,
- serialized_end=2277,
-)
-
-
-_SERVICESTATUS = _descriptor.Descriptor(
- name='ServiceStatus',
- full_name='context.ServiceStatus',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='service_status', full_name='context.ServiceStatus.service_status', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2279,
- serialized_end=2346,
-)
-
-
-_SERVICECONFIG = _descriptor.Descriptor(
- name='ServiceConfig',
- full_name='context.ServiceConfig',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='config_rules', full_name='context.ServiceConfig.config_rules', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2348,
- serialized_end=2406,
-)
-
-
-_SERVICEIDLIST = _descriptor.Descriptor(
- name='ServiceIdList',
- full_name='context.ServiceIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='service_ids', full_name='context.ServiceIdList.service_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2408,
- serialized_end=2464,
-)
-
-
-_SERVICELIST = _descriptor.Descriptor(
- name='ServiceList',
- full_name='context.ServiceList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='services', full_name='context.ServiceList.services', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2466,
- serialized_end=2515,
-)
-
-
-_SERVICEEVENT = _descriptor.Descriptor(
- name='ServiceEvent',
- full_name='context.ServiceEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.ServiceEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_id', full_name='context.ServiceEvent.service_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2517,
- serialized_end=2602,
-)
-
-
-_SLICEID = _descriptor.Descriptor(
- name='SliceId',
- full_name='context.SliceId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.SliceId.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2604,
- serialized_end=2688,
-)
-
-
-_SLICE = _descriptor.Descriptor(
- name='Slice',
- full_name='context.Slice',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slice_id', full_name='context.Slice.slice_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_constraints', full_name='context.Slice.slice_constraints', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4,
- number=5, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_status', full_name='context.Slice.slice_status', index=5,
- number=6, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2691,
- serialized_end=2968,
-)
-
-
-_SLICESTATUS = _descriptor.Descriptor(
- name='SliceStatus',
- full_name='context.SliceStatus',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slice_status', full_name='context.SliceStatus.slice_status', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2970,
- serialized_end=3031,
-)
-
-
-_SLICEIDLIST = _descriptor.Descriptor(
- name='SliceIdList',
- full_name='context.SliceIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3033,
- serialized_end=3083,
-)
-
-
-_SLICELIST = _descriptor.Descriptor(
- name='SliceList',
- full_name='context.SliceList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slices', full_name='context.SliceList.slices', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3085,
- serialized_end=3128,
-)
-
-
-_SLICEEVENT = _descriptor.Descriptor(
- name='SliceEvent',
- full_name='context.SliceEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.SliceEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_id', full_name='context.SliceEvent.slice_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3130,
- serialized_end=3209,
-)
-
-
-_CONNECTIONID = _descriptor.Descriptor(
- name='ConnectionId',
- full_name='context.ConnectionId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3211,
- serialized_end=3265,
-)
-
-
-_CONNECTION = _descriptor.Descriptor(
- name='Connection',
- full_name='context.Connection',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connection_id', full_name='context.Connection.connection_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_id', full_name='context.Connection.service_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3268,
- serialized_end=3464,
-)
-
-
-_CONNECTIONIDLIST = _descriptor.Descriptor(
- name='ConnectionIdList',
- full_name='context.ConnectionIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3466,
- serialized_end=3531,
-)
-
-
-_CONNECTIONLIST = _descriptor.Descriptor(
- name='ConnectionList',
- full_name='context.ConnectionList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connections', full_name='context.ConnectionList.connections', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3533,
- serialized_end=3591,
-)
-
-
-_CONNECTIONEVENT = _descriptor.Descriptor(
- name='ConnectionEvent',
- full_name='context.ConnectionEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.ConnectionEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3593,
- serialized_end=3687,
-)
-
-
-_ENDPOINTID = _descriptor.Descriptor(
- name='EndPointId',
- full_name='context.EndPointId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topology_id', full_name='context.EndPointId.topology_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_id', full_name='context.EndPointId.device_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3690,
- serialized_end=3820,
-)
-
-
-_ENDPOINT = _descriptor.Descriptor(
- name='EndPoint',
- full_name='context.EndPoint',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2,
- number=3, type=14, cpp_type=8, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3823,
- serialized_end=3957,
-)
-
-
-_CONFIGRULE = _descriptor.Descriptor(
- name='ConfigRule',
- full_name='context.ConfigRule',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='action', full_name='context.ConfigRule.action', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='resource_key', full_name='context.ConfigRule.resource_key', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='resource_value', full_name='context.ConfigRule.resource_value', index=2,
- number=3, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3959,
- serialized_end=4060,
-)
-
-
-_CONSTRAINT = _descriptor.Descriptor(
- name='Constraint',
- full_name='context.Constraint',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='constraint_type', full_name='context.Constraint.constraint_type', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='constraint_value', full_name='context.Constraint.constraint_value', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=4062,
- serialized_end=4125,
-)
-
-
-_TERAFLOWCONTROLLER = _descriptor.Descriptor(
- name='TeraFlowController',
- full_name='context.TeraFlowController',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.TeraFlowController.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='ip_address', full_name='context.TeraFlowController.ip_address', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='port', full_name='context.TeraFlowController.port', index=2,
- number=3, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=4127,
- serialized_end=4221,
-)
-
-
-_AUTHENTICATIONRESULT = _descriptor.Descriptor(
- name='AuthenticationResult',
- full_name='context.AuthenticationResult',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.AuthenticationResult.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1,
- number=2, type=8, cpp_type=7, label=1,
- has_default_value=False, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=4223,
- serialized_end=4308,
-)
-
-_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM
-_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID
-_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID
-_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID
-_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID
-_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER
-_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID
-_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT
-_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT
-_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID
-_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID
-_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID
-_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID
-_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID
-_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID
-_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID
-_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY
-_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT
-_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID
-_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID
-_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID
-_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG
-_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM
-_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM
-_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT
-_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE
-_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID
-_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE
-_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT
-_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID
-_LINKID.fields_by_name['link_uuid'].message_type = _UUID
-_LINK.fields_by_name['link_id'].message_type = _LINKID
-_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID
-_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID
-_LINKLIST.fields_by_name['links'].message_type = _LINK
-_LINKEVENT.fields_by_name['event'].message_type = _EVENT
-_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID
-_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID
-_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID
-_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID
-_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM
-_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID
-_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT
-_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS
-_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG
-_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM
-_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE
-_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID
-_SERVICELIST.fields_by_name['services'].message_type = _SERVICE
-_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT
-_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID
-_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID
-_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID
-_SLICE.fields_by_name['slice_id'].message_type = _SLICEID
-_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID
-_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT
-_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID
-_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID
-_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS
-_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM
-_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID
-_SLICELIST.fields_by_name['slices'].message_type = _SLICE
-_SLICEEVENT.fields_by_name['event'].message_type = _EVENT
-_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID
-_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID
-_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID
-_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID
-_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID
-_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID
-_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID
-_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION
-_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT
-_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID
-_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID
-_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID
-_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID
-_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID
-_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE
-_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM
-_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID
-_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID
-DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY
-DESCRIPTOR.message_types_by_name['Uuid'] = _UUID
-DESCRIPTOR.message_types_by_name['Event'] = _EVENT
-DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID
-DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT
-DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST
-DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST
-DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT
-DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID
-DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY
-DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST
-DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST
-DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT
-DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID
-DESCRIPTOR.message_types_by_name['Device'] = _DEVICE
-DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG
-DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST
-DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST
-DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT
-DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID
-DESCRIPTOR.message_types_by_name['Link'] = _LINK
-DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST
-DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST
-DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT
-DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID
-DESCRIPTOR.message_types_by_name['Service'] = _SERVICE
-DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS
-DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG
-DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST
-DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST
-DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT
-DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID
-DESCRIPTOR.message_types_by_name['Slice'] = _SLICE
-DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS
-DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST
-DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST
-DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT
-DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID
-DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION
-DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST
-DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST
-DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT
-DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID
-DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT
-DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE
-DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT
-DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER
-DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT
-DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM
-DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM
-DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM
-DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM
-DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM
-DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM
-DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), {
- 'DESCRIPTOR' : _EMPTY,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Empty)
- })
-_sym_db.RegisterMessage(Empty)
-
-Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), {
- 'DESCRIPTOR' : _UUID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Uuid)
- })
-_sym_db.RegisterMessage(Uuid)
-
-Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), {
- 'DESCRIPTOR' : _EVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Event)
- })
-_sym_db.RegisterMessage(Event)
-
-ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextId)
- })
-_sym_db.RegisterMessage(ContextId)
-
-Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Context)
- })
-_sym_db.RegisterMessage(Context)
-
-ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextIdList)
- })
-_sym_db.RegisterMessage(ContextIdList)
-
-ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextList)
- })
-_sym_db.RegisterMessage(ContextList)
-
-ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextEvent)
- })
-_sym_db.RegisterMessage(ContextEvent)
-
-TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyId)
- })
-_sym_db.RegisterMessage(TopologyId)
-
-Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGY,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Topology)
- })
-_sym_db.RegisterMessage(Topology)
-
-TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyIdList)
- })
-_sym_db.RegisterMessage(TopologyIdList)
-
-TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyList)
- })
-_sym_db.RegisterMessage(TopologyList)
-
-TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyEvent)
- })
-_sym_db.RegisterMessage(TopologyEvent)
-
-DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICEID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceId)
- })
-_sym_db.RegisterMessage(DeviceId)
-
-Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Device)
- })
-_sym_db.RegisterMessage(Device)
-
-DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICECONFIG,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceConfig)
- })
-_sym_db.RegisterMessage(DeviceConfig)
-
-DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICEIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceIdList)
- })
-_sym_db.RegisterMessage(DeviceIdList)
-
-DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICELIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceList)
- })
-_sym_db.RegisterMessage(DeviceList)
-
-DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICEEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceEvent)
- })
-_sym_db.RegisterMessage(DeviceEvent)
-
-LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), {
- 'DESCRIPTOR' : _LINKID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkId)
- })
-_sym_db.RegisterMessage(LinkId)
-
-Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), {
- 'DESCRIPTOR' : _LINK,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Link)
- })
-_sym_db.RegisterMessage(Link)
-
-LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), {
- 'DESCRIPTOR' : _LINKIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkIdList)
- })
-_sym_db.RegisterMessage(LinkIdList)
-
-LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), {
- 'DESCRIPTOR' : _LINKLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkList)
- })
-_sym_db.RegisterMessage(LinkList)
-
-LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), {
- 'DESCRIPTOR' : _LINKEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkEvent)
- })
-_sym_db.RegisterMessage(LinkEvent)
-
-ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICEID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceId)
- })
-_sym_db.RegisterMessage(ServiceId)
-
-Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Service)
- })
-_sym_db.RegisterMessage(Service)
-
-ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICESTATUS,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceStatus)
- })
-_sym_db.RegisterMessage(ServiceStatus)
-
-ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICECONFIG,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceConfig)
- })
-_sym_db.RegisterMessage(ServiceConfig)
-
-ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICEIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceIdList)
- })
-_sym_db.RegisterMessage(ServiceIdList)
-
-ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICELIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceList)
- })
-_sym_db.RegisterMessage(ServiceList)
-
-ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICEEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceEvent)
- })
-_sym_db.RegisterMessage(ServiceEvent)
-
-SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), {
- 'DESCRIPTOR' : _SLICEID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceId)
- })
-_sym_db.RegisterMessage(SliceId)
-
-Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), {
- 'DESCRIPTOR' : _SLICE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Slice)
- })
-_sym_db.RegisterMessage(Slice)
-
-SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), {
- 'DESCRIPTOR' : _SLICESTATUS,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceStatus)
- })
-_sym_db.RegisterMessage(SliceStatus)
-
-SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), {
- 'DESCRIPTOR' : _SLICEIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceIdList)
- })
-_sym_db.RegisterMessage(SliceIdList)
-
-SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), {
- 'DESCRIPTOR' : _SLICELIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceList)
- })
-_sym_db.RegisterMessage(SliceList)
-
-SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), {
- 'DESCRIPTOR' : _SLICEEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceEvent)
- })
-_sym_db.RegisterMessage(SliceEvent)
-
-ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionId)
- })
-_sym_db.RegisterMessage(ConnectionId)
-
-Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTION,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Connection)
- })
-_sym_db.RegisterMessage(Connection)
-
-ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionIdList)
- })
-_sym_db.RegisterMessage(ConnectionIdList)
-
-ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionList)
- })
-_sym_db.RegisterMessage(ConnectionList)
-
-ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionEvent)
- })
-_sym_db.RegisterMessage(ConnectionEvent)
-
-EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), {
- 'DESCRIPTOR' : _ENDPOINTID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.EndPointId)
- })
-_sym_db.RegisterMessage(EndPointId)
-
-EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), {
- 'DESCRIPTOR' : _ENDPOINT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.EndPoint)
- })
-_sym_db.RegisterMessage(EndPoint)
-
-ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIGRULE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConfigRule)
- })
-_sym_db.RegisterMessage(ConfigRule)
-
-Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), {
- 'DESCRIPTOR' : _CONSTRAINT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Constraint)
- })
-_sym_db.RegisterMessage(Constraint)
-
-TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), {
- 'DESCRIPTOR' : _TERAFLOWCONTROLLER,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TeraFlowController)
- })
-_sym_db.RegisterMessage(TeraFlowController)
-
-AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), {
- 'DESCRIPTOR' : _AUTHENTICATIONRESULT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.AuthenticationResult)
- })
-_sym_db.RegisterMessage(AuthenticationResult)
-
-
-
-_CONTEXTSERVICE = _descriptor.ServiceDescriptor(
- name='ContextService',
- full_name='context.ContextService',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=5273,
- serialized_end=7688,
- methods=[
- _descriptor.MethodDescriptor(
- name='ListContextIds',
- full_name='context.ContextService.ListContextIds',
- index=0,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONTEXTIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListContexts',
- full_name='context.ContextService.ListContexts',
- index=1,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONTEXTLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetContext',
- full_name='context.ContextService.GetContext',
- index=2,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_CONTEXT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetContext',
- full_name='context.ContextService.SetContext',
- index=3,
- containing_service=None,
- input_type=_CONTEXT,
- output_type=_CONTEXTID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveContext',
- full_name='context.ContextService.RemoveContext',
- index=4,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetContextEvents',
- full_name='context.ContextService.GetContextEvents',
- index=5,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONTEXTEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListTopologyIds',
- full_name='context.ContextService.ListTopologyIds',
- index=6,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_TOPOLOGYIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListTopologies',
- full_name='context.ContextService.ListTopologies',
- index=7,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_TOPOLOGYLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetTopology',
- full_name='context.ContextService.GetTopology',
- index=8,
- containing_service=None,
- input_type=_TOPOLOGYID,
- output_type=_TOPOLOGY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetTopology',
- full_name='context.ContextService.SetTopology',
- index=9,
- containing_service=None,
- input_type=_TOPOLOGY,
- output_type=_TOPOLOGYID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveTopology',
- full_name='context.ContextService.RemoveTopology',
- index=10,
- containing_service=None,
- input_type=_TOPOLOGYID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetTopologyEvents',
- full_name='context.ContextService.GetTopologyEvents',
- index=11,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_TOPOLOGYEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListDeviceIds',
- full_name='context.ContextService.ListDeviceIds',
- index=12,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_DEVICEIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListDevices',
- full_name='context.ContextService.ListDevices',
- index=13,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_DEVICELIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetDevice',
- full_name='context.ContextService.GetDevice',
- index=14,
- containing_service=None,
- input_type=_DEVICEID,
- output_type=_DEVICE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetDevice',
- full_name='context.ContextService.SetDevice',
- index=15,
- containing_service=None,
- input_type=_DEVICE,
- output_type=_DEVICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveDevice',
- full_name='context.ContextService.RemoveDevice',
- index=16,
- containing_service=None,
- input_type=_DEVICEID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetDeviceEvents',
- full_name='context.ContextService.GetDeviceEvents',
- index=17,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_DEVICEEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListLinkIds',
- full_name='context.ContextService.ListLinkIds',
- index=18,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_LINKIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListLinks',
- full_name='context.ContextService.ListLinks',
- index=19,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_LINKLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetLink',
- full_name='context.ContextService.GetLink',
- index=20,
- containing_service=None,
- input_type=_LINKID,
- output_type=_LINK,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetLink',
- full_name='context.ContextService.SetLink',
- index=21,
- containing_service=None,
- input_type=_LINK,
- output_type=_LINKID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveLink',
- full_name='context.ContextService.RemoveLink',
- index=22,
- containing_service=None,
- input_type=_LINKID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetLinkEvents',
- full_name='context.ContextService.GetLinkEvents',
- index=23,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_LINKEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListServiceIds',
- full_name='context.ContextService.ListServiceIds',
- index=24,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SERVICEIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListServices',
- full_name='context.ContextService.ListServices',
- index=25,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SERVICELIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetService',
- full_name='context.ContextService.GetService',
- index=26,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_SERVICE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetService',
- full_name='context.ContextService.SetService',
- index=27,
- containing_service=None,
- input_type=_SERVICE,
- output_type=_SERVICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveService',
- full_name='context.ContextService.RemoveService',
- index=28,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetServiceEvents',
- full_name='context.ContextService.GetServiceEvents',
- index=29,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_SERVICEEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListSliceIds',
- full_name='context.ContextService.ListSliceIds',
- index=30,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SLICEIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListSlices',
- full_name='context.ContextService.ListSlices',
- index=31,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SLICELIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetSlice',
- full_name='context.ContextService.GetSlice',
- index=32,
- containing_service=None,
- input_type=_SLICEID,
- output_type=_SLICE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetSlice',
- full_name='context.ContextService.SetSlice',
- index=33,
- containing_service=None,
- input_type=_SLICE,
- output_type=_SLICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveSlice',
- full_name='context.ContextService.RemoveSlice',
- index=34,
- containing_service=None,
- input_type=_SLICEID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetSliceEvents',
- full_name='context.ContextService.GetSliceEvents',
- index=35,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_SLICEEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListConnectionIds',
- full_name='context.ContextService.ListConnectionIds',
- index=36,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_CONNECTIONIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListConnections',
- full_name='context.ContextService.ListConnections',
- index=37,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_CONNECTIONLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetConnection',
- full_name='context.ContextService.GetConnection',
- index=38,
- containing_service=None,
- input_type=_CONNECTIONID,
- output_type=_CONNECTION,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetConnection',
- full_name='context.ContextService.SetConnection',
- index=39,
- containing_service=None,
- input_type=_CONNECTION,
- output_type=_CONNECTIONID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveConnection',
- full_name='context.ContextService.RemoveConnection',
- index=40,
- containing_service=None,
- input_type=_CONNECTIONID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetConnectionEvents',
- full_name='context.ContextService.GetConnectionEvents',
- index=41,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONNECTIONEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE)
-
-DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalattackmitigator/proto/kpi_sample_types_pb2.py b/src/opticalattackmitigator/proto/kpi_sample_types_pb2.py
deleted file mode 100644
index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000
--- a/src/opticalattackmitigator/proto/kpi_sample_types_pb2.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: kpi_sample_types.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='kpi_sample_types.proto',
- package='kpi_sample_types',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3'
-)
-
-_KPISAMPLETYPE = _descriptor.EnumDescriptor(
- name='KpiSampleType',
- full_name='kpi_sample_types.KpiSampleType',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_UNKNOWN', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=45,
- serialized_end=235,
-)
-_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE)
-
-KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE)
-KPISAMPLETYPE_UNKNOWN = 0
-KPISAMPLETYPE_PACKETS_TRANSMITTED = 101
-KPISAMPLETYPE_PACKETS_RECEIVED = 102
-KPISAMPLETYPE_BYTES_TRANSMITTED = 201
-KPISAMPLETYPE_BYTES_RECEIVED = 202
-
-
-DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalattackmitigator/proto/optical_attack_mitigator_pb2.py b/src/opticalattackmitigator/proto/optical_attack_mitigator_pb2.py
deleted file mode 100644
index 651c1b8e9cff9db06021a4b45934f3676a9f9f5e..0000000000000000000000000000000000000000
--- a/src/opticalattackmitigator/proto/optical_attack_mitigator_pb2.py
+++ /dev/null
@@ -1,189 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: optical_attack_mitigator.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import context_pb2 as context__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='optical_attack_mitigator.proto',
- package='optical_attack_mitigator',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x1eoptical_attack_mitigator.proto\x12\x18optical_attack_mitigator\x1a\rcontext.proto\"t\n\x11\x41ttackDescription\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x12\n\nconfidence\x18\x03 \x01(\x02\x12\x1a\n\x12\x61ttack_description\x18\x04 \x01(\t\"\xa2\x01\n\x0e\x41ttackResponse\x12\x1c\n\x05\x63s_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\x12\x11\n\tattack_id\x18\x02 \x01(\x05\x12\x1a\n\x12\x61ttack_description\x18\x03 \x01(\t\x12\x1c\n\x14response_strategy_id\x18\x04 \x01(\x05\x12%\n\x1dresponse_strategy_description\x18\x05 \x01(\t2z\n\x0f\x41ttackMitigator\x12g\n\x0cNotifyAttack\x12+.optical_attack_mitigator.AttackDescription\x1a(.optical_attack_mitigator.AttackResponse\"\x00\x62\x06proto3'
- ,
- dependencies=[context__pb2.DESCRIPTOR,])
-
-
-
-
-_ATTACKDESCRIPTION = _descriptor.Descriptor(
- name='AttackDescription',
- full_name='optical_attack_mitigator.AttackDescription',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='cs_id', full_name='optical_attack_mitigator.AttackDescription.cs_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='attack_id', full_name='optical_attack_mitigator.AttackDescription.attack_id', index=1,
- number=2, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='confidence', full_name='optical_attack_mitigator.AttackDescription.confidence', index=2,
- number=3, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='attack_description', full_name='optical_attack_mitigator.AttackDescription.attack_description', index=3,
- number=4, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=75,
- serialized_end=191,
-)
-
-
-_ATTACKRESPONSE = _descriptor.Descriptor(
- name='AttackResponse',
- full_name='optical_attack_mitigator.AttackResponse',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='cs_id', full_name='optical_attack_mitigator.AttackResponse.cs_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='attack_id', full_name='optical_attack_mitigator.AttackResponse.attack_id', index=1,
- number=2, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='attack_description', full_name='optical_attack_mitigator.AttackResponse.attack_description', index=2,
- number=3, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='response_strategy_id', full_name='optical_attack_mitigator.AttackResponse.response_strategy_id', index=3,
- number=4, type=5, cpp_type=1, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='response_strategy_description', full_name='optical_attack_mitigator.AttackResponse.response_strategy_description', index=4,
- number=5, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=194,
- serialized_end=356,
-)
-
-_ATTACKDESCRIPTION.fields_by_name['cs_id'].message_type = context__pb2._UUID
-_ATTACKRESPONSE.fields_by_name['cs_id'].message_type = context__pb2._UUID
-DESCRIPTOR.message_types_by_name['AttackDescription'] = _ATTACKDESCRIPTION
-DESCRIPTOR.message_types_by_name['AttackResponse'] = _ATTACKRESPONSE
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-AttackDescription = _reflection.GeneratedProtocolMessageType('AttackDescription', (_message.Message,), {
- 'DESCRIPTOR' : _ATTACKDESCRIPTION,
- '__module__' : 'optical_attack_mitigator_pb2'
- # @@protoc_insertion_point(class_scope:optical_attack_mitigator.AttackDescription)
- })
-_sym_db.RegisterMessage(AttackDescription)
-
-AttackResponse = _reflection.GeneratedProtocolMessageType('AttackResponse', (_message.Message,), {
- 'DESCRIPTOR' : _ATTACKRESPONSE,
- '__module__' : 'optical_attack_mitigator_pb2'
- # @@protoc_insertion_point(class_scope:optical_attack_mitigator.AttackResponse)
- })
-_sym_db.RegisterMessage(AttackResponse)
-
-
-
-_ATTACKMITIGATOR = _descriptor.ServiceDescriptor(
- name='AttackMitigator',
- full_name='optical_attack_mitigator.AttackMitigator',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=358,
- serialized_end=480,
- methods=[
- _descriptor.MethodDescriptor(
- name='NotifyAttack',
- full_name='optical_attack_mitigator.AttackMitigator.NotifyAttack',
- index=0,
- containing_service=None,
- input_type=_ATTACKDESCRIPTION,
- output_type=_ATTACKRESPONSE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_ATTACKMITIGATOR)
-
-DESCRIPTOR.services_by_name['AttackMitigator'] = _ATTACKMITIGATOR
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalattackmitigator/proto/optical_attack_mitigator_pb2_grpc.py b/src/opticalattackmitigator/proto/optical_attack_mitigator_pb2_grpc.py
deleted file mode 100644
index 2f12816a1f909e073ece0ad5a4b3d8fda4235d89..0000000000000000000000000000000000000000
--- a/src/opticalattackmitigator/proto/optical_attack_mitigator_pb2_grpc.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
-"""Client and server classes corresponding to protobuf-defined services."""
-import grpc
-
-from . import optical_attack_mitigator_pb2 as optical__attack__mitigator__pb2
-
-
-class AttackMitigatorStub(object):
- """Missing associated documentation comment in .proto file."""
-
- def __init__(self, channel):
- """Constructor.
-
- Args:
- channel: A grpc.Channel.
- """
- self.NotifyAttack = channel.unary_unary(
- '/optical_attack_mitigator.AttackMitigator/NotifyAttack',
- request_serializer=optical__attack__mitigator__pb2.AttackDescription.SerializeToString,
- response_deserializer=optical__attack__mitigator__pb2.AttackResponse.FromString,
- )
-
-
-class AttackMitigatorServicer(object):
- """Missing associated documentation comment in .proto file."""
-
- def NotifyAttack(self, request, context):
- """Missing associated documentation comment in .proto file."""
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
-
-def add_AttackMitigatorServicer_to_server(servicer, server):
- rpc_method_handlers = {
- 'NotifyAttack': grpc.unary_unary_rpc_method_handler(
- servicer.NotifyAttack,
- request_deserializer=optical__attack__mitigator__pb2.AttackDescription.FromString,
- response_serializer=optical__attack__mitigator__pb2.AttackResponse.SerializeToString,
- ),
- }
- generic_handler = grpc.method_handlers_generic_handler(
- 'optical_attack_mitigator.AttackMitigator', rpc_method_handlers)
- server.add_generic_rpc_handlers((generic_handler,))
-
-
- # This class is part of an EXPERIMENTAL API.
-class AttackMitigator(object):
- """Missing associated documentation comment in .proto file."""
-
- @staticmethod
- def NotifyAttack(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/optical_attack_mitigator.AttackMitigator/NotifyAttack',
- optical__attack__mitigator__pb2.AttackDescription.SerializeToString,
- optical__attack__mitigator__pb2.AttackResponse.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/src/opticalattackmitigator/requirements.in b/src/opticalattackmitigator/requirements.in
index 378e9a10a70f6a41a264c6a76f47239d7515989a..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/requirements.in
+++ b/src/opticalattackmitigator/requirements.in
@@ -11,14 +11,3 @@
# 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.
-
-grpcio-health-checking
-grpcio
-prometheus-client
-pytest
-pytest-benchmark
-redis
-# from the monitoring component
-influxdb
-python-json-logger
-coverage
diff --git a/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py b/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py
index e2783e6ca6907cccad0e344cf2f058acabe53b93..c5a3ff4cdda1f800a5571b4b975a6427690834c9 100644
--- a/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py
+++ b/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py
@@ -12,61 +12,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import grpc
import logging
-from concurrent import futures
-from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH
-from grpc_health.v1.health_pb2 import HealthCheckResponse
-from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2_grpc import (
- add_AttackMitigatorServicer_to_server)
-from opticalattackmitigator.service.OpticalAttackMitigatorServiceServicerImpl import (
- OpticalAttackMitigatorServiceServicerImpl)
-from opticalattackmitigator.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD
-BIND_ADDRESS = '0.0.0.0'
-LOGGER = logging.getLogger(__name__)
-
-class OpticalAttackMitigatorService:
- def __init__(
- self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS,
- grace_period=GRPC_GRACE_PERIOD):
-
- self.address = address
- self.port = port
- self.endpoint = None
- self.max_workers = max_workers
- self.grace_period = grace_period
- self.attack_mitigator_servicer = None
- self.health_servicer = None
- self.pool = None
- self.server = None
-
- def start(self):
- self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port))
- LOGGER.debug('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format(
- str(self.endpoint), str(self.max_workers)))
+from common.Constants import ServiceNameEnum
+from common.proto.optical_attack_mitigator_pb2_grpc import \
+ add_AttackMitigatorServicer_to_server
+from common.Settings import get_service_port_grpc
+from common.tools.service.GenericGrpcService import GenericGrpcService
- self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers)
- self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,))
+from opticalattackmitigator.service.OpticalAttackMitigatorServiceServicerImpl import \
+ OpticalAttackMitigatorServiceServicerImpl
- self.attack_mitigator_servicer = OpticalAttackMitigatorServiceServicerImpl()
- add_AttackMitigatorServicer_to_server(self.attack_mitigator_servicer, self.server)
-
- self.health_servicer = HealthServicer(
- experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1))
- add_HealthServicer_to_server(self.health_servicer, self.server)
-
- port = self.server.add_insecure_port(self.endpoint)
- self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port))
- LOGGER.info('Listening on {:s}...'.format(self.endpoint))
- self.server.start()
- self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member
+LOGGER = logging.getLogger(__name__)
- LOGGER.debug('Service started')
- def stop(self):
- LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period)))
- self.health_servicer.enter_graceful_shutdown()
- self.server.stop(self.grace_period)
- LOGGER.debug('Service stopped')
+class OpticalAttackMitigatorService(GenericGrpcService):
+ def __init__(
+ self,
+ cls_name=__name__,
+ ):
+ port = get_service_port_grpc(ServiceNameEnum.OPTICALATTACKMITIGATOR)
+ super().__init__(port, cls_name=cls_name)
+ self.opticalattackmitigator_services = OpticalAttackMitigatorServiceServicerImpl()
+
+ def install_servicers(self):
+ add_AttackMitigatorServicer_to_server(self.opticalattackmitigator_services, self.server)
diff --git a/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py b/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py
index 16777e799deef7e50905b70b049f25765ebe7d96..d6018b733f9dc2078027420cc2d55f627a12c1a7 100644
--- a/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py
+++ b/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py
@@ -12,27 +12,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import os, grpc, logging, random
-from influxdb import InfluxDBClient
-from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2_grpc import (
- AttackMitigatorServicer)
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2 import AttackDescription, AttackResponse
+import logging
+
+import grpc
+from common.method_wrappers.Decorator import (MetricsPool,
+ safe_and_metered_rpc_method)
+from common.proto.optical_attack_mitigator_pb2 import (AttackDescription,
+ AttackResponse)
+from common.proto.optical_attack_mitigator_pb2_grpc import \
+ AttackMitigatorServicer
LOGGER = logging.getLogger(__name__)
-METRICS_POOL = MetricsPool('OpticalAttackMitigator', 'RPC')
+METRICS_POOL = MetricsPool("OpticalAttackMitigator", "RPC")
class OpticalAttackMitigatorServiceServicerImpl(AttackMitigatorServicer):
-
def __init__(self):
- LOGGER.debug('Creating Servicer...')
- LOGGER.debug('Servicer Created')
+ LOGGER.debug("Creating Servicer...")
+ LOGGER.debug("Servicer Created")
@safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
- def NotifyAttack(self, request : AttackDescription, context : grpc.ServicerContext) -> AttackResponse:
+ def NotifyAttack(
+ self, request: AttackDescription, context: grpc.ServicerContext
+ ) -> AttackResponse:
LOGGER.debug(f"NotifyAttack: {request}")
response: AttackResponse = AttackResponse()
- response.response_strategy_description = 'The AttackMitigator has received the attack description.'
+ response.response_strategy_description = (
+ "The AttackMitigator has received the attack description."
+ )
return response
diff --git a/src/opticalattackmitigator/service/__init__.py b/src/opticalattackmitigator/service/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/service/__init__.py
+++ b/src/opticalattackmitigator/service/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackmitigator/service/__main__.py b/src/opticalattackmitigator/service/__main__.py
index 649d079c0cee6347e452acbaf35263d77150bd45..dc725a94f77c1f53e2f02a83c3d1b82350fb3b7d 100644
--- a/src/opticalattackmitigator/service/__main__.py
+++ b/src/opticalattackmitigator/service/__main__.py
@@ -12,53 +12,67 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import os, logging, signal, sys, time, threading, multiprocessing
+import logging
+import signal
+import sys
+import threading
+
from prometheus_client import start_http_server
-from common.Settings import get_setting
-from opticalattackmitigator.Config import (
- GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT)
-from opticalattackmitigator.service.OpticalAttackMitigatorService import OpticalAttackMitigatorService
+
+from common.Constants import ServiceNameEnum
+from common.Settings import (ENVVAR_SUFIX_SERVICE_HOST,
+ ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name,
+ get_log_level, get_metrics_port,
+ wait_for_environment_variables)
+from opticalattackmitigator.service.OpticalAttackMitigatorService import \
+ OpticalAttackMitigatorService
terminate = threading.Event()
LOGGER = None
-def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
- LOGGER.warning('Terminate signal received')
+
+def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
+ LOGGER.warning("Terminate signal received")
terminate.set()
-def main():
- global LOGGER # pylint: disable=global-statement
- service_port = get_setting('OPTICALATTACKMITIGATORSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT)
- max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS )
- grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD)
- log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL )
- metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT )
+def main():
+ global LOGGER # pylint: disable=global-statement
+ log_level = get_log_level()
logging.basicConfig(level=log_level)
LOGGER = logging.getLogger(__name__)
- signal.signal(signal.SIGINT, signal_handler)
+ wait_for_environment_variables(
+ [
+ get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST),
+ get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC),
+ ]
+ )
+
+ signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
- LOGGER.info('Starting...')
+ LOGGER.info("Starting...")
# Start metrics server
+ metrics_port = get_metrics_port()
start_http_server(metrics_port)
# Starting CentralizedCybersecurity service
- grpc_service = OpticalAttackMitigatorService(
- port=service_port, max_workers=max_workers, grace_period=grace_period)
+ grpc_service = OpticalAttackMitigatorService()
grpc_service.start()
# Wait for Ctrl+C or termination signal
- while not terminate.wait(timeout=0.1): pass
+ while not terminate.wait(timeout=1):
+ pass
- LOGGER.info('Terminating...')
+ LOGGER.info("Terminating...")
grpc_service.stop()
- LOGGER.info('Bye')
+ LOGGER.info("Bye")
return 0
-if __name__ == '__main__':
+
+if __name__ == "__main__":
sys.exit(main())
diff --git a/src/opticalattackmitigator/tests/__init__.py b/src/opticalattackmitigator/tests/__init__.py
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644
--- a/src/opticalattackmitigator/tests/__init__.py
+++ b/src/opticalattackmitigator/tests/__init__.py
@@ -11,4 +11,3 @@
# 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.
-
diff --git a/src/opticalattackmitigator/tests/test_unitary.py b/src/opticalattackmitigator/tests/test_unitary.py
index 24d0853b90a7b9f30fd25bfe7431f4e3e7e5fd0f..68836c4e81dd8e88b34cf85c9e2a29fd9f5e5678 100644
--- a/src/opticalattackmitigator/tests/test_unitary.py
+++ b/src/opticalattackmitigator/tests/test_unitary.py
@@ -12,31 +12,54 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import logging, pytest
-from opticalattackmitigator.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD
-from opticalattackmitigator.client.OpticalAttackMitigatorClient import OpticalAttackMitigatorClient
-from opticalattackmitigator.service.OpticalAttackMitigatorService import OpticalAttackMitigatorService
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2 import AttackDescription, AttackResponse
+import logging
+import os
+from unittest.mock import patch
-port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
+import pytest
+from common.Constants import (DEFAULT_GRPC_GRACE_PERIOD,
+ DEFAULT_GRPC_MAX_WORKERS)
+from common.proto.optical_attack_mitigator_pb2 import AttackDescription
+
+from opticalattackmitigator.client.OpticalAttackMitigatorClient import \
+ OpticalAttackMitigatorClient
+from opticalattackmitigator.Config import GRPC_SERVICE_PORT
+from opticalattackmitigator.service.OpticalAttackMitigatorService import \
+ OpticalAttackMitigatorService
+
+port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.DEBUG)
-@pytest.fixture(scope='session')
+
+@pytest.fixture(scope="session")
def optical_attack_mitigator_service():
_service = OpticalAttackMitigatorService(
- port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD)
+ port=port,
+ max_workers=DEFAULT_GRPC_MAX_WORKERS,
+ grace_period=DEFAULT_GRPC_GRACE_PERIOD,
+ )
_service.start()
yield _service
_service.stop()
-@pytest.fixture(scope='session')
+
+@pytest.fixture(scope="session")
def optical_attack_mitigator_client(optical_attack_mitigator_service):
- _client = OpticalAttackMitigatorClient(address='127.0.0.1', port=port)
- yield _client
+ with patch.dict(
+ os.environ,
+ {
+ "OPTICALATTACKMITIGATORSERVICE_SERVICE_HOST": "127.0.0.1",
+ "OPTICALATTACKMITIGATORSERVICE_SERVICE_PORT_GRPC": str(port),
+ },
+ clear=True,
+ ):
+ _client = OpticalAttackMitigatorClient()
+ yield _client
_client.close()
+
def test_call_service(optical_attack_mitigator_client: OpticalAttackMitigatorClient):
request = AttackDescription()
optical_attack_mitigator_client.NotifyAttack(request)
diff --git a/src/opticalcentralizedattackdetector/Config.py b/src/opticalcentralizedattackdetector/Config.py
deleted file mode 100644
index c9bfe106b8d69ca52016ccc9512ec4598d3914bf..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/Config.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-import logging
-
-# General settings
-LOG_LEVEL = logging.DEBUG
-
-# gRPC settings
-GRPC_SERVICE_PORT = 10005
-GRPC_MAX_WORKERS = 10
-GRPC_GRACE_PERIOD = 60
-
-# service settings
-MONITORING_INTERVAL = 2 # monitoring interval in seconds
-#TODO: adjust the addresses below for the specific case
-MONITORING_SERVICE_ADDRESS = 'monitoringservice' # address/name of the monitoring service
-# MONITORING_SERVICE_ADDRESS = '10.99.41.20' # address/name of the monitoring service
-CONTEXT_SERVICE_ADDRESS = 'contextservice' # address/name of the monitoring service
-# CONTEXT_SERVICE_ADDRESS = '10.107.199.65' # address/name of the monitoring service
-SERVICE_SERVICE_ADDRESS = 'serviceservice' # address/name of the service service
-# SERVICE_SERVICE_ADDRESS = '10.99.234.88' # address/name of the service service
-# INFERENCE_SERVICE_ADDRESS = '10.108.113.78' # address/name of the inference service
-INFERENCE_SERVICE_ADDRESS = 'dbscanservingservice' # address/name of the inference service
-# ATTACK_MITIGATOR_SERVICE_ADDRESS = '10.96.248.167'
-ATTACK_MITIGATOR_SERVICE_ADDRESS = 'opticalattackmitigatorservice'
-
-# Prometheus settings
-METRICS_PORT = 9192
diff --git a/src/opticalcentralizedattackdetector/Dockerfile b/src/opticalcentralizedattackdetector/Dockerfile
deleted file mode 100644
index a7b32ccc6ee94f0fe741885452a44ca9fb7a0f3f..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/Dockerfile
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-FROM python:3-slim
-
-# Install dependencies
-RUN apt-get --yes --quiet --quiet update && \
- apt-get --yes --quiet --quiet install wget g++ && \
- rm -rf /var/lib/apt/lists/*
-
-# Set Python to show logs as they occur
-ENV PYTHONUNBUFFERED=0
-
-# Download the gRPC health probe
-RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
- wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
- chmod +x /bin/grpc_health_probe
-
-# Get generic Python packages
-RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools
-
-# Set working directory
-WORKDIR /var/teraflow
-
-# Create module sub-folders
-RUN mkdir -p /var/teraflow/opticalcentralizedattackdetector
-
-# Get Python packages per module
-COPY opticalcentralizedattackdetector/requirements.in opticalcentralizedattackdetector/requirements.in
-RUN pip-compile --output-file=opticalcentralizedattackdetector/requirements.txt opticalcentralizedattackdetector/requirements.in
-RUN python3 -m pip install -r opticalcentralizedattackdetector/requirements.txt
-
-# Add files into working directory
-COPY common/. common
-COPY context/. context
-COPY monitoring/. monitoring
-COPY service/. service
-COPY dbscanserving/. dbscanserving
-COPY opticalattackmitigator/. opticalattackmitigator
-COPY opticalcentralizedattackdetector/. opticalcentralizedattackdetector
-
-ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
-
-# Start opticalcentralizedattackdetector service
-ENTRYPOINT ["python", "-m", "opticalcentralizedattackdetector.service"]
diff --git a/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py b/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py
deleted file mode 100644
index 3dc2f3ae8f3837fe1c12d530d61fe70acf2563b6..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-import grpc, logging
-from common.tools.client.RetryDecorator import retry, delay_exponential
-from opticalcentralizedattackdetector.proto.context_pb2 import Empty, Service
-from opticalcentralizedattackdetector.proto.monitoring_pb2 import KpiList
-from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_pb2_grpc import OpticalCentralizedAttackDetectorServiceStub
-
-LOGGER = logging.getLogger(__name__)
-MAX_RETRIES = 15
-DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0)
-RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect')
-
-class OpticalCentralizedAttackDetectorClient:
- def __init__(self, address, port):
- self.endpoint = '{:s}:{:s}'.format(str(address), str(port))
- LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint)))
- self.channel = None
- self.stub = None
- self.connect()
- LOGGER.debug('Channel created')
-
- def connect(self):
- self.channel = grpc.insecure_channel(self.endpoint)
- self.stub = OpticalCentralizedAttackDetectorServiceStub(self.channel)
-
- def close(self):
- if(self.channel is not None): self.channel.close()
- self.channel = None
- self.stub = None
-
- @RETRY_DECORATOR
- def NotifyServiceUpdate(self, request : Service) -> Empty:
- LOGGER.debug('NotifyServiceUpdate request: {:s}'.format(str(request)))
- response = self.stub.NotifyServiceUpdate(request)
- LOGGER.debug('NotifyServiceUpdate result: {:s}'.format(str(response)))
- return response
-
- @RETRY_DECORATOR
- def DetectAttack(self, request : Empty) -> Empty:
- LOGGER.debug('DetectAttack request: {:s}'.format(str(request)))
- response = self.stub.DetectAttack(request)
- LOGGER.debug('DetectAttack result: {:s}'.format(str(response)))
- return response
-
- @RETRY_DECORATOR
- def ReportSummarizedKpi(self, request : KpiList) -> Empty:
- LOGGER.debug('ReportSummarizedKpi request: {:s}'.format(str(request)))
- response = self.stub.ReportSummarizedKpi(request)
- LOGGER.debug('ReportSummarizedKpi result: {:s}'.format(str(response)))
- return response
-
- @RETRY_DECORATOR
- def ReportKpi(self, request : KpiList) -> Empty:
- LOGGER.debug('ReportKpi request: {:s}'.format(str(request)))
- response = self.stub.ReportKpi(request)
- LOGGER.debug('ReportKpi result: {:s}'.format(str(response)))
- return response
diff --git a/src/opticalcentralizedattackdetector/genproto.sh b/src/opticalcentralizedattackdetector/genproto.sh
deleted file mode 100755
index 85941a266c1def6f352d5ade7bfe5b9e99309fd9..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/genproto.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash -eu
-#
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-# Make folder containing the script the root folder for its execution
-cd $(dirname $0)
-
-rm -rf proto/*.py
-rm -rf proto/__pycache__
-tee proto/__init__.py << EOF > /dev/null
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-EOF
-
-# building protos of services used
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto
-
-rm proto/context_pb2_grpc.py
-rm proto/service_pb2_grpc.py
-rm proto/monitoring_pb2_grpc.py
-rm proto/kpi_sample_types_pb2_grpc.py
-
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py
-
-# building current service protos
-python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto optical_centralized_attack_detector.proto
-
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/optical_centralized_attack_detector_pb2.py
-sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/optical_centralized_attack_detector_pb2_grpc.py
diff --git a/src/opticalcentralizedattackdetector/proto/__init__.py b/src/opticalcentralizedattackdetector/proto/__init__.py
deleted file mode 100644
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
diff --git a/src/opticalcentralizedattackdetector/proto/context_pb2.py b/src/opticalcentralizedattackdetector/proto/context_pb2.py
deleted file mode 100644
index 50d501d3ac053ad644554331af26e3c40cd426a1..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/context_pb2.py
+++ /dev/null
@@ -1,3071 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: context.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import kpi_sample_types_pb2 as kpi__sample__types__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='context.proto',
- package='context',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3'
- ,
- dependencies=[kpi__sample__types__pb2.DESCRIPTOR,])
-
-_EVENTTYPEENUM = _descriptor.EnumDescriptor(
- name='EventTypeEnum',
- full_name='context.EventTypeEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_CREATE', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_UPDATE', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='EVENTTYPE_REMOVE', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4310,
- serialized_end=4416,
-)
-_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM)
-
-EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM)
-_DEVICEDRIVERENUM = _descriptor.EnumDescriptor(
- name='DeviceDriverEnum',
- full_name='context.DeviceDriverEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_OPENCONFIG', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_P4', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEDRIVER_ONF_TR_352', index=5, number=5,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4419,
- serialized_end=4616,
-)
-_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM)
-
-DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM)
-_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor(
- name='DeviceOperationalStatusEnum',
- full_name='context.DeviceOperationalStatusEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4619,
- serialized_end=4762,
-)
-_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM)
-
-DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM)
-_SERVICETYPEENUM = _descriptor.EnumDescriptor(
- name='ServiceTypeEnum',
- full_name='context.ServiceTypeEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_UNKNOWN', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_L3NM', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_L2NM', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4765,
- serialized_end=4894,
-)
-_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM)
-
-ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM)
-_SERVICESTATUSENUM = _descriptor.EnumDescriptor(
- name='ServiceStatusEnum',
- full_name='context.ServiceStatusEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_PLANNED', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_ACTIVE', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=4897,
- serialized_end=5033,
-)
-_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM)
-
-ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM)
-_SLICESTATUSENUM = _descriptor.EnumDescriptor(
- name='SliceStatusEnum',
- full_name='context.SliceStatusEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_PLANNED', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_INIT', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_ACTIVE', index=3, number=3,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='SLICESTATUS_DEINIT', index=4, number=4,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=5036,
- serialized_end=5175,
-)
-_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM)
-
-SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM)
-_CONFIGACTIONENUM = _descriptor.EnumDescriptor(
- name='ConfigActionEnum',
- full_name='context.ConfigActionEnum',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='CONFIGACTION_UNDEFINED', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='CONFIGACTION_SET', index=1, number=1,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='CONFIGACTION_DELETE', index=2, number=2,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=5177,
- serialized_end=5270,
-)
-_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM)
-
-ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM)
-EVENTTYPE_UNDEFINED = 0
-EVENTTYPE_CREATE = 1
-EVENTTYPE_UPDATE = 2
-EVENTTYPE_REMOVE = 3
-DEVICEDRIVER_UNDEFINED = 0
-DEVICEDRIVER_OPENCONFIG = 1
-DEVICEDRIVER_TRANSPORT_API = 2
-DEVICEDRIVER_P4 = 3
-DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4
-DEVICEDRIVER_ONF_TR_352 = 5
-DEVICEOPERATIONALSTATUS_UNDEFINED = 0
-DEVICEOPERATIONALSTATUS_DISABLED = 1
-DEVICEOPERATIONALSTATUS_ENABLED = 2
-SERVICETYPE_UNKNOWN = 0
-SERVICETYPE_L3NM = 1
-SERVICETYPE_L2NM = 2
-SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3
-SERVICESTATUS_UNDEFINED = 0
-SERVICESTATUS_PLANNED = 1
-SERVICESTATUS_ACTIVE = 2
-SERVICESTATUS_PENDING_REMOVAL = 3
-SLICESTATUS_UNDEFINED = 0
-SLICESTATUS_PLANNED = 1
-SLICESTATUS_INIT = 2
-SLICESTATUS_ACTIVE = 3
-SLICESTATUS_DEINIT = 4
-CONFIGACTION_UNDEFINED = 0
-CONFIGACTION_SET = 1
-CONFIGACTION_DELETE = 2
-
-
-
-_EMPTY = _descriptor.Descriptor(
- name='Empty',
- full_name='context.Empty',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=50,
- serialized_end=57,
-)
-
-
-_UUID = _descriptor.Descriptor(
- name='Uuid',
- full_name='context.Uuid',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='uuid', full_name='context.Uuid.uuid', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=59,
- serialized_end=79,
-)
-
-
-_EVENT = _descriptor.Descriptor(
- name='Event',
- full_name='context.Event',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='timestamp', full_name='context.Event.timestamp', index=0,
- number=1, type=1, cpp_type=5, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='event_type', full_name='context.Event.event_type', index=1,
- number=2, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=81,
- serialized_end=151,
-)
-
-
-_CONTEXTID = _descriptor.Descriptor(
- name='ContextId',
- full_name='context.ContextId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_uuid', full_name='context.ContextId.context_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=153,
- serialized_end=201,
-)
-
-
-_CONTEXT = _descriptor.Descriptor(
- name='Context',
- full_name='context.Context',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.Context.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='topology_ids', full_name='context.Context.topology_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_ids', full_name='context.Context.service_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='controller', full_name='context.Context.controller', index=3,
- number=4, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=204,
- serialized_end=386,
-)
-
-
-_CONTEXTIDLIST = _descriptor.Descriptor(
- name='ContextIdList',
- full_name='context.ContextIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_ids', full_name='context.ContextIdList.context_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=388,
- serialized_end=444,
-)
-
-
-_CONTEXTLIST = _descriptor.Descriptor(
- name='ContextList',
- full_name='context.ContextList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='contexts', full_name='context.ContextList.contexts', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=446,
- serialized_end=495,
-)
-
-
-_CONTEXTEVENT = _descriptor.Descriptor(
- name='ContextEvent',
- full_name='context.ContextEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.ContextEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.ContextEvent.context_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=497,
- serialized_end=582,
-)
-
-
-_TOPOLOGYID = _descriptor.Descriptor(
- name='TopologyId',
- full_name='context.TopologyId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.TopologyId.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=584,
- serialized_end=674,
-)
-
-
-_TOPOLOGY = _descriptor.Descriptor(
- name='Topology',
- full_name='context.Topology',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topology_id', full_name='context.Topology.topology_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_ids', full_name='context.Topology.device_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='link_ids', full_name='context.Topology.link_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=676,
- serialized_end=802,
-)
-
-
-_TOPOLOGYIDLIST = _descriptor.Descriptor(
- name='TopologyIdList',
- full_name='context.TopologyIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=804,
- serialized_end=863,
-)
-
-
-_TOPOLOGYLIST = _descriptor.Descriptor(
- name='TopologyList',
- full_name='context.TopologyList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topologies', full_name='context.TopologyList.topologies', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=865,
- serialized_end=918,
-)
-
-
-_TOPOLOGYEVENT = _descriptor.Descriptor(
- name='TopologyEvent',
- full_name='context.TopologyEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.TopologyEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='topology_id', full_name='context.TopologyEvent.topology_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=920,
- serialized_end=1008,
-)
-
-
-_DEVICEID = _descriptor.Descriptor(
- name='DeviceId',
- full_name='context.DeviceId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='device_uuid', full_name='context.DeviceId.device_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1010,
- serialized_end=1056,
-)
-
-
-_DEVICE = _descriptor.Descriptor(
- name='Device',
- full_name='context.Device',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='device_id', full_name='context.Device.device_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_type', full_name='context.Device.device_type', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_config', full_name='context.Device.device_config', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_operational_status', full_name='context.Device.device_operational_status', index=3,
- number=4, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_drivers', full_name='context.Device.device_drivers', index=4,
- number=5, type=14, cpp_type=8, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_endpoints', full_name='context.Device.device_endpoints', index=5,
- number=6, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1059,
- serialized_end=1341,
-)
-
-
-_DEVICECONFIG = _descriptor.Descriptor(
- name='DeviceConfig',
- full_name='context.DeviceConfig',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='config_rules', full_name='context.DeviceConfig.config_rules', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1343,
- serialized_end=1400,
-)
-
-
-_DEVICEIDLIST = _descriptor.Descriptor(
- name='DeviceIdList',
- full_name='context.DeviceIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='device_ids', full_name='context.DeviceIdList.device_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1402,
- serialized_end=1455,
-)
-
-
-_DEVICELIST = _descriptor.Descriptor(
- name='DeviceList',
- full_name='context.DeviceList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='devices', full_name='context.DeviceList.devices', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1457,
- serialized_end=1503,
-)
-
-
-_DEVICEEVENT = _descriptor.Descriptor(
- name='DeviceEvent',
- full_name='context.DeviceEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.DeviceEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_id', full_name='context.DeviceEvent.device_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1505,
- serialized_end=1587,
-)
-
-
-_LINKID = _descriptor.Descriptor(
- name='LinkId',
- full_name='context.LinkId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='link_uuid', full_name='context.LinkId.link_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1589,
- serialized_end=1631,
-)
-
-
-_LINK = _descriptor.Descriptor(
- name='Link',
- full_name='context.Link',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='link_id', full_name='context.Link.link_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1633,
- serialized_end=1721,
-)
-
-
-_LINKIDLIST = _descriptor.Descriptor(
- name='LinkIdList',
- full_name='context.LinkIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='link_ids', full_name='context.LinkIdList.link_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1723,
- serialized_end=1770,
-)
-
-
-_LINKLIST = _descriptor.Descriptor(
- name='LinkList',
- full_name='context.LinkList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='links', full_name='context.LinkList.links', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1772,
- serialized_end=1812,
-)
-
-
-_LINKEVENT = _descriptor.Descriptor(
- name='LinkEvent',
- full_name='context.LinkEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.LinkEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='link_id', full_name='context.LinkEvent.link_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1814,
- serialized_end=1890,
-)
-
-
-_SERVICEID = _descriptor.Descriptor(
- name='ServiceId',
- full_name='context.ServiceId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.ServiceId.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_uuid', full_name='context.ServiceId.service_uuid', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1892,
- serialized_end=1980,
-)
-
-
-_SERVICE = _descriptor.Descriptor(
- name='Service',
- full_name='context.Service',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='service_id', full_name='context.Service.service_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_type', full_name='context.Service.service_type', index=1,
- number=2, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_constraints', full_name='context.Service.service_constraints', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_status', full_name='context.Service.service_status', index=4,
- number=5, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_config', full_name='context.Service.service_config', index=5,
- number=6, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1983,
- serialized_end=2277,
-)
-
-
-_SERVICESTATUS = _descriptor.Descriptor(
- name='ServiceStatus',
- full_name='context.ServiceStatus',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='service_status', full_name='context.ServiceStatus.service_status', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2279,
- serialized_end=2346,
-)
-
-
-_SERVICECONFIG = _descriptor.Descriptor(
- name='ServiceConfig',
- full_name='context.ServiceConfig',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='config_rules', full_name='context.ServiceConfig.config_rules', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2348,
- serialized_end=2406,
-)
-
-
-_SERVICEIDLIST = _descriptor.Descriptor(
- name='ServiceIdList',
- full_name='context.ServiceIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='service_ids', full_name='context.ServiceIdList.service_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2408,
- serialized_end=2464,
-)
-
-
-_SERVICELIST = _descriptor.Descriptor(
- name='ServiceList',
- full_name='context.ServiceList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='services', full_name='context.ServiceList.services', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2466,
- serialized_end=2515,
-)
-
-
-_SERVICEEVENT = _descriptor.Descriptor(
- name='ServiceEvent',
- full_name='context.ServiceEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.ServiceEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_id', full_name='context.ServiceEvent.service_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2517,
- serialized_end=2602,
-)
-
-
-_SLICEID = _descriptor.Descriptor(
- name='SliceId',
- full_name='context.SliceId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.SliceId.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2604,
- serialized_end=2688,
-)
-
-
-_SLICE = _descriptor.Descriptor(
- name='Slice',
- full_name='context.Slice',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slice_id', full_name='context.Slice.slice_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_constraints', full_name='context.Slice.slice_constraints', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4,
- number=5, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_status', full_name='context.Slice.slice_status', index=5,
- number=6, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2691,
- serialized_end=2968,
-)
-
-
-_SLICESTATUS = _descriptor.Descriptor(
- name='SliceStatus',
- full_name='context.SliceStatus',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slice_status', full_name='context.SliceStatus.slice_status', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2970,
- serialized_end=3031,
-)
-
-
-_SLICEIDLIST = _descriptor.Descriptor(
- name='SliceIdList',
- full_name='context.SliceIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3033,
- serialized_end=3083,
-)
-
-
-_SLICELIST = _descriptor.Descriptor(
- name='SliceList',
- full_name='context.SliceList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='slices', full_name='context.SliceList.slices', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3085,
- serialized_end=3128,
-)
-
-
-_SLICEEVENT = _descriptor.Descriptor(
- name='SliceEvent',
- full_name='context.SliceEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.SliceEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='slice_id', full_name='context.SliceEvent.slice_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3130,
- serialized_end=3209,
-)
-
-
-_CONNECTIONID = _descriptor.Descriptor(
- name='ConnectionId',
- full_name='context.ConnectionId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3211,
- serialized_end=3265,
-)
-
-
-_CONNECTION = _descriptor.Descriptor(
- name='Connection',
- full_name='context.Connection',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connection_id', full_name='context.Connection.connection_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_id', full_name='context.Connection.service_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3268,
- serialized_end=3464,
-)
-
-
-_CONNECTIONIDLIST = _descriptor.Descriptor(
- name='ConnectionIdList',
- full_name='context.ConnectionIdList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3466,
- serialized_end=3531,
-)
-
-
-_CONNECTIONLIST = _descriptor.Descriptor(
- name='ConnectionList',
- full_name='context.ConnectionList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='connections', full_name='context.ConnectionList.connections', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3533,
- serialized_end=3591,
-)
-
-
-_CONNECTIONEVENT = _descriptor.Descriptor(
- name='ConnectionEvent',
- full_name='context.ConnectionEvent',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='event', full_name='context.ConnectionEvent.event', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3593,
- serialized_end=3687,
-)
-
-
-_ENDPOINTID = _descriptor.Descriptor(
- name='EndPointId',
- full_name='context.EndPointId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='topology_id', full_name='context.EndPointId.topology_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_id', full_name='context.EndPointId.device_id', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3690,
- serialized_end=3820,
-)
-
-
-_ENDPOINT = _descriptor.Descriptor(
- name='EndPoint',
- full_name='context.EndPoint',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2,
- number=3, type=14, cpp_type=8, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3823,
- serialized_end=3957,
-)
-
-
-_CONFIGRULE = _descriptor.Descriptor(
- name='ConfigRule',
- full_name='context.ConfigRule',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='action', full_name='context.ConfigRule.action', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='resource_key', full_name='context.ConfigRule.resource_key', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='resource_value', full_name='context.ConfigRule.resource_value', index=2,
- number=3, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=3959,
- serialized_end=4060,
-)
-
-
-_CONSTRAINT = _descriptor.Descriptor(
- name='Constraint',
- full_name='context.Constraint',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='constraint_type', full_name='context.Constraint.constraint_type', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='constraint_value', full_name='context.Constraint.constraint_value', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=4062,
- serialized_end=4125,
-)
-
-
-_TERAFLOWCONTROLLER = _descriptor.Descriptor(
- name='TeraFlowController',
- full_name='context.TeraFlowController',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.TeraFlowController.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='ip_address', full_name='context.TeraFlowController.ip_address', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='port', full_name='context.TeraFlowController.port', index=2,
- number=3, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=4127,
- serialized_end=4221,
-)
-
-
-_AUTHENTICATIONRESULT = _descriptor.Descriptor(
- name='AuthenticationResult',
- full_name='context.AuthenticationResult',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='context_id', full_name='context.AuthenticationResult.context_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1,
- number=2, type=8, cpp_type=7, label=1,
- has_default_value=False, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=4223,
- serialized_end=4308,
-)
-
-_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM
-_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID
-_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID
-_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID
-_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID
-_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER
-_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID
-_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT
-_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT
-_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID
-_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID
-_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID
-_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID
-_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID
-_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID
-_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID
-_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY
-_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT
-_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID
-_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID
-_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID
-_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG
-_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM
-_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM
-_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT
-_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE
-_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID
-_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE
-_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT
-_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID
-_LINKID.fields_by_name['link_uuid'].message_type = _UUID
-_LINK.fields_by_name['link_id'].message_type = _LINKID
-_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID
-_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID
-_LINKLIST.fields_by_name['links'].message_type = _LINK
-_LINKEVENT.fields_by_name['event'].message_type = _EVENT
-_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID
-_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID
-_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID
-_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID
-_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM
-_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID
-_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT
-_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS
-_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG
-_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM
-_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE
-_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID
-_SERVICELIST.fields_by_name['services'].message_type = _SERVICE
-_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT
-_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID
-_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID
-_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID
-_SLICE.fields_by_name['slice_id'].message_type = _SLICEID
-_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID
-_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT
-_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID
-_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID
-_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS
-_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM
-_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID
-_SLICELIST.fields_by_name['slices'].message_type = _SLICE
-_SLICEEVENT.fields_by_name['event'].message_type = _EVENT
-_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID
-_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID
-_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID
-_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID
-_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID
-_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID
-_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID
-_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION
-_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT
-_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID
-_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID
-_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID
-_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID
-_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID
-_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE
-_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM
-_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID
-_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID
-DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY
-DESCRIPTOR.message_types_by_name['Uuid'] = _UUID
-DESCRIPTOR.message_types_by_name['Event'] = _EVENT
-DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID
-DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT
-DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST
-DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST
-DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT
-DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID
-DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY
-DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST
-DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST
-DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT
-DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID
-DESCRIPTOR.message_types_by_name['Device'] = _DEVICE
-DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG
-DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST
-DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST
-DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT
-DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID
-DESCRIPTOR.message_types_by_name['Link'] = _LINK
-DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST
-DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST
-DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT
-DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID
-DESCRIPTOR.message_types_by_name['Service'] = _SERVICE
-DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS
-DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG
-DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST
-DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST
-DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT
-DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID
-DESCRIPTOR.message_types_by_name['Slice'] = _SLICE
-DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS
-DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST
-DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST
-DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT
-DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID
-DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION
-DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST
-DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST
-DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT
-DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID
-DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT
-DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE
-DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT
-DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER
-DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT
-DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM
-DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM
-DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM
-DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM
-DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM
-DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM
-DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), {
- 'DESCRIPTOR' : _EMPTY,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Empty)
- })
-_sym_db.RegisterMessage(Empty)
-
-Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), {
- 'DESCRIPTOR' : _UUID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Uuid)
- })
-_sym_db.RegisterMessage(Uuid)
-
-Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), {
- 'DESCRIPTOR' : _EVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Event)
- })
-_sym_db.RegisterMessage(Event)
-
-ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextId)
- })
-_sym_db.RegisterMessage(ContextId)
-
-Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Context)
- })
-_sym_db.RegisterMessage(Context)
-
-ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextIdList)
- })
-_sym_db.RegisterMessage(ContextIdList)
-
-ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextList)
- })
-_sym_db.RegisterMessage(ContextList)
-
-ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), {
- 'DESCRIPTOR' : _CONTEXTEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ContextEvent)
- })
-_sym_db.RegisterMessage(ContextEvent)
-
-TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyId)
- })
-_sym_db.RegisterMessage(TopologyId)
-
-Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGY,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Topology)
- })
-_sym_db.RegisterMessage(Topology)
-
-TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyIdList)
- })
-_sym_db.RegisterMessage(TopologyIdList)
-
-TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyList)
- })
-_sym_db.RegisterMessage(TopologyList)
-
-TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), {
- 'DESCRIPTOR' : _TOPOLOGYEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TopologyEvent)
- })
-_sym_db.RegisterMessage(TopologyEvent)
-
-DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICEID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceId)
- })
-_sym_db.RegisterMessage(DeviceId)
-
-Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Device)
- })
-_sym_db.RegisterMessage(Device)
-
-DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICECONFIG,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceConfig)
- })
-_sym_db.RegisterMessage(DeviceConfig)
-
-DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICEIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceIdList)
- })
-_sym_db.RegisterMessage(DeviceIdList)
-
-DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICELIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceList)
- })
-_sym_db.RegisterMessage(DeviceList)
-
-DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), {
- 'DESCRIPTOR' : _DEVICEEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.DeviceEvent)
- })
-_sym_db.RegisterMessage(DeviceEvent)
-
-LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), {
- 'DESCRIPTOR' : _LINKID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkId)
- })
-_sym_db.RegisterMessage(LinkId)
-
-Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), {
- 'DESCRIPTOR' : _LINK,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Link)
- })
-_sym_db.RegisterMessage(Link)
-
-LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), {
- 'DESCRIPTOR' : _LINKIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkIdList)
- })
-_sym_db.RegisterMessage(LinkIdList)
-
-LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), {
- 'DESCRIPTOR' : _LINKLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkList)
- })
-_sym_db.RegisterMessage(LinkList)
-
-LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), {
- 'DESCRIPTOR' : _LINKEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.LinkEvent)
- })
-_sym_db.RegisterMessage(LinkEvent)
-
-ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICEID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceId)
- })
-_sym_db.RegisterMessage(ServiceId)
-
-Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Service)
- })
-_sym_db.RegisterMessage(Service)
-
-ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICESTATUS,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceStatus)
- })
-_sym_db.RegisterMessage(ServiceStatus)
-
-ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICECONFIG,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceConfig)
- })
-_sym_db.RegisterMessage(ServiceConfig)
-
-ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICEIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceIdList)
- })
-_sym_db.RegisterMessage(ServiceIdList)
-
-ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICELIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceList)
- })
-_sym_db.RegisterMessage(ServiceList)
-
-ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), {
- 'DESCRIPTOR' : _SERVICEEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ServiceEvent)
- })
-_sym_db.RegisterMessage(ServiceEvent)
-
-SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), {
- 'DESCRIPTOR' : _SLICEID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceId)
- })
-_sym_db.RegisterMessage(SliceId)
-
-Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), {
- 'DESCRIPTOR' : _SLICE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Slice)
- })
-_sym_db.RegisterMessage(Slice)
-
-SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), {
- 'DESCRIPTOR' : _SLICESTATUS,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceStatus)
- })
-_sym_db.RegisterMessage(SliceStatus)
-
-SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), {
- 'DESCRIPTOR' : _SLICEIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceIdList)
- })
-_sym_db.RegisterMessage(SliceIdList)
-
-SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), {
- 'DESCRIPTOR' : _SLICELIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceList)
- })
-_sym_db.RegisterMessage(SliceList)
-
-SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), {
- 'DESCRIPTOR' : _SLICEEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.SliceEvent)
- })
-_sym_db.RegisterMessage(SliceEvent)
-
-ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionId)
- })
-_sym_db.RegisterMessage(ConnectionId)
-
-Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTION,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Connection)
- })
-_sym_db.RegisterMessage(Connection)
-
-ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONIDLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionIdList)
- })
-_sym_db.RegisterMessage(ConnectionIdList)
-
-ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONLIST,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionList)
- })
-_sym_db.RegisterMessage(ConnectionList)
-
-ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), {
- 'DESCRIPTOR' : _CONNECTIONEVENT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConnectionEvent)
- })
-_sym_db.RegisterMessage(ConnectionEvent)
-
-EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), {
- 'DESCRIPTOR' : _ENDPOINTID,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.EndPointId)
- })
-_sym_db.RegisterMessage(EndPointId)
-
-EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), {
- 'DESCRIPTOR' : _ENDPOINT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.EndPoint)
- })
-_sym_db.RegisterMessage(EndPoint)
-
-ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), {
- 'DESCRIPTOR' : _CONFIGRULE,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.ConfigRule)
- })
-_sym_db.RegisterMessage(ConfigRule)
-
-Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), {
- 'DESCRIPTOR' : _CONSTRAINT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.Constraint)
- })
-_sym_db.RegisterMessage(Constraint)
-
-TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), {
- 'DESCRIPTOR' : _TERAFLOWCONTROLLER,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.TeraFlowController)
- })
-_sym_db.RegisterMessage(TeraFlowController)
-
-AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), {
- 'DESCRIPTOR' : _AUTHENTICATIONRESULT,
- '__module__' : 'context_pb2'
- # @@protoc_insertion_point(class_scope:context.AuthenticationResult)
- })
-_sym_db.RegisterMessage(AuthenticationResult)
-
-
-
-_CONTEXTSERVICE = _descriptor.ServiceDescriptor(
- name='ContextService',
- full_name='context.ContextService',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=5273,
- serialized_end=7688,
- methods=[
- _descriptor.MethodDescriptor(
- name='ListContextIds',
- full_name='context.ContextService.ListContextIds',
- index=0,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONTEXTIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListContexts',
- full_name='context.ContextService.ListContexts',
- index=1,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONTEXTLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetContext',
- full_name='context.ContextService.GetContext',
- index=2,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_CONTEXT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetContext',
- full_name='context.ContextService.SetContext',
- index=3,
- containing_service=None,
- input_type=_CONTEXT,
- output_type=_CONTEXTID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveContext',
- full_name='context.ContextService.RemoveContext',
- index=4,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetContextEvents',
- full_name='context.ContextService.GetContextEvents',
- index=5,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONTEXTEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListTopologyIds',
- full_name='context.ContextService.ListTopologyIds',
- index=6,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_TOPOLOGYIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListTopologies',
- full_name='context.ContextService.ListTopologies',
- index=7,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_TOPOLOGYLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetTopology',
- full_name='context.ContextService.GetTopology',
- index=8,
- containing_service=None,
- input_type=_TOPOLOGYID,
- output_type=_TOPOLOGY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetTopology',
- full_name='context.ContextService.SetTopology',
- index=9,
- containing_service=None,
- input_type=_TOPOLOGY,
- output_type=_TOPOLOGYID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveTopology',
- full_name='context.ContextService.RemoveTopology',
- index=10,
- containing_service=None,
- input_type=_TOPOLOGYID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetTopologyEvents',
- full_name='context.ContextService.GetTopologyEvents',
- index=11,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_TOPOLOGYEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListDeviceIds',
- full_name='context.ContextService.ListDeviceIds',
- index=12,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_DEVICEIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListDevices',
- full_name='context.ContextService.ListDevices',
- index=13,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_DEVICELIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetDevice',
- full_name='context.ContextService.GetDevice',
- index=14,
- containing_service=None,
- input_type=_DEVICEID,
- output_type=_DEVICE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetDevice',
- full_name='context.ContextService.SetDevice',
- index=15,
- containing_service=None,
- input_type=_DEVICE,
- output_type=_DEVICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveDevice',
- full_name='context.ContextService.RemoveDevice',
- index=16,
- containing_service=None,
- input_type=_DEVICEID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetDeviceEvents',
- full_name='context.ContextService.GetDeviceEvents',
- index=17,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_DEVICEEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListLinkIds',
- full_name='context.ContextService.ListLinkIds',
- index=18,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_LINKIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListLinks',
- full_name='context.ContextService.ListLinks',
- index=19,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_LINKLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetLink',
- full_name='context.ContextService.GetLink',
- index=20,
- containing_service=None,
- input_type=_LINKID,
- output_type=_LINK,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetLink',
- full_name='context.ContextService.SetLink',
- index=21,
- containing_service=None,
- input_type=_LINK,
- output_type=_LINKID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveLink',
- full_name='context.ContextService.RemoveLink',
- index=22,
- containing_service=None,
- input_type=_LINKID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetLinkEvents',
- full_name='context.ContextService.GetLinkEvents',
- index=23,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_LINKEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListServiceIds',
- full_name='context.ContextService.ListServiceIds',
- index=24,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SERVICEIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListServices',
- full_name='context.ContextService.ListServices',
- index=25,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SERVICELIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetService',
- full_name='context.ContextService.GetService',
- index=26,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_SERVICE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetService',
- full_name='context.ContextService.SetService',
- index=27,
- containing_service=None,
- input_type=_SERVICE,
- output_type=_SERVICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveService',
- full_name='context.ContextService.RemoveService',
- index=28,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetServiceEvents',
- full_name='context.ContextService.GetServiceEvents',
- index=29,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_SERVICEEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListSliceIds',
- full_name='context.ContextService.ListSliceIds',
- index=30,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SLICEIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListSlices',
- full_name='context.ContextService.ListSlices',
- index=31,
- containing_service=None,
- input_type=_CONTEXTID,
- output_type=_SLICELIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetSlice',
- full_name='context.ContextService.GetSlice',
- index=32,
- containing_service=None,
- input_type=_SLICEID,
- output_type=_SLICE,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetSlice',
- full_name='context.ContextService.SetSlice',
- index=33,
- containing_service=None,
- input_type=_SLICE,
- output_type=_SLICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveSlice',
- full_name='context.ContextService.RemoveSlice',
- index=34,
- containing_service=None,
- input_type=_SLICEID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetSliceEvents',
- full_name='context.ContextService.GetSliceEvents',
- index=35,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_SLICEEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListConnectionIds',
- full_name='context.ContextService.ListConnectionIds',
- index=36,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_CONNECTIONIDLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ListConnections',
- full_name='context.ContextService.ListConnections',
- index=37,
- containing_service=None,
- input_type=_SERVICEID,
- output_type=_CONNECTIONLIST,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetConnection',
- full_name='context.ContextService.GetConnection',
- index=38,
- containing_service=None,
- input_type=_CONNECTIONID,
- output_type=_CONNECTION,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='SetConnection',
- full_name='context.ContextService.SetConnection',
- index=39,
- containing_service=None,
- input_type=_CONNECTION,
- output_type=_CONNECTIONID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='RemoveConnection',
- full_name='context.ContextService.RemoveConnection',
- index=40,
- containing_service=None,
- input_type=_CONNECTIONID,
- output_type=_EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetConnectionEvents',
- full_name='context.ContextService.GetConnectionEvents',
- index=41,
- containing_service=None,
- input_type=_EMPTY,
- output_type=_CONNECTIONEVENT,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE)
-
-DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalcentralizedattackdetector/proto/kpi_sample_types_pb2.py b/src/opticalcentralizedattackdetector/proto/kpi_sample_types_pb2.py
deleted file mode 100644
index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/kpi_sample_types_pb2.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: kpi_sample_types.proto
-"""Generated protocol buffer code."""
-from google.protobuf.internal import enum_type_wrapper
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='kpi_sample_types.proto',
- package='kpi_sample_types',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3'
-)
-
-_KPISAMPLETYPE = _descriptor.EnumDescriptor(
- name='KpiSampleType',
- full_name='kpi_sample_types.KpiSampleType',
- filename=None,
- file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
- values=[
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_UNKNOWN', index=0, number=0,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- _descriptor.EnumValueDescriptor(
- name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202,
- serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=45,
- serialized_end=235,
-)
-_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE)
-
-KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE)
-KPISAMPLETYPE_UNKNOWN = 0
-KPISAMPLETYPE_PACKETS_TRANSMITTED = 101
-KPISAMPLETYPE_PACKETS_RECEIVED = 102
-KPISAMPLETYPE_BYTES_TRANSMITTED = 201
-KPISAMPLETYPE_BYTES_RECEIVED = 202
-
-
-DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalcentralizedattackdetector/proto/monitoring_pb2.py b/src/opticalcentralizedattackdetector/proto/monitoring_pb2.py
deleted file mode 100644
index b313ebb68f0da37a540898e8c362fd204a799076..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/monitoring_pb2.py
+++ /dev/null
@@ -1,452 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: monitoring.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import context_pb2 as context__pb2
-from . import kpi_sample_types_pb2 as kpi__sample__types__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='monitoring.proto',
- package='monitoring',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\x1a\x16kpi_sample_types.proto\"\xda\x01\n\rKpiDescriptor\x12\x17\n\x0fkpi_description\x18\x01 \x01(\t\x12\x38\n\x0fkpi_sample_type\x18\x02 \x01(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\x12$\n\tdevice_id\x18\x03 \x01(\x0b\x32\x11.context.DeviceId\x12(\n\x0b\x65ndpoint_id\x18\x04 \x01(\x0b\x32\x13.context.EndPointId\x12&\n\nservice_id\x18\x05 \x01(\x0b\x32\x12.context.ServiceId\"p\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x1b\n\x13sampling_duration_s\x18\x02 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x03 \x01(\x02\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"d\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"a\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x12\n\x08\x66loatVal\x18\x02 \x01(\x02H\x00\x12\x13\n\tstringVal\x18\x03 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x04 \x01(\x08H\x00\x42\x07\n\x05value\",\n\x07KpiList\x12!\n\x08kpi_list\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi2\xf3\x02\n\x11MonitoringService\x12;\n\tCreateKpi\x12\x19.monitoring.KpiDescriptor\x1a\x11.monitoring.KpiId\"\x00\x12\x42\n\x10GetKpiDescriptor\x12\x11.monitoring.KpiId\x1a\x19.monitoring.KpiDescriptor\"\x00\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3'
- ,
- dependencies=[context__pb2.DESCRIPTOR,kpi__sample__types__pb2.DESCRIPTOR,])
-
-
-
-
-_KPIDESCRIPTOR = _descriptor.Descriptor(
- name='KpiDescriptor',
- full_name='monitoring.KpiDescriptor',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='kpi_description', full_name='monitoring.KpiDescriptor.kpi_description', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='kpi_sample_type', full_name='monitoring.KpiDescriptor.kpi_sample_type', index=1,
- number=2, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='device_id', full_name='monitoring.KpiDescriptor.device_id', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='endpoint_id', full_name='monitoring.KpiDescriptor.endpoint_id', index=3,
- number=4, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='service_id', full_name='monitoring.KpiDescriptor.service_id', index=4,
- number=5, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=72,
- serialized_end=290,
-)
-
-
-_MONITORKPIREQUEST = _descriptor.Descriptor(
- name='MonitorKpiRequest',
- full_name='monitoring.MonitorKpiRequest',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='sampling_duration_s', full_name='monitoring.MonitorKpiRequest.sampling_duration_s', index=1,
- number=2, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='sampling_interval_s', full_name='monitoring.MonitorKpiRequest.sampling_interval_s', index=2,
- number=3, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=292,
- serialized_end=404,
-)
-
-
-_KPIID = _descriptor.Descriptor(
- name='KpiId',
- full_name='monitoring.KpiId',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=406,
- serialized_end=444,
-)
-
-
-_KPI = _descriptor.Descriptor(
- name='Kpi',
- full_name='monitoring.Kpi',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='timestamp', full_name='monitoring.Kpi.timestamp', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=2,
- number=4, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=446,
- serialized_end=546,
-)
-
-
-_KPIVALUE = _descriptor.Descriptor(
- name='KpiValue',
- full_name='monitoring.KpiValue',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='intVal', full_name='monitoring.KpiValue.intVal', index=0,
- number=1, type=13, cpp_type=3, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='floatVal', full_name='monitoring.KpiValue.floatVal', index=1,
- number=2, type=2, cpp_type=6, label=1,
- has_default_value=False, default_value=float(0),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='stringVal', full_name='monitoring.KpiValue.stringVal', index=2,
- number=3, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- _descriptor.FieldDescriptor(
- name='boolVal', full_name='monitoring.KpiValue.boolVal', index=3,
- number=4, type=8, cpp_type=7, label=1,
- has_default_value=False, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- _descriptor.OneofDescriptor(
- name='value', full_name='monitoring.KpiValue.value',
- index=0, containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[]),
- ],
- serialized_start=548,
- serialized_end=645,
-)
-
-
-_KPILIST = _descriptor.Descriptor(
- name='KpiList',
- full_name='monitoring.KpiList',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- create_key=_descriptor._internal_create_key,
- fields=[
- _descriptor.FieldDescriptor(
- name='kpi_list', full_name='monitoring.KpiList.kpi_list', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=647,
- serialized_end=691,
-)
-
-_KPIDESCRIPTOR.fields_by_name['kpi_sample_type'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE
-_KPIDESCRIPTOR.fields_by_name['device_id'].message_type = context__pb2._DEVICEID
-_KPIDESCRIPTOR.fields_by_name['endpoint_id'].message_type = context__pb2._ENDPOINTID
-_KPIDESCRIPTOR.fields_by_name['service_id'].message_type = context__pb2._SERVICEID
-_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID
-_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID
-_KPI.fields_by_name['kpi_id'].message_type = _KPIID
-_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE
-_KPIVALUE.oneofs_by_name['value'].fields.append(
- _KPIVALUE.fields_by_name['intVal'])
-_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value']
-_KPIVALUE.oneofs_by_name['value'].fields.append(
- _KPIVALUE.fields_by_name['floatVal'])
-_KPIVALUE.fields_by_name['floatVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value']
-_KPIVALUE.oneofs_by_name['value'].fields.append(
- _KPIVALUE.fields_by_name['stringVal'])
-_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value']
-_KPIVALUE.oneofs_by_name['value'].fields.append(
- _KPIVALUE.fields_by_name['boolVal'])
-_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value']
-_KPILIST.fields_by_name['kpi_list'].message_type = _KPI
-DESCRIPTOR.message_types_by_name['KpiDescriptor'] = _KPIDESCRIPTOR
-DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST
-DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID
-DESCRIPTOR.message_types_by_name['Kpi'] = _KPI
-DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE
-DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-KpiDescriptor = _reflection.GeneratedProtocolMessageType('KpiDescriptor', (_message.Message,), {
- 'DESCRIPTOR' : _KPIDESCRIPTOR,
- '__module__' : 'monitoring_pb2'
- # @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor)
- })
-_sym_db.RegisterMessage(KpiDescriptor)
-
-MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), {
- 'DESCRIPTOR' : _MONITORKPIREQUEST,
- '__module__' : 'monitoring_pb2'
- # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest)
- })
-_sym_db.RegisterMessage(MonitorKpiRequest)
-
-KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), {
- 'DESCRIPTOR' : _KPIID,
- '__module__' : 'monitoring_pb2'
- # @@protoc_insertion_point(class_scope:monitoring.KpiId)
- })
-_sym_db.RegisterMessage(KpiId)
-
-Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), {
- 'DESCRIPTOR' : _KPI,
- '__module__' : 'monitoring_pb2'
- # @@protoc_insertion_point(class_scope:monitoring.Kpi)
- })
-_sym_db.RegisterMessage(Kpi)
-
-KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), {
- 'DESCRIPTOR' : _KPIVALUE,
- '__module__' : 'monitoring_pb2'
- # @@protoc_insertion_point(class_scope:monitoring.KpiValue)
- })
-_sym_db.RegisterMessage(KpiValue)
-
-KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), {
- 'DESCRIPTOR' : _KPILIST,
- '__module__' : 'monitoring_pb2'
- # @@protoc_insertion_point(class_scope:monitoring.KpiList)
- })
-_sym_db.RegisterMessage(KpiList)
-
-
-
-_MONITORINGSERVICE = _descriptor.ServiceDescriptor(
- name='MonitoringService',
- full_name='monitoring.MonitoringService',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=694,
- serialized_end=1065,
- methods=[
- _descriptor.MethodDescriptor(
- name='CreateKpi',
- full_name='monitoring.MonitoringService.CreateKpi',
- index=0,
- containing_service=None,
- input_type=_KPIDESCRIPTOR,
- output_type=_KPIID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetKpiDescriptor',
- full_name='monitoring.MonitoringService.GetKpiDescriptor',
- index=1,
- containing_service=None,
- input_type=_KPIID,
- output_type=_KPIDESCRIPTOR,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='IncludeKpi',
- full_name='monitoring.MonitoringService.IncludeKpi',
- index=2,
- containing_service=None,
- input_type=_KPI,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='MonitorKpi',
- full_name='monitoring.MonitoringService.MonitorKpi',
- index=3,
- containing_service=None,
- input_type=_MONITORKPIREQUEST,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetStreamKpi',
- full_name='monitoring.MonitoringService.GetStreamKpi',
- index=4,
- containing_service=None,
- input_type=_KPIID,
- output_type=_KPI,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='GetInstantKpi',
- full_name='monitoring.MonitoringService.GetInstantKpi',
- index=5,
- containing_service=None,
- input_type=_KPIID,
- output_type=_KPI,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE)
-
-DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalcentralizedattackdetector/proto/optical_centralized_attack_detector_pb2.py b/src/opticalcentralizedattackdetector/proto/optical_centralized_attack_detector_pb2.py
deleted file mode 100644
index b97a93fef290a5d27c2369d3b69d1405ea8a6442..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/optical_centralized_attack_detector_pb2.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: optical_centralized_attack_detector.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import context_pb2 as context__pb2
-from . import monitoring_pb2 as monitoring__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='optical_centralized_attack_detector.proto',
- package='centralized_attack_detector',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n)optical_centralized_attack_detector.proto\x12\x1b\x63\x65ntralized_attack_detector\x1a\rcontext.proto\x1a\x10monitoring.proto2\x88\x02\n\'OpticalCentralizedAttackDetectorService\x12\x39\n\x13NotifyServiceUpdate\x12\x10.context.Service\x1a\x0e.context.Empty\"\x00\x12\x30\n\x0c\x44\x65tectAttack\x12\x0e.context.Empty\x1a\x0e.context.Empty\"\x00\x12<\n\x13ReportSummarizedKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x12\x32\n\tReportKpi\x12\x13.monitoring.KpiList\x1a\x0e.context.Empty\"\x00\x62\x06proto3'
- ,
- dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,])
-
-
-
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-
-
-_OPTICALCENTRALIZEDATTACKDETECTORSERVICE = _descriptor.ServiceDescriptor(
- name='OpticalCentralizedAttackDetectorService',
- full_name='centralized_attack_detector.OpticalCentralizedAttackDetectorService',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=108,
- serialized_end=372,
- methods=[
- _descriptor.MethodDescriptor(
- name='NotifyServiceUpdate',
- full_name='centralized_attack_detector.OpticalCentralizedAttackDetectorService.NotifyServiceUpdate',
- index=0,
- containing_service=None,
- input_type=context__pb2._SERVICE,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='DetectAttack',
- full_name='centralized_attack_detector.OpticalCentralizedAttackDetectorService.DetectAttack',
- index=1,
- containing_service=None,
- input_type=context__pb2._EMPTY,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ReportSummarizedKpi',
- full_name='centralized_attack_detector.OpticalCentralizedAttackDetectorService.ReportSummarizedKpi',
- index=2,
- containing_service=None,
- input_type=monitoring__pb2._KPILIST,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='ReportKpi',
- full_name='centralized_attack_detector.OpticalCentralizedAttackDetectorService.ReportKpi',
- index=3,
- containing_service=None,
- input_type=monitoring__pb2._KPILIST,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_OPTICALCENTRALIZEDATTACKDETECTORSERVICE)
-
-DESCRIPTOR.services_by_name['OpticalCentralizedAttackDetectorService'] = _OPTICALCENTRALIZEDATTACKDETECTORSERVICE
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalcentralizedattackdetector/proto/optical_centralized_attack_detector_pb2_grpc.py b/src/opticalcentralizedattackdetector/proto/optical_centralized_attack_detector_pb2_grpc.py
deleted file mode 100644
index 17b839fa3bbaafb8ecfa795db21ba6baba8cd28b..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/optical_centralized_attack_detector_pb2_grpc.py
+++ /dev/null
@@ -1,168 +0,0 @@
-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
-"""Client and server classes corresponding to protobuf-defined services."""
-import grpc
-
-from . import context_pb2 as context__pb2
-from . import monitoring_pb2 as monitoring__pb2
-
-
-class OpticalCentralizedAttackDetectorServiceStub(object):
- """Missing associated documentation comment in .proto file."""
-
- def __init__(self, channel):
- """Constructor.
-
- Args:
- channel: A grpc.Channel.
- """
- self.NotifyServiceUpdate = channel.unary_unary(
- '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/NotifyServiceUpdate',
- request_serializer=context__pb2.Service.SerializeToString,
- response_deserializer=context__pb2.Empty.FromString,
- )
- self.DetectAttack = channel.unary_unary(
- '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/DetectAttack',
- request_serializer=context__pb2.Empty.SerializeToString,
- response_deserializer=context__pb2.Empty.FromString,
- )
- self.ReportSummarizedKpi = channel.unary_unary(
- '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/ReportSummarizedKpi',
- request_serializer=monitoring__pb2.KpiList.SerializeToString,
- response_deserializer=context__pb2.Empty.FromString,
- )
- self.ReportKpi = channel.unary_unary(
- '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/ReportKpi',
- request_serializer=monitoring__pb2.KpiList.SerializeToString,
- response_deserializer=context__pb2.Empty.FromString,
- )
-
-
-class OpticalCentralizedAttackDetectorServiceServicer(object):
- """Missing associated documentation comment in .proto file."""
-
- def NotifyServiceUpdate(self, request, context):
- """Missing associated documentation comment in .proto file."""
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
- def DetectAttack(self, request, context):
- """rpc that triggers the attack detection loop
- """
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
- def ReportSummarizedKpi(self, request, context):
- """rpc called by the distributed component to report KPIs
- """
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
- def ReportKpi(self, request, context):
- """Missing associated documentation comment in .proto file."""
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
-
-def add_OpticalCentralizedAttackDetectorServiceServicer_to_server(servicer, server):
- rpc_method_handlers = {
- 'NotifyServiceUpdate': grpc.unary_unary_rpc_method_handler(
- servicer.NotifyServiceUpdate,
- request_deserializer=context__pb2.Service.FromString,
- response_serializer=context__pb2.Empty.SerializeToString,
- ),
- 'DetectAttack': grpc.unary_unary_rpc_method_handler(
- servicer.DetectAttack,
- request_deserializer=context__pb2.Empty.FromString,
- response_serializer=context__pb2.Empty.SerializeToString,
- ),
- 'ReportSummarizedKpi': grpc.unary_unary_rpc_method_handler(
- servicer.ReportSummarizedKpi,
- request_deserializer=monitoring__pb2.KpiList.FromString,
- response_serializer=context__pb2.Empty.SerializeToString,
- ),
- 'ReportKpi': grpc.unary_unary_rpc_method_handler(
- servicer.ReportKpi,
- request_deserializer=monitoring__pb2.KpiList.FromString,
- response_serializer=context__pb2.Empty.SerializeToString,
- ),
- }
- generic_handler = grpc.method_handlers_generic_handler(
- 'centralized_attack_detector.OpticalCentralizedAttackDetectorService', rpc_method_handlers)
- server.add_generic_rpc_handlers((generic_handler,))
-
-
- # This class is part of an EXPERIMENTAL API.
-class OpticalCentralizedAttackDetectorService(object):
- """Missing associated documentation comment in .proto file."""
-
- @staticmethod
- def NotifyServiceUpdate(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/NotifyServiceUpdate',
- context__pb2.Service.SerializeToString,
- context__pb2.Empty.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
-
- @staticmethod
- def DetectAttack(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/DetectAttack',
- context__pb2.Empty.SerializeToString,
- context__pb2.Empty.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
-
- @staticmethod
- def ReportSummarizedKpi(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/ReportSummarizedKpi',
- monitoring__pb2.KpiList.SerializeToString,
- context__pb2.Empty.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
-
- @staticmethod
- def ReportKpi(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/centralized_attack_detector.OpticalCentralizedAttackDetectorService/ReportKpi',
- monitoring__pb2.KpiList.SerializeToString,
- context__pb2.Empty.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/src/opticalcentralizedattackdetector/proto/service_pb2.py b/src/opticalcentralizedattackdetector/proto/service_pb2.py
deleted file mode 100644
index 8e2806c7685e24ab90a3d59a19f1e4f99ebc9712..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/proto/service_pb2.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: service.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import context_pb2 as context__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='service.proto',
- package='service',
- syntax='proto3',
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3'
- ,
- dependencies=[context__pb2.DESCRIPTOR,])
-
-
-
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-
-
-_SERVICESERVICE = _descriptor.ServiceDescriptor(
- name='ServiceService',
- full_name='service.ServiceService',
- file=DESCRIPTOR,
- index=0,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- serialized_start=42,
- serialized_end=227,
- methods=[
- _descriptor.MethodDescriptor(
- name='CreateService',
- full_name='service.ServiceService.CreateService',
- index=0,
- containing_service=None,
- input_type=context__pb2._SERVICE,
- output_type=context__pb2._SERVICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='UpdateService',
- full_name='service.ServiceService.UpdateService',
- index=1,
- containing_service=None,
- input_type=context__pb2._SERVICE,
- output_type=context__pb2._SERVICEID,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
- _descriptor.MethodDescriptor(
- name='DeleteService',
- full_name='service.ServiceService.DeleteService',
- index=2,
- containing_service=None,
- input_type=context__pb2._SERVICEID,
- output_type=context__pb2._EMPTY,
- serialized_options=None,
- create_key=_descriptor._internal_create_key,
- ),
-])
-_sym_db.RegisterServiceDescriptor(_SERVICESERVICE)
-
-DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE
-
-# @@protoc_insertion_point(module_scope)
diff --git a/src/opticalcentralizedattackdetector/requirements.in b/src/opticalcentralizedattackdetector/requirements.in
deleted file mode 100644
index 378e9a10a70f6a41a264c6a76f47239d7515989a..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/requirements.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-grpcio-health-checking
-grpcio
-prometheus-client
-pytest
-pytest-benchmark
-redis
-# from the monitoring component
-influxdb
-python-json-logger
-coverage
diff --git a/src/opticalcentralizedattackdetector/requirements.txt b/src/opticalcentralizedattackdetector/requirements.txt
deleted file mode 100644
index 5d13e7bc5d318c65e5cc0fe8a4501631aa5428ff..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/requirements.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-#
-# This file is autogenerated by pip-compile with python 3.9
-# To update, run:
-#
-# pip-compile --output-file=opticalcentralizedattackdetector/requirements.txt opticalcentralizedattackdetector/requirements.in
-#
-attrs==21.2.0
- # via pytest
-certifi==2021.10.8
- # via influxdb-client
-grpcio==1.41.0
- # via
- # -r opticalcentralizedattackdetector/requirements.in
- # grpcio-health-checking
-grpcio-health-checking==1.41.0
- # via -r opticalcentralizedattackdetector/requirements.in
-influxdb-client==1.23.0
- # via -r opticalcentralizedattackdetector/requirements.in
-iniconfig==1.1.1
- # via pytest
-packaging==21.0
- # via pytest
-pluggy==1.0.0
- # via pytest
-prometheus-client==0.11.0
- # via -r opticalcentralizedattackdetector/requirements.in
-protobuf==3.18.0
- # via grpcio-health-checking
-py==1.10.0
- # via pytest
-py-cpuinfo==8.0.0
- # via pytest-benchmark
-pyparsing==2.4.7
- # via packaging
-pytest==6.2.5
- # via
- # -r opticalcentralizedattackdetector/requirements.in
- # pytest-benchmark
-pytest-benchmark==3.4.1
- # via -r opticalcentralizedattackdetector/requirements.in
-python-dateutil==2.8.2
- # via influxdb-client
-pytz==2021.3
- # via influxdb-client
-redis==3.5.3
- # via -r opticalcentralizedattackdetector/requirements.in
-rx==3.2.0
- # via influxdb-client
-six==1.16.0
- # via
- # grpcio
- # influxdb-client
- # python-dateutil
-toml==0.10.2
- # via pytest
-urllib3==1.26.7
- # via influxdb-client
-
-# The following packages are considered to be unsafe in a requirements file:
-# setuptools
diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py
deleted file mode 100644
index f281063f47cd7ef79b06640a5588286699d55848..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-import grpc
-import logging
-from concurrent import futures
-from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH
-from grpc_health.v1.health_pb2 import HealthCheckResponse
-from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server
-from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_pb2_grpc import (
- add_OpticalCentralizedAttackDetectorServiceServicer_to_server)
-from opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl import (
- OpticalCentralizedAttackDetectorServiceServicerImpl)
-from opticalcentralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD
-
-BIND_ADDRESS = '0.0.0.0'
-LOGGER = logging.getLogger(__name__)
-
-class OpticalCentralizedAttackDetectorService:
- def __init__(
- self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS,
- grace_period=GRPC_GRACE_PERIOD):
-
- self.address = address
- self.port = port
- self.endpoint = None
- self.max_workers = max_workers
- self.grace_period = grace_period
- self.centralized_attack_detector_servicer = None
- self.health_servicer = None
- self.pool = None
- self.server = None
-
- def start(self):
- self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port))
- LOGGER.debug('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format(
- str(self.endpoint), str(self.max_workers)))
-
- self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers)
- self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,))
-
- self.centralized_attack_detector_servicer = OpticalCentralizedAttackDetectorServiceServicerImpl()
- add_OpticalCentralizedAttackDetectorServiceServicer_to_server(self.centralized_attack_detector_servicer, self.server)
-
- self.health_servicer = HealthServicer(
- experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1))
- add_HealthServicer_to_server(self.health_servicer, self.server)
-
- port = self.server.add_insecure_port(self.endpoint)
- self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port))
- LOGGER.info('Listening on {:s}...'.format(self.endpoint))
- self.server.start()
- self.health_servicer.set(OVERALL_HEALTH, HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member
-
- LOGGER.debug('Service started')
-
- def stop(self):
- LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period)))
- self.health_servicer.enter_graceful_shutdown()
- self.server.stop(self.grace_period)
- LOGGER.debug('Service stopped')
diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py
deleted file mode 100644
index c3ca1c1cfc21dd22c3f2f801a8d1c1321274ad29..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py
+++ /dev/null
@@ -1,138 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-import os, grpc, logging, random
-from influxdb import InfluxDBClient
-from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method
-from context.client.ContextClient import ContextClient
-from monitoring.client.MonitoringClient import MonitoringClient
-from service.client.ServiceClient import ServiceClient
-from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse, Sample
-from dbscanserving.client.DbscanServingClient import DbscanServingClient
-from dbscanserving.Config import GRPC_SERVICE_PORT as DBSCANSERVING_GRPC_SERVICE_PORT
-from opticalattackmitigator.client.OpticalAttackMitigatorClient import OpticalAttackMitigatorClient
-from opticalattackmitigator.proto.optical_attack_mitigator_pb2 import AttackDescription, AttackResponse
-from opticalattackmitigator.Config import GRPC_SERVICE_PORT as ATTACK_MITIGATOR_GRPC_SERVICE_PORT
-from opticalcentralizedattackdetector.proto.context_pb2 import (Empty,
- Context, ContextId, ContextIdList, ContextList,
- Service, ServiceId, ServiceIdList, ServiceList
-)
-from opticalcentralizedattackdetector.proto.monitoring_pb2 import KpiList
-from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_pb2_grpc import (
- OpticalCentralizedAttackDetectorServiceServicer)
-from opticalcentralizedattackdetector.Config import (
- INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, ATTACK_MITIGATOR_SERVICE_ADDRESS)
-
-
-LOGGER = logging.getLogger(__name__)
-
-METRICS_POOL = MetricsPool('OpticalCentralizedAttackDetector', 'RPC')
-
-INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME")
-INFLUXDB_USER = os.environ.get("INFLUXDB_USER")
-INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD")
-INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE")
-context_client: ContextClient = ContextClient()
-influxdb_client: InfluxDBClient = InfluxDBClient(
- host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD,
- database=INFLUXDB_DATABASE)
-monitoring_client: MonitoringClient = MonitoringClient()
-dbscanserving_client: DbscanServingClient = DbscanServingClient(
- address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT)
-service_client: ServiceClient = ServiceClient()
-attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient(
- address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT)
-
-
-class OpticalCentralizedAttackDetectorServiceServicerImpl(OpticalCentralizedAttackDetectorServiceServicer):
-
- def __init__(self):
- LOGGER.debug('Creating Servicer...')
- LOGGER.debug('Servicer Created')
-
- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
- def NotifyServiceUpdate(self, request : Service, context : grpc.ServicerContext) -> Empty:
- return Empty()
-
- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
- def DetectAttack(self, request : Empty, context : grpc.ServicerContext) -> Empty:
-
- # retrieve list with current contexts
- # import pdb; pdb.set_trace()
- context_ids: ContextIdList = context_client.ListContextIds(Empty())
-
- # for each context, retrieve list of current services
- services = []
- for context_id in context_ids.context_ids:
-
- context_services: ServiceIdList = context_client.ListServices(context_id)
- for service in context_services.services:
- services.append(service)
-
- # get monitoring data for each of the current services
- results = influxdb_client.query('select * from samples;')
-
- for service in services:
- for endpoint in service.service_endpoint_ids:
- # get instant KPI for this endpoint
- LOGGER.warning(f'service: {service.service_id.service_uuid.uuid}\t endpoint: {endpoint.endpoint_uuid.uuid}\tdevice: {endpoint.device_id.device_uuid.uuid}')
- # how to get all KPIs for a particular device?
- points = results.get_points(tags={'device_id': endpoint.device_id.device_uuid.uuid})
- print('points:', points)
- for point in points:
- print('\t', point)
-
- # run attack detection for every service
- request: DetectionRequest = DetectionRequest()
-
- request.num_samples = 310
- request.num_features = 100
- request.eps = 100.5
- request.min_samples = 50
-
- for _ in range(200):
- grpc_sample = Sample()
- for __ in range(100):
- grpc_sample.features.append(random.uniform(0., 10.))
- request.samples.append(grpc_sample)
-
- for _ in range(100):
- grpc_sample = Sample()
- for __ in range(100):
- grpc_sample.features.append(random.uniform(50., 60.))
- request.samples.append(grpc_sample)
-
- for _ in range(10):
- grpc_sample = Sample()
- for __ in range(100):
- grpc_sample.features.append(random.uniform(5000., 6000.))
- request.samples.append(grpc_sample)
-
- response: DetectionResponse = dbscanserving_client.Detect(request)
-
- if -1 in response.cluster_indices: # attack detected
- attack = AttackDescription()
- attack.cs_id.uuid = service.service_id.service_uuid.uuid
- response: AttackResponse = attack_mitigator_client.NotifyAttack(attack)
-
- # if attack is detected, run the attack mitigator
- return Empty()
-
- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
- def ReportSummarizedKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty:
- return Empty()
-
- @safe_and_metered_rpc_method(METRICS_POOL, LOGGER)
- def ReportKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty:
- return Empty()
diff --git a/src/opticalcentralizedattackdetector/service/__init__.py b/src/opticalcentralizedattackdetector/service/__init__.py
deleted file mode 100644
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/service/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
diff --git a/src/opticalcentralizedattackdetector/service/__main__.py b/src/opticalcentralizedattackdetector/service/__main__.py
deleted file mode 100644
index 89dfe277d1b642727cca1199e250153264aeb5c2..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/service/__main__.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-import os, logging, signal, sys, time, threading, multiprocessing
-from prometheus_client import start_http_server
-
-from common.Settings import get_setting
-from opticalcentralizedattackdetector.Config import (
- GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT,
- MONITORING_INTERVAL)
-from opticalcentralizedattackdetector.proto.context_pb2 import (Empty,
- Context, ContextId, ContextIdList, ContextList,
- Service, ServiceId, ServiceIdList, ServiceList
-)
-from opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorService import OpticalCentralizedAttackDetectorService
-from opticalcentralizedattackdetector.client.OpticalCentralizedAttackDetectorClient import OpticalCentralizedAttackDetectorClient
-
-terminate = threading.Event()
-LOGGER = None
-
-client: OpticalCentralizedAttackDetectorClient = None
-
-def signal_handler(signal, frame): # pylint: disable=redefined-outer-name
- LOGGER.warning('Terminate signal received')
- terminate.set()
-
-def detect_attack(monitoring_interval):
- time.sleep(10) # wait for the service to start
- LOGGER.info("Starting the attack detection loop")
- client = OpticalCentralizedAttackDetectorClient(address='localhost', port=GRPC_SERVICE_PORT)
- client.connect()
- while True: # infinite loop that runs until the terminate is set
- if terminate.is_set(): # if terminate is set
- LOGGER.warning("Stopping execution...")
- client.close()
- break # break the while and stop execution
- client.DetectAttack(Empty())
- # sleep
- LOGGER.debug("Sleeping for {} seconds...".format(monitoring_interval))
- time.sleep(monitoring_interval)
-
-def main():
- global LOGGER # pylint: disable=global-statement
-
- service_port = get_setting('OPTICALCENTRALIZEDATTACKDETECTORSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT)
- max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS )
- grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD)
- log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL )
- metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT )
- monitoring_interval = get_setting('MONITORING_INTERVAL', default=MONITORING_INTERVAL )
-
- logging.basicConfig(level=log_level)
- LOGGER = logging.getLogger(__name__)
-
- signal.signal(signal.SIGINT, signal_handler)
- signal.signal(signal.SIGTERM, signal_handler)
-
- LOGGER.info('Starting...')
-
- # Start metrics server
- start_http_server(metrics_port)
-
- # Starting CentralizedCybersecurity service
- grpc_service = OpticalCentralizedAttackDetectorService(
- port=service_port, max_workers=max_workers, grace_period=grace_period)
- grpc_service.start()
-
- # p = multiprocessing.Process(target=detect_attack, args=(monitoring_interval, ))
- # p.start()
- detect_attack(monitoring_interval)
-
- # Wait for Ctrl+C or termination signal
- while not terminate.wait(timeout=0.1): pass
-
- LOGGER.info('Terminating...')
- grpc_service.stop()
- # p.kill()
-
- LOGGER.info('Bye')
- return 0
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/src/opticalcentralizedattackdetector/tests/__init__.py b/src/opticalcentralizedattackdetector/tests/__init__.py
deleted file mode 100644
index 1549d9811aa5d1c193a44ad45d0d7773236c0612..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/tests/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
diff --git a/src/opticalcentralizedattackdetector/tests/example_objects.py b/src/opticalcentralizedattackdetector/tests/example_objects.py
deleted file mode 100644
index a6859bfb4defd4ccb9df318222237efb8e9cb036..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/tests/example_objects.py
+++ /dev/null
@@ -1,215 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-from copy import deepcopy
-from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME
-from context.proto.context_pb2 import (
- ConfigActionEnum, DeviceDriverEnum, DeviceOperationalStatusEnum, ServiceStatusEnum, ServiceTypeEnum)
-
-# Some example objects to be used by the tests
-
-# Helper methods
-def config_rule(action, resource_key, resource_value):
- return {'action': action, 'resource_key': resource_key, 'resource_value': resource_value}
-
-def endpoint_id(topology_id, device_id, endpoint_uuid):
- return {'topology_id': deepcopy(topology_id), 'device_id': deepcopy(device_id),
- 'endpoint_uuid': {'uuid': endpoint_uuid}}
-
-def endpoint(topology_id, device_id, endpoint_uuid, endpoint_type):
- return {'endpoint_id': endpoint_id(topology_id, device_id, endpoint_uuid), 'endpoint_type': endpoint_type}
-
-## use "deepcopy" to prevent propagating forced changes during tests
-CONTEXT_ID = {'context_uuid': {'uuid': DEFAULT_CONTEXT_NAME}}
-CONTEXT = {
- 'context_id': deepcopy(CONTEXT_ID),
- 'topology_ids': [],
- 'service_ids': [],
-}
-
-CONTEXT_ID_2 = {'context_uuid': {'uuid': 'test'}}
-CONTEXT_2 = {
- 'context_id': deepcopy(CONTEXT_ID_2),
- 'topology_ids': [],
- 'service_ids': [],
-}
-
-TOPOLOGY_ID = {
- 'context_id': deepcopy(CONTEXT_ID),
- 'topology_uuid': {'uuid': DEFAULT_TOPOLOGY_NAME},
-}
-TOPOLOGY = {
- 'topology_id': deepcopy(TOPOLOGY_ID),
- 'device_ids': [],
- 'link_ids': [],
-}
-
-DEVICE1_UUID = 'DEV1'
-DEVICE1_ID = {'device_uuid': {'uuid': DEVICE1_UUID}}
-DEVICE1 = {
- 'device_id': deepcopy(DEVICE1_ID),
- 'device_type': 'packet-router',
- 'device_config': {'config_rules': [
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc1/value', 'value1'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc2/value', 'value2'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc3/value', 'value3'),
- ]},
- 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
- 'device_drivers': [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_P4],
- 'device_endpoints': [
- endpoint(TOPOLOGY_ID, DEVICE1_ID, 'EP2', 'port-packet-100G'),
- endpoint(TOPOLOGY_ID, DEVICE1_ID, 'EP3', 'port-packet-100G'),
- endpoint(TOPOLOGY_ID, DEVICE1_ID, 'EP100', 'port-packet-10G'),
- ],
-}
-
-DEVICE2_UUID = 'DEV2'
-DEVICE2_ID = {'device_uuid': {'uuid': DEVICE2_UUID}}
-DEVICE2 = {
- 'device_id': deepcopy(DEVICE2_ID),
- 'device_type': 'packet-router',
- 'device_config': {'config_rules': [
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc1/value', 'value4'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc2/value', 'value5'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc3/value', 'value6'),
- ]},
- 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
- 'device_drivers': [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_P4],
- 'device_endpoints': [
- endpoint(TOPOLOGY_ID, DEVICE2_ID, 'EP1', 'port-packet-100G'),
- endpoint(TOPOLOGY_ID, DEVICE2_ID, 'EP3', 'port-packet-100G'),
- endpoint(TOPOLOGY_ID, DEVICE2_ID, 'EP100', 'port-packet-10G'),
- ],
-}
-
-DEVICE3_UUID = 'DEV3'
-DEVICE3_ID = {'device_uuid': {'uuid': DEVICE3_UUID}}
-DEVICE3 = {
- 'device_id': deepcopy(DEVICE3_ID),
- 'device_type': 'packet-router',
- 'device_config': {'config_rules': [
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc1/value', 'value4'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc2/value', 'value5'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'dev/rsrc3/value', 'value6'),
- ]},
- 'device_operational_status': DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED,
- 'device_drivers': [DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG, DeviceDriverEnum.DEVICEDRIVER_P4],
- 'device_endpoints': [
- endpoint(TOPOLOGY_ID, DEVICE3_ID, 'EP1', 'port-packet-100G'),
- endpoint(TOPOLOGY_ID, DEVICE3_ID, 'EP2', 'port-packet-100G'),
- endpoint(TOPOLOGY_ID, DEVICE3_ID, 'EP100', 'port-packet-10G'),
- ],
-}
-
-LINK_DEV1_DEV2_UUID = 'DEV1/EP2 ==> DEV2/EP1'
-LINK_DEV1_DEV2_ID = {'link_uuid': {'uuid': LINK_DEV1_DEV2_UUID}}
-LINK_DEV1_DEV2 = {
- 'link_id': deepcopy(LINK_DEV1_DEV2_ID),
- 'link_endpoint_ids' : [
- endpoint_id(TOPOLOGY_ID, DEVICE1_ID, 'EP2'),
- endpoint_id(TOPOLOGY_ID, DEVICE2_ID, 'EP1'),
- ]
-}
-
-LINK_DEV2_DEV3_UUID = 'DEV2/EP3 ==> DEV3/EP2'
-LINK_DEV2_DEV3_ID = {'link_uuid': {'uuid': LINK_DEV2_DEV3_UUID}}
-LINK_DEV2_DEV3 = {
- 'link_id': deepcopy(LINK_DEV2_DEV3_ID),
- 'link_endpoint_ids' : [
- endpoint_id(TOPOLOGY_ID, DEVICE2_ID, 'EP3'),
- endpoint_id(TOPOLOGY_ID, DEVICE3_ID, 'EP2'),
- ]
-}
-
-LINK_DEV1_DEV3_UUID = 'DEV1/EP3 ==> DEV3/EP1'
-LINK_DEV1_DEV3_ID = {'link_uuid': {'uuid': LINK_DEV1_DEV3_UUID}}
-LINK_DEV1_DEV3 = {
- 'link_id': deepcopy(LINK_DEV1_DEV3_ID),
- 'link_endpoint_ids' : [
- endpoint_id(TOPOLOGY_ID, DEVICE1_ID, 'EP3'),
- endpoint_id(TOPOLOGY_ID, DEVICE3_ID, 'EP1'),
- ]
-}
-
-SERVICE_DEV1_DEV2_UUID = 'SVC:DEV1/EP100-DEV2/EP100'
-SERVICE_DEV1_DEV2_ID = {
- 'context_id': deepcopy(CONTEXT_ID),
- 'service_uuid': {'uuid': SERVICE_DEV1_DEV2_UUID},
-}
-SERVICE_DEV1_DEV2 = {
- 'service_id': deepcopy(SERVICE_DEV1_DEV2_ID),
- 'service_type': ServiceTypeEnum.SERVICETYPE_L3NM,
- 'service_endpoint_ids' : [
- endpoint_id(TOPOLOGY_ID, DEVICE1_ID, 'EP100'),
- endpoint_id(TOPOLOGY_ID, DEVICE2_ID, 'EP100'),
- ],
- 'service_constraints': [
- {'constraint_type': 'latency_ms', 'constraint_value': '15.2'},
- {'constraint_type': 'jitter_us', 'constraint_value': '1.2'},
- ],
- 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_ACTIVE},
- 'service_config': {'config_rules': [
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc1/value', 'value7'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc2/value', 'value8'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc3/value', 'value9'),
- ]},
-}
-
-SERVICE_DEV1_DEV3_UUID = 'SVC:DEV1/EP100-DEV3/EP100'
-SERVICE_DEV1_DEV3_ID = {
- 'context_id': deepcopy(CONTEXT_ID),
- 'service_uuid': {'uuid': SERVICE_DEV1_DEV3_UUID},
-}
-SERVICE_DEV1_DEV3 = {
- 'service_id': deepcopy(SERVICE_DEV1_DEV3_ID),
- 'service_type': ServiceTypeEnum.SERVICETYPE_L3NM,
- 'service_endpoint_ids' : [
- endpoint_id(TOPOLOGY_ID, DEVICE1_ID, 'EP100'),
- endpoint_id(TOPOLOGY_ID, DEVICE3_ID, 'EP100'),
- ],
- 'service_constraints': [
- {'constraint_type': 'latency_ms', 'constraint_value': '5.8'},
- {'constraint_type': 'jitter_us', 'constraint_value': '0.1'},
- ],
- 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_ACTIVE},
- 'service_config': {'config_rules': [
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc1/value', 'value7'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc2/value', 'value8'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc3/value', 'value9'),
- ]},
-}
-
-SERVICE_DEV2_DEV3_UUID = 'SVC:DEV2/EP100-DEV3/EP100'
-SERVICE_DEV2_DEV3_ID = {
- 'context_id': deepcopy(CONTEXT_ID),
- 'service_uuid': {'uuid': SERVICE_DEV2_DEV3_UUID},
-}
-SERVICE_DEV2_DEV3 = {
- 'service_id': deepcopy(SERVICE_DEV2_DEV3_ID),
- 'service_type': ServiceTypeEnum.SERVICETYPE_L3NM,
- 'service_endpoint_ids' : [
- endpoint_id(TOPOLOGY_ID, DEVICE2_ID, 'EP100'),
- endpoint_id(TOPOLOGY_ID, DEVICE3_ID, 'EP100'),
- ],
- 'service_constraints': [
- {'constraint_type': 'latency_ms', 'constraint_value': '23.1'},
- {'constraint_type': 'jitter_us', 'constraint_value': '3.4'},
- ],
- 'service_status': {'service_status': ServiceStatusEnum.SERVICESTATUS_ACTIVE},
- 'service_config': {'config_rules': [
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc1/value', 'value7'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc2/value', 'value8'),
- config_rule(ConfigActionEnum.CONFIGACTION_SET, 'svc/rsrc3/value', 'value9'),
- ]},
-}
diff --git a/src/opticalcentralizedattackdetector/tests/test_unitary.py b/src/opticalcentralizedattackdetector/tests/test_unitary.py
deleted file mode 100644
index d89ef2fe27a7d284b655698e7ee89e79b230b04b..0000000000000000000000000000000000000000
--- a/src/opticalcentralizedattackdetector/tests/test_unitary.py
+++ /dev/null
@@ -1,190 +0,0 @@
-# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
-
-import logging, pytest
-from unittest.mock import patch
-from opticalcentralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD
-from opticalcentralizedattackdetector.client.OpticalCentralizedAttackDetectorClient import OpticalCentralizedAttackDetectorClient
-from opticalcentralizedattackdetector.proto.context_pb2 import ContextIdList, ContextId, Empty, Service, ContextId, ServiceList
-from opticalcentralizedattackdetector.proto.monitoring_pb2 import Kpi, KpiList
-from opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorService import OpticalCentralizedAttackDetectorService
-from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
-
-port = 10000 + GRPC_SERVICE_PORT # avoid privileged ports
-
-LOGGER = logging.getLogger(__name__)
-LOGGER.setLevel(logging.DEBUG)
-
-@pytest.fixture(scope='session')
-def optical_centralized_attack_detector_service():
- _service = OpticalCentralizedAttackDetectorService(
- port=port, max_workers=GRPC_MAX_WORKERS, grace_period=GRPC_GRACE_PERIOD)
- # mocker_context_client = mock.patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client')
- # mocker_context_client.start()
-
- # mocker_influx_db = mock.patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client')
- # mocker_influx_db.start()
-
- _service.start()
- yield _service
- _service.stop()
- # mocker_context_client.stop()
- # mocker_influx_db.stop()
-
-@pytest.fixture(scope='session')
-def optical_centralized_attack_detector_client(optical_centralized_attack_detector_service):
- _client = OpticalCentralizedAttackDetectorClient(address='127.0.0.1', port=port)
- yield _client
- _client.close()
-
-def test_notify_service_update(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient):
- service = Service()
- optical_centralized_attack_detector_client.NotifyServiceUpdate(service)
-
-def test_detect_attack_no_contexts(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient):
- with patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client') as context, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client') as influxdb:
- request = Empty()
- optical_centralized_attack_detector_client.DetectAttack(request)
- context.ListContextIds.assert_called_once()
- influxdb.query.assert_called_once()
- context.ListServices.assert_not_called()
-
-def test_detect_attack_with_context(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient,):
- with patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client') as context, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client') as influxdb:
- # setting up the mock
- cid_list = ContextIdList()
- cid_list.context_ids.append(ContextId(**CONTEXT_ID))
- context.ListContextIds.return_value = cid_list
-
- # making the test
- request = Empty()
- optical_centralized_attack_detector_client.DetectAttack(request)
-
- # checking behavior
- context.ListContextIds.assert_called_once()
- context.ListServices.assert_called_with(cid_list.context_ids[0])
- influxdb.query.assert_called_once()
-
-def test_detect_attack_with_contexts(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient,):
- with patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client') as context, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client') as influxdb:
- # setting up the mock
- cid_list = ContextIdList()
- cid_list.context_ids.append(ContextId(**CONTEXT_ID))
- cid_list.context_ids.append(ContextId(**CONTEXT_ID_2))
- context.ListContextIds.return_value = cid_list
-
- # making the test
- request = Empty()
- optical_centralized_attack_detector_client.DetectAttack(request)
-
- # checking behavior
- context.ListContextIds.assert_called_once()
- context.ListServices.assert_any_call(cid_list.context_ids[0])
- context.ListServices.assert_any_call(cid_list.context_ids[1])
- influxdb.query.assert_called_once()
-
-def test_detect_attack_with_service(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient,):
- with patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client') as context, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client') as influxdb, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.dbscanserving_client') as dbscan:
-
- # setting up the mock
- cid_list = ContextIdList()
- cid_list.context_ids.append(ContextId(**CONTEXT_ID))
- context.ListContextIds.return_value = cid_list
-
- service_list = ServiceList()
- service_list.services.append(Service(**SERVICE_DEV1_DEV2))
- context.ListServices.return_value = service_list
-
- influxdb.query.return_value.get_points.return_value = [(1, 2), (3, 4)]
-
- # making the test
- request = Empty()
- optical_centralized_attack_detector_client.DetectAttack(request)
-
- # checking behavior
- context.ListContextIds.assert_called_once()
- context.ListServices.assert_called_with(cid_list.context_ids[0])
- influxdb.query.assert_called_once()
- dbscan.Detect.assert_called()
-
-def test_detect_attack_no_attack(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient,):
- with patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client') as context, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client') as influxdb, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.dbscanserving_client') as dbscan, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.attack_mitigator_client') as mitigator:
-
- # setting up the mock
- cid_list = ContextIdList()
- cid_list.context_ids.append(ContextId(**CONTEXT_ID))
- context.ListContextIds.return_value = cid_list
-
- service_list = ServiceList()
- service_list.services.append(Service(**SERVICE_DEV1_DEV2))
- context.ListServices.return_value = service_list
-
- # dbscan.Detect.return_value = object()
- dbscan.Detect.return_value.cluster_indices = [0, 1, 2, 3, 4, 5]
-
- # making the test
- request = Empty()
- optical_centralized_attack_detector_client.DetectAttack(request)
-
- # checking behavior
- context.ListContextIds.assert_called_once()
- context.ListServices.assert_called_with(cid_list.context_ids[0])
- influxdb.query.assert_called_once()
- dbscan.Detect.assert_called()
- mitigator.NotifyAttack.assert_not_called()
-
-def test_detect_attack_with_attack(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient,):
- with patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.context_client') as context, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.influxdb_client') as influxdb, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.dbscanserving_client') as dbscan, \
- patch('opticalcentralizedattackdetector.service.OpticalCentralizedAttackDetectorServiceServicerImpl.attack_mitigator_client') as mitigator:
-
- # setting up the mock
- cid_list = ContextIdList()
- cid_list.context_ids.append(ContextId(**CONTEXT_ID))
- context.ListContextIds.return_value = cid_list
-
- service_list = ServiceList()
- service_list.services.append(Service(**SERVICE_DEV1_DEV2))
- context.ListServices.return_value = service_list
-
- # dbscan.Detect.return_value = object()
- dbscan.Detect.return_value.cluster_indices = [0, 1, 2, 3, 4, -1]
-
- # making the test
- request = Empty()
- optical_centralized_attack_detector_client.DetectAttack(request)
-
- # checking behavior
- context.ListContextIds.assert_called_once()
- context.ListServices.assert_called_with(cid_list.context_ids[0])
- influxdb.query.assert_called_once()
- dbscan.Detect.assert_called()
- mitigator.NotifyAttack.assert_called()
-
-def test_report_summarized_kpi(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient):
- kpi_list = KpiList()
- optical_centralized_attack_detector_client.ReportSummarizedKpi(kpi_list)
-
-def test_report_kpi(optical_centralized_attack_detector_client: OpticalCentralizedAttackDetectorClient):
- kpi_list = KpiList()
- optical_centralized_attack_detector_client.ReportKpi(kpi_list)
diff --git a/src/tests/scenario3/README.md b/src/tests/scenario3/README.md
index a89d71f74b4ac35fa78aa5619019c8afad79410d..cc6d0c70417d5ec98810e557233941c3b0d043e6 100644
--- a/src/tests/scenario3/README.md
+++ b/src/tests/scenario3/README.md
@@ -1 +1,3 @@
-# Scenario 3 - ...
+# Scenario 3 - Cybersecurity
+
+
diff --git a/src/tests/scenario3/optical/README.md b/src/tests/scenario3/optical/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..a23f86e75614016f40e65cdc5d3bd75c26337768
--- /dev/null
+++ b/src/tests/scenario3/optical/README.md
@@ -0,0 +1,5 @@
+# Optical Cybersecurity
+
+
+
+## Publications
diff --git a/src/tests/scenario3/optical/dashboard.json b/src/tests/scenario3/optical/dashboard.json
new file mode 100644
index 0000000000000000000000000000000000000000..990ab47e95f9db5bc021ca91333f4c5fe61f7ff7
--- /dev/null
+++ b/src/tests/scenario3/optical/dashboard.json
@@ -0,0 +1,1537 @@
+{
+ "__inputs": [
+ {
+ "name": "DS_PROMETHEUS",
+ "label": "prometheus",
+ "description": "",
+ "type": "datasource",
+ "pluginId": "prometheus",
+ "pluginName": "Prometheus"
+ }
+ ],
+ "__elements": [],
+ "__requires": [
+ {
+ "type": "panel",
+ "id": "gauge",
+ "name": "Gauge",
+ "version": ""
+ },
+ {
+ "type": "grafana",
+ "id": "grafana",
+ "name": "Grafana",
+ "version": "8.5.22"
+ },
+ {
+ "type": "datasource",
+ "id": "prometheus",
+ "name": "Prometheus",
+ "version": "1.0.0"
+ },
+ {
+ "type": "panel",
+ "id": "timeseries",
+ "name": "Time series",
+ "version": ""
+ }
+ ],
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "grafana",
+ "uid": "-- Grafana --"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "target": {
+ "limit": 100,
+ "matchAny": false,
+ "tags": [],
+ "type": "dashboard"
+ },
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 2,
+ "id": null,
+ "links": [],
+ "liveNow": false,
+ "panels": [
+ {
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 12,
+ "title": "General status",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "yellow",
+ "value": 85
+ },
+ {
+ "color": "orange",
+ "value": 90
+ },
+ {
+ "color": "red",
+ "value": 95
+ }
+ ]
+ },
+ "unit": "percentunit"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "id": 20,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "8.5.22",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "(rate(tfs_opticalattackmanager_loop_seconds_sum[1m]) / rate(tfs_opticalattackmanager_loop_seconds_count[1m])) / tfs_opticalattackmanager_desired_monitoring_interval",
+ "instant": true,
+ "range": false,
+ "refId": "A"
+ }
+ ],
+ "title": "Loop time",
+ "type": "gauge"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 1
+ },
+ "id": 31,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "expr": "tfs_opticalattackmanager_dropped_assessments_created",
+ "refId": "A"
+ }
+ ],
+ "title": "Dropped assessments",
+ "type": "timeseries"
+ },
+ {
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 9
+ },
+ "id": 10,
+ "title": "Pipeline",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 10
+ },
+ "id": 16,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.95, sum(rate(tfs_opticalattackmanager_loop_seconds_bucket[$__rate_interval])) by (le))",
+ "legendFormat": "Measured",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "tfs_opticalattackmanager_desired_monitoring_interval",
+ "hide": false,
+ "legendFormat": "Desired",
+ "range": true,
+ "refId": "B"
+ }
+ ],
+ "title": "Loop time",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 10
+ },
+ "id": 14,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "tfs_opticalattackmanager_active_services",
+ "legendFormat": "Active services",
+ "range": true,
+ "refId": "A"
+ }
+ ],
+ "title": "Number of active optical services",
+ "type": "timeseries"
+ },
+ {
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 18
+ },
+ "id": 8,
+ "title": "Services",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 59,
+ "gradientMode": "opacity",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 19
+ },
+ "id": 22,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.95, sum(rate(tfs_opticalattackdetector_rpc_detectattack_histogram_duration_bucket[$__rate_interval])) by (le))",
+ "interval": "",
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.95, sum(rate(tfs_opticalattackdetector_inference_response_time_bucket[$__rate_interval])) by (le))",
+ "hide": false,
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.95, sum(rate(tfs_opticalattackdetector_cache_response_time_bucket[$__rate_interval])) by (le))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Cache",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "histogram_quantile(0.95, sum(rate(tfs_opticalattackdetector_mitigation_response_time_bucket[$__rate_interval])) by (le))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "D"
+ }
+ ],
+ "title": "Response times",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 19
+ },
+ "id": 24,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "tfs_opticalattackmanager_number_workers",
+ "hide": false,
+ "legendFormat": "Manager",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "kube_replicaset_status_replicas{namespace=\"tfs\", replicaset=~\"opticalattackdetectorservice.+\"}",
+ "interval": "",
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "kube_replicaset_status_replicas{namespace=\"tfs\", replicaset=~\"dbscanservingservice.+\"}",
+ "hide": false,
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "kube_replicaset_status_replicas{namespace=\"tfs\", replicaset=~\"opticalattackmitigatorservice.+\"}",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "C"
+ }
+ ],
+ "title": "Number of workers / replicas",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": true,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 27
+ },
+ "id": 6,
+ "panels": [
+ {
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "id": 4,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "title": "Panel Title",
+ "type": "timeseries"
+ }
+ ],
+ "title": "Resource usage",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 28
+ },
+ "id": 26,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace=\"tfs\",pod=~\"opticalattackmanagerservice.+\"})",
+ "legendFormat": "Manager",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace=\"tfs\",pod=~\"opticalattackdetectorservice.+\"})",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace=\"tfs\",pod=~\"dbscanservingservice.+\"})",
+ "hide": false,
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace=\"tfs\",pod=~\"cachingservice.+\"})",
+ "hide": false,
+ "legendFormat": "Caching",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace=\"tfs\",pod=~\"opticalattackmitigatorservice.+\"})",
+ "hide": false,
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "E"
+ }
+ ],
+ "title": "CPU Usage",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "bytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 28
+ },
+ "id": 27,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(container_memory_working_set_bytes{namespace=\"tfs\", pod=~\"opticalattackmanagerservice.+\"})",
+ "interval": "",
+ "legendFormat": "Manager",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(container_memory_working_set_bytes{namespace=\"tfs\",pod=~\"opticalattackdetectorservice.+\"})",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(container_memory_working_set_bytes{namespace=\"tfs\",pod=~\"dbscanservingservice.+\"})",
+ "hide": false,
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(container_memory_working_set_bytes{namespace=\"tfs\",pod=~\"cachingservice.+\"})",
+ "hide": false,
+ "legendFormat": "Caching",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate{namespace=\"tfs\",pod=~\"opticalattackmitigatorservice.+\"})",
+ "hide": false,
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "E"
+ }
+ ],
+ "title": "RAM Usage",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "Bps"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 36
+ },
+ "id": 28,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_receive_bytes_total{namespace=\"tfs\", pod=~\"opticalattackmanagerservice.+\"}[$__rate_interval]))",
+ "legendFormat": "Manager",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_receive_bytes_total{namespace=\"tfs\",pod=~\"opticalattackdetectorservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_receive_bytes_total{namespace=\"tfs\",pod=~\"dbscanservingservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_receive_bytes_total{namespace=\"tfs\",pod=~\"cachingservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "legendFormat": "Caching",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_receive_bytes_total{namespace=\"tfs\",pod=~\"opticalattackmitigatorservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "E"
+ }
+ ],
+ "title": "Network (incoming)",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "description": "",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "Bps"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 36
+ },
+ "id": 29,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_transmit_bytes_total{namespace=\"tfs\", pod=~\"opticalattackmanagerservice.+\"}[$__rate_interval]))",
+ "legendFormat": "Manager",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_transmit_bytes_total{namespace=\"tfs\",pod=~\"opticalattackdetectorservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_transmit_bytes_total{namespace=\"tfs\",pod=~\"dbscanservingservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_transmit_bytes_total{namespace=\"tfs\",pod=~\"cachingservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "legendFormat": "Caching",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "expr": "sum(irate(container_network_transmit_bytes_total{namespace=\"tfs\",pod=~\"opticalattackmitigatorservice.+\"}[$__rate_interval]))",
+ "hide": false,
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "E"
+ }
+ ],
+ "title": "Network (outgoing)",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 44
+ },
+ "id": 2,
+ "panels": [],
+ "title": "General status",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 29,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "normal"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "mwatt"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 45
+ },
+ "id": 33,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "right"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "sum(scaph_process_power_consumption_microwatts{namespace=\"tfs\", cmdline=~\".+opticalattackmanager.+\"})/1000",
+ "instant": false,
+ "legendFormat": "Manager",
+ "range": true,
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "sum(scaph_process_power_consumption_microwatts{namespace=\"tfs\", cmdline=~\".+opticalattackdetector.+\"})/1000",
+ "hide": false,
+ "instant": false,
+ "legendFormat": "Detector",
+ "range": true,
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "sum(scaph_process_power_consumption_microwatts{namespace=\"tfs\", cmdline=~\".+dbscan.+\"})/1000",
+ "hide": false,
+ "instant": false,
+ "interval": "",
+ "legendFormat": "UL Inference",
+ "range": true,
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "sum(scaph_process_power_consumption_microwatts{namespace=\"tfs\", cmdline=~\"redis-server.+\"})/1000",
+ "hide": false,
+ "instant": false,
+ "interval": "",
+ "legendFormat": "Cache",
+ "range": true,
+ "refId": "D"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "editorMode": "code",
+ "exemplar": false,
+ "expr": "sum(scaph_process_power_consumption_microwatts{namespace=\"tfs\", cmdline=~\".+opticalattackmitigator.+\"})/1000",
+ "hide": false,
+ "instant": false,
+ "interval": "",
+ "legendFormat": "Mitigator",
+ "range": true,
+ "refId": "E"
+ }
+ ],
+ "title": "Energy consumption",
+ "type": "timeseries"
+ }
+ ],
+ "refresh": "5s",
+ "schemaVersion": 36,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": []
+ },
+ "time": {
+ "from": "now-5m",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "",
+ "title": "TFS / Optical cybersecurity",
+ "uid": "-Q-B-AsVk",
+ "version": 1,
+ "weekStart": ""
+}
\ No newline at end of file
diff --git a/src/tests/scenario3/optical/deploy_specs.sh b/src/tests/scenario3/optical/deploy_specs.sh
new file mode 100644
index 0000000000000000000000000000000000000000..878013d8b82177e3d70aa432e01583f03eded237
--- /dev/null
+++ b/src/tests/scenario3/optical/deploy_specs.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (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.
+
+
+# ----- TeraFlowSDN ------------------------------------------------------------
+
+# Set the list of components, separated by spaces, you want to build images for, and deploy.
+export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator"
+
+# addition for the optical cybersecurity component
+export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
+export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml"
+
+
+# ----- CockroachDB ------------------------------------------------------------
+
+
+# Disable flag for dropping database, if it exists.
+export CRDB_DROP_DATABASE_IF_EXISTS="YES"
+
+
+
+# ----- QuestDB ----------------------------------------------------------------
+
+# Disable flag for dropping tables if they exist.
+export QDB_DROP_TABLES_IF_EXIST="YES"
+
+# Disable flag for re-deploying QuestDB from scratch.
+export QDB_REDEPLOY=""
diff --git a/src/tests/scenario3/optical/jocn/README.md b/src/tests/scenario3/optical/jocn/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..0981331111d00ff7e6a6245c20186d4dc60f55f8
--- /dev/null
+++ b/src/tests/scenario3/optical/jocn/README.md
@@ -0,0 +1,5 @@
+# A Flexible and Scalable ML-Based Diagnosis Module for Optical Networks: A Security Use Case
+
+__Authors__: [Carlos Natalino](https://www.chalmers.se/en/persons/carda/), Lluis Gifre Renom, Francisco-Javier Moreno-Muro, Sergio Gonzalez Diaz, Ricard Vilalta, Raul Muñoz, Paolo Monti, and Marija Furdek
+
+Experiments from the JOCN paper.
\ No newline at end of file
diff --git a/src/tests/scenario3/optical/jocn/processing_results.ipynb b/src/tests/scenario3/optical/jocn/processing_results.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..828a0966c993e0dc5c7aca7d0cbcbf4474d92a23
--- /dev/null
+++ b/src/tests/scenario3/optical/jocn/processing_results.ipynb
@@ -0,0 +1,3506 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Requirement already satisfied: matplotlib in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (3.6.1)\n",
+ "Requirement already satisfied: pandas in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (1.5.1)\n",
+ "Requirement already satisfied: requests in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (2.28.1)\n",
+ "Requirement already satisfied: numpy in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (1.23.4)\n",
+ "Requirement already satisfied: tqdm in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (4.64.1)\n",
+ "Requirement already satisfied: qrcode in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (7.4.2)\n",
+ "Requirement already satisfied: packaging>=20.0 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (21.3)\n",
+ "Requirement already satisfied: kiwisolver>=1.0.1 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (1.4.4)\n",
+ "Requirement already satisfied: pillow>=6.2.0 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (9.2.0)\n",
+ "Requirement already satisfied: pyparsing>=2.2.1 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (3.0.9)\n",
+ "Requirement already satisfied: fonttools>=4.22.0 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (4.37.4)\n",
+ "Requirement already satisfied: python-dateutil>=2.7 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (2.8.2)\n",
+ "Requirement already satisfied: cycler>=0.10 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (0.11.0)\n",
+ "Requirement already satisfied: contourpy>=1.0.1 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from matplotlib) (1.0.5)\n",
+ "Requirement already satisfied: pytz>=2020.1 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from pandas) (2021.3)\n",
+ "Requirement already satisfied: idna<4,>=2.5 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from requests) (3.3)\n",
+ "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from requests) (1.26.12)\n",
+ "Requirement already satisfied: charset-normalizer<3,>=2 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from requests) (2.0.12)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from requests) (2022.6.15.1)\n",
+ "Requirement already satisfied: pypng in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from qrcode) (0.20220715.0)\n",
+ "Requirement already satisfied: typing-extensions in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from qrcode) (4.3.0)\n",
+ "Requirement already satisfied: six>=1.5 in /home/carda/.pyenv/versions/3.9.14/envs/tfs/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)\n",
+ "\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.2.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.0.1\u001b[0m\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pip install matplotlib pandas requests numpy tqdm qrcode"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['Solarize_Light2', '_classic_test_patch', '_mpl-gallery', '_mpl-gallery-nogrid', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn-v0_8', 'seaborn-v0_8-bright', 'seaborn-v0_8-colorblind', 'seaborn-v0_8-dark', 'seaborn-v0_8-dark-palette', 'seaborn-v0_8-darkgrid', 'seaborn-v0_8-deep', 'seaborn-v0_8-muted', 'seaborn-v0_8-notebook', 'seaborn-v0_8-paper', 'seaborn-v0_8-pastel', 'seaborn-v0_8-poster', 'seaborn-v0_8-talk', 'seaborn-v0_8-ticks', 'seaborn-v0_8-white', 'seaborn-v0_8-whitegrid', 'tableau-colorblind10']\n"
+ ]
+ }
+ ],
+ "source": [
+ "import collections\n",
+ "import datetime\n",
+ "import os\n",
+ "import time\n",
+ "\n",
+ "import numpy as np\n",
+ "import pandas as pd\n",
+ "import requests\n",
+ "import qrcode\n",
+ "import qrcode.image.svg\n",
+ "\n",
+ "from tqdm.notebook import tqdm\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "\n",
+ "print(plt.style.available)\n",
+ "# plt.style.use('seaborn-v0_8-colorblind') # paper figures\n",
+ "plt.style.use('seaborn-v0_8-poster') # poster figures\n",
+ "\n",
+ "plt.rcParams.update({'font.size': 14})\n",
+ "\n",
+ "%matplotlib inline\n",
+ "# %config InlineBackend.figure_format = 'svg'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "jocn_20221204T093831.502593UTC\n",
+ "jocn_20230129T160117.267710UTC\n",
+ "jocn_20230131T082259.657842UTC\n",
+ "jocn_20230222T055227.218793UTC\n"
+ ]
+ }
+ ],
+ "source": [
+ "# configs\n",
+ "from configs import base_results_folder, datetime_format, hpa_data, prometheus_endpoint\n",
+ "\n",
+ "# get latest folder:\n",
+ "latest_folder = None\n",
+ "for f in sorted(os.listdir(os.path.join(base_results_folder))):\n",
+ " if os.path.isdir(os.path.join(base_results_folder, f)) and f != \"figures\":\n",
+ " print(f)\n",
+ " latest_folder = f\n",
+ "\n",
+ "# latest_folder = \"jocn_20221204T093831.502593UTC\" # stable results from Sunda\n",
+ "# latest_folder = \"jocn_20230129T160117.267710UTC\" # folder from revision\n",
+ "latest_folder = \"jocn_20230131T082259.657842UTC\"\n",
+ "\n",
+ "start_experiment = time.mktime(datetime.datetime(2023, 1, 29, 16, 9, 0).timetuple()),\n",
+ "end_experiment = time.mktime(datetime.datetime(2023, 1, 29, 21, 15, 0).timetuple()),\n",
+ "\n",
+ "os.makedirs(os.path.join(base_results_folder, latest_folder, \"figures\"), exist_ok=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "img = qrcode.make('https://tfs.etsi.org/', image_factory=qrcode.image.svg.SvgImage)\n",
+ "\n",
+ "with open('results/etsi-qr.svg', 'wb') as qr:\n",
+ " img.save(qr)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "['opticalattackmitigatorservice-hpa', 'dbscanservingservice-hpa', 'opticalattackdetectorservice-hpa']\n"
+ ]
+ }
+ ],
+ "source": [
+ "# loading hpa names\n",
+ "hpas = []\n",
+ "with open(os.path.join(base_results_folder, latest_folder, \"hpas.csv\"), \"rt\", encoding=\"utf-8\") as file:\n",
+ " for line in file.readlines():\n",
+ " hpas.append(line.replace(\"\\n\", \"\"))\n",
+ "print(hpas)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " timestamp | \n",
+ " number_services | \n",
+ " opticalattackmitigatorservice-hpa_cur_utilization | \n",
+ " opticalattackmitigatorservice-hpa_target_utilization | \n",
+ " opticalattackmitigatorservice-hpa_cur_replicas | \n",
+ " opticalattackmitigatorservice-hpa_desired_replicas | \n",
+ " dbscanservingservice-hpa_cur_utilization | \n",
+ " dbscanservingservice-hpa_target_utilization | \n",
+ " dbscanservingservice-hpa_cur_replicas | \n",
+ " dbscanservingservice-hpa_desired_replicas | \n",
+ " opticalattackdetectorservice-hpa_cur_utilization | \n",
+ " opticalattackdetectorservice-hpa_target_utilization | \n",
+ " opticalattackdetectorservice-hpa_cur_replicas | \n",
+ " opticalattackdetectorservice-hpa_desired_replicas | \n",
+ " cache_cpu | \n",
+ " cache_ram | \n",
+ " manager_cpu | \n",
+ " manager_ram | \n",
+ " seconds | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 115 | \n",
+ " 2023-01-31 14:13:01 | \n",
+ " 0 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 3.688660e+11 | \n",
+ " 757220.0 | \n",
+ " 2.569470e+11 | \n",
+ " 4752.0 | \n",
+ " 17103.0 | \n",
+ "
\n",
+ " \n",
+ " 116 | \n",
+ " 2023-01-31 14:18:00 | \n",
+ " 0 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 17402.0 | \n",
+ "
\n",
+ " \n",
+ " 117 | \n",
+ " 2023-01-31 14:18:01 | \n",
+ " 0 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 4.050550e+11 | \n",
+ " 757448.0 | \n",
+ " 3.544610e+11 | \n",
+ " 4752.0 | \n",
+ " 17403.0 | \n",
+ "
\n",
+ " \n",
+ " 118 | \n",
+ " 2023-01-31 14:23:00 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 17702.0 | \n",
+ "
\n",
+ " \n",
+ " 119 | \n",
+ " 2023-01-31 14:23:01 | \n",
+ " 10 | \n",
+ " 1 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 4.055380e+11 | \n",
+ " 757448.0 | \n",
+ " 5.106052e+12 | \n",
+ " 40888.0 | \n",
+ " 17703.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " timestamp number_services \\\n",
+ "115 2023-01-31 14:13:01 0 \n",
+ "116 2023-01-31 14:18:00 0 \n",
+ "117 2023-01-31 14:18:01 0 \n",
+ "118 2023-01-31 14:23:00 0 \n",
+ "119 2023-01-31 14:23:01 10 \n",
+ "\n",
+ " opticalattackmitigatorservice-hpa_cur_utilization \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 1 \n",
+ "119 1 \n",
+ "\n",
+ " opticalattackmitigatorservice-hpa_target_utilization \\\n",
+ "115 80 \n",
+ "116 80 \n",
+ "117 80 \n",
+ "118 80 \n",
+ "119 80 \n",
+ "\n",
+ " opticalattackmitigatorservice-hpa_cur_replicas \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " opticalattackmitigatorservice-hpa_desired_replicas \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " dbscanservingservice-hpa_cur_utilization \\\n",
+ "115 1 \n",
+ "116 1 \n",
+ "117 1 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " dbscanservingservice-hpa_target_utilization \\\n",
+ "115 80 \n",
+ "116 80 \n",
+ "117 80 \n",
+ "118 80 \n",
+ "119 80 \n",
+ "\n",
+ " dbscanservingservice-hpa_cur_replicas \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " dbscanservingservice-hpa_desired_replicas \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " opticalattackdetectorservice-hpa_cur_utilization \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " opticalattackdetectorservice-hpa_target_utilization \\\n",
+ "115 80 \n",
+ "116 80 \n",
+ "117 80 \n",
+ "118 80 \n",
+ "119 80 \n",
+ "\n",
+ " opticalattackdetectorservice-hpa_cur_replicas \\\n",
+ "115 2 \n",
+ "116 2 \n",
+ "117 2 \n",
+ "118 2 \n",
+ "119 2 \n",
+ "\n",
+ " opticalattackdetectorservice-hpa_desired_replicas cache_cpu \\\n",
+ "115 2 3.688660e+11 \n",
+ "116 2 NaN \n",
+ "117 2 4.050550e+11 \n",
+ "118 2 NaN \n",
+ "119 2 4.055380e+11 \n",
+ "\n",
+ " cache_ram manager_cpu manager_ram seconds \n",
+ "115 757220.0 2.569470e+11 4752.0 17103.0 \n",
+ "116 NaN NaN NaN 17402.0 \n",
+ "117 757448.0 3.544610e+11 4752.0 17403.0 \n",
+ "118 NaN NaN NaN 17702.0 \n",
+ "119 757448.0 5.106052e+12 40888.0 17703.0 "
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# https://stackoverflow.com/questions/12522963/converters-for-python-pandas\n",
+ "def convert_cpu_usage(value):\n",
+ " # u -> / 1_000\n",
+ " # n -> / 1_000_000\n",
+ " if len(value) == 0:\n",
+ " return float('nan')\n",
+ " if value.endswith(\"u\"):\n",
+ " return float(value.replace(\"u\", \"\")) * 1_000\n",
+ " elif value.endswith(\"n\"):\n",
+ " return float(value.replace(\"n\", \"\")) * 1_000_000\n",
+ " else:\n",
+ " raise ValueError(f\"Error converting {value} to mCPUs\")\n",
+ "\n",
+ "def convert_memory_usage(value):\n",
+ " if len(value) == 0:\n",
+ " return float('nan')\n",
+ " if value.endswith(\"Mi\"):\n",
+ " return float(value.replace(\"Mi\", \"\")) * 1_000\n",
+ " elif value.endswith(\"Ki\"):\n",
+ " return float(value.replace(\"Ki\", \"\"))\n",
+ " else:\n",
+ " raise ValueError(f\"Error converting {value} to Ki\")\n",
+ "\n",
+ "number_services = pd.read_csv(\n",
+ " os.path.join(base_results_folder, latest_folder, \"services.csv\"), skiprows=1,\n",
+ " converters={\n",
+ " \"cache_cpu\": convert_cpu_usage, \"manager_cpu\": convert_cpu_usage,\n",
+ " \"cache_ram\": convert_memory_usage, \"manager_ram\": convert_memory_usage,\n",
+ " }\n",
+ ")\n",
+ "number_services[\"timestamp\"] = pd.to_datetime(number_services[\"timestamp\"], format=datetime_format)\n",
+ "earliest_sample = number_services[\"timestamp\"].sort_values()[0]\n",
+ "\n",
+ "# number_services[\"seconds\"] = []\n",
+ "\n",
+ "number_services[\"seconds\"] = number_services.apply(lambda row: (row[\"timestamp\"] - earliest_sample).total_seconds(), axis=1)\n",
+ "\n",
+ "number_services.tail()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "image/png": "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",
+ "text/plain": [
+ "