diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9946d3290c007d49dea38715640748dc81ee6c6c..3249b820f25c7fec8987fa1a65d01c29013f8c28 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,7 @@ include: #- local: '/src/tester_integration/.gitlab-ci.yml' #- local: '/src/tester_functional/.gitlab-ci.yml' - local: '/src/automation/.gitlab-ci.yml' + - local: '/src/webui/.gitlab-ci.yml' # - local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' # - local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' # - local: '/src/l3_attackmitigator/.gitlab-ci.yml' diff --git a/deploy_in_kubernetes.sh b/deploy_in_kubernetes.sh index c4019c7d790930f65aac3c898f75f605fb35611e..58e35d249110688123bea1553bdff3c55bcee5f2 100755 --- a/deploy_in_kubernetes.sh +++ b/deploy_in_kubernetes.sh @@ -10,7 +10,7 @@ REGISTRY_IMAGE="" #REGISTRY_IMAGE="http://my-container-registry.local/" # Set the list of components you want to build images for, and deploy. -COMPONENTS="context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector" +COMPONENTS="context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui" # Set the tag you want to use for your images. IMAGE_TAG="tf-dev" diff --git a/install_development_dependencies.sh b/install_development_dependencies.sh index 4b66f9c92468cc3b6930e8c4a5372a611b2b965e..701e844d7563ffcff51a53fc189bb7df34e1d06a 100755 --- a/install_development_dependencies.sh +++ b/install_development_dependencies.sh @@ -7,7 +7,7 @@ pip install --upgrade pip setuptools wheel pip-tools pylint pytest pytest-benchm echo "" > requirements.in #TODO: include here your component -COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving" +COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving webui" # compiling dependencies from all components for component in $COMPONENTS diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..901328d276e96a0969c16fbed35fb7d1e4d2d311 --- /dev/null +++ b/manifests/webuiservice.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: webuiservice +spec: + selector: + matchLabels: + app: webuiservice + template: + metadata: + labels: + app: webuiservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: registry.gitlab.com/teraflow-h2020/controller/webui:latest + imagePullPolicy: Always + ports: + - containerPort: 8004 # TODO: define the real port + env: + - name: LOG_LEVEL + value: "DEBUG" + readinessProbe: + httpGet: + path: /healthz/ready + port: 8004 + initialDelaySeconds: 5 + timeoutSeconds: 1 + livenessProbe: + httpGet: + path: /healthz/live + port: 8004 + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice +spec: + type: ClusterIP + selector: + app: webuiservice + ports: + - name: http + port: 8004 + targetPort: 8004 +--- +# apiVersion: v1 +# kind: Service +# metadata: +# name: webuiservice-public +# labels: +# app: webuiservice +# spec: +# type: NodePort +# selector: +# app: webuiservice +# ports: +# - name: http +# protocol: TCP +# port: 8004 +# targetPort: 8004 +--- diff --git a/open_webui.sh b/open_webui.sh new file mode 100755 index 0000000000000000000000000000000000000000..83d25d9c784067c4a54398ac57a8958e477ecb2c --- /dev/null +++ b/open_webui.sh @@ -0,0 +1,12 @@ +# this script opens the webui + +WEBUI_PROTO=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.ports[0].name}'` +WEBUI_IP=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` +WEBUI_PORT=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.ports[0].port}'` +URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT} + +echo Opening web UI on URL ${URL} + +# curl -kL ${URL} + +python3 -m webbrowser ${URL} \ No newline at end of file diff --git a/run_tests_locally.sh b/run_tests_locally.sh index eb421c608578dfbc1cb7ef954e319d76437f3f43..11add2a82b7a4cfeddfd974d986b000e631bac23 100755 --- a/run_tests_locally.sh +++ b/run_tests_locally.sh @@ -59,3 +59,6 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ compute/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + webui/tests/test_unitary.py diff --git a/src/context/requirements.txt b/src/context/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f0e17131268493dc57951701dba86aba0fffd92 --- /dev/null +++ b/src/context/requirements.txt @@ -0,0 +1,72 @@ +# +# This file is autogenerated by pip-compile with python 3.9 +# To update, run: +# +# pip-compile src/context/requirements.in +# +aniso8601==9.0.1 + # via flask-restful +attrs==21.2.0 + # via pytest +certifi==2021.5.30 + # via requests +charset-normalizer==2.0.6 + # via requests +click==8.0.1 + # via flask +flask==2.0.1 + # via flask-restful +flask-restful==0.3.9 + # via -r src/context/requirements.in +grpcio==1.41.0 + # via + # -r src/context/requirements.in + # grpcio-health-checking +grpcio-health-checking==1.41.0 + # via -r src/context/requirements.in +idna==3.2 + # via requests +iniconfig==1.1.1 + # via pytest +itsdangerous==2.0.1 + # via flask +jinja2==3.0.1 + # via flask +markupsafe==2.0.1 + # via jinja2 +packaging==21.0 + # via pytest +pluggy==1.0.0 + # via pytest +prometheus-client==0.11.0 + # via -r src/context/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 src/context/requirements.in + # pytest-benchmark +pytest-benchmark==3.4.1 + # via -r src/context/requirements.in +pytz==2021.1 + # via flask-restful +redis==3.5.3 + # via -r src/context/requirements.in +requests==2.26.0 + # via -r src/context/requirements.in +six==1.16.0 + # via + # flask-restful + # grpcio +toml==0.10.2 + # via pytest +urllib3==1.26.7 + # via requests +werkzeug==2.0.1 + # via flask diff --git a/src/device/client/DeviceClient.py b/src/device/client/DeviceClient.py index 7c5fa0ca2561a429d240b36f38357a874b882aa8..17f0ac715165841dea3c80a3aae881e9cd1a62ec 100644 --- a/src/device/client/DeviceClient.py +++ b/src/device/client/DeviceClient.py @@ -22,7 +22,7 @@ class DeviceClient: self.stub = DeviceServiceStub(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 diff --git a/src/start_webui_dev_mode.sh b/src/start_webui_dev_mode.sh new file mode 100755 index 0000000000000000000000000000000000000000..32cf9c7f131ced88c4b496c26ab6890f571aa2f2 --- /dev/null +++ b/src/start_webui_dev_mode.sh @@ -0,0 +1,15 @@ +# for development purposes only + +export CONTEXT_SERVICE_ADDRESS=`kubectl get service/contextservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` + +echo $CONTEXT_SERVICE_ADDRESS + +export DEVICE_SERVICE_ADDRESS=`kubectl get service/deviceservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` + +echo $DEVICE_SERVICE_ADDRESS + +export HOST="127.0.0.1" + +export FLASK_ENV="development" + +python -m webui.service diff --git a/src/webui/.gitlab-ci.yml b/src/webui/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..d803c72deb9cddbae81a95baf1f6daae9788f073 --- /dev/null +++ b/src/webui/.gitlab-ci.yml @@ -0,0 +1,89 @@ +# build, tag and push the Docker image to the gitlab registry +build webui: + variables: + IMAGE_NAME: 'webui' # 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 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.yaml + - .gitlab-ci.yml + +# apply unit test to the webui component +unit test webui: + variables: + IMAGE_NAME: 'webui' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build webui + 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 8004:8004 -v "$PWD/src/$IMAGE_NAME/tests:/opt/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=/opt/results/${IMAGE_NAME}_report.xml; coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml; ls -la /opt/results; 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.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml + +# Deployment of the webui service in Kubernetes Cluster +deploy webui: + variables: + IMAGE_NAME: 'webui' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test webui + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/$IMAGE_NAME.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/$IMAGE_NAME.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/webui/Config.py b/src/webui/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..e4ea65f4a93fa9a5d04d4c2bc796310b40294797 --- /dev/null +++ b/src/webui/Config.py @@ -0,0 +1,23 @@ +import os +import logging + +# General settings +LOG_LEVEL = logging.DEBUG + +# gRPC settings +WEBUI_SERVICE_PORT = 8004 + +# Prometheus settings +METRICS_PORT = 9192 + +SECRET_KEY = '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(' + +HOST = '0.0.0.0' # accepts connections coming from any ADDRESS + +DEBUG=False + +CONTEXT_SERVICE_ADDRESS = os.environ.get('CONTEXTSERVICE_SERVICE_HOST', 'contextservice') +CONTEXT_SERVICE_PORT = 1010 + +DEVICE_SERVICE_ADDRESS = os.environ.get('DEVICESERVICE_SERVICE_HOST', 'deviceservice') +DEVICE_SERVICE_PORT = 2020 diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..24c5c529675a9f2b958745fcd2a1f7c5fc7cccde --- /dev/null +++ b/src/webui/Dockerfile @@ -0,0 +1,46 @@ +FROM python:3-slim + +# Ref: https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ + +# 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 -- not needed here... health will be asserted using HTTP +# 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 webui && useradd --no-log-init -r -m -g webui webui +USER webui + +# set working directory +RUN mkdir -p /home/webui/teraflow +WORKDIR /home/webui/teraflow + +# Get Python packages per module +ENV VIRTUAL_ENV=/home/webui/venv +RUN python3 -m venv ${VIRTUAL_ENV} +ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" +COPY --chown=webui:webui webui/requirements.in /home/webui/teraflow/webui/requirements.in +RUN pip install --upgrade "pip<22" setuptools wheel pip-tools && pip-compile --output-file=webui/requirements.txt webui/requirements.in +RUN pip install -r webui/requirements.txt + +# Add files into working directory +COPY --chown=webui:webui common/. common +COPY --chown=webui:webui context/__init__.py context/__init__.py +COPY --chown=webui:webui context/proto/. context/proto +COPY --chown=webui:webui context/client/. context/client +COPY --chown=webui:webui device/__init__.py device/__init__.py +COPY --chown=webui:webui device/proto/. device/proto +COPY --chown=webui:webui device/client/. device/client +COPY --chown=webui:webui webui/. webui + +# Start webui service +ENTRYPOINT ["python", "-m", "webui.service"] diff --git a/src/webui/__init__.py b/src/webui/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/genproto.sh b/src/webui/genproto.sh new file mode 100755 index 0000000000000000000000000000000000000000..1cd87af70fdcdaf7d7575837128672563e66a2f9 --- /dev/null +++ b/src/webui/genproto.sh @@ -0,0 +1,43 @@ +#!/bin/bash -eu +# +# Copyright 2018 Google LLC +# +# 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. + +#!/bin/bash -e + +# Make folder containing the script the root folder for its execution +cd $(dirname $0) + +rm -rf proto/*.py +rm -rf proto/__pycache__ +touch proto/__init__.py + +# building protos of services used +# python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto compute.proto +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 device.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 + +# rm proto/compute_pb2_grpc.py +rm proto/context_pb2_grpc.py +rm proto/device_pb2_grpc.py +rm proto/service_pb2_grpc.py +rm proto/monitoring_pb2_grpc.py + +# sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/compute_pb2.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/device_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 diff --git a/src/webui/proto/__init__.py b/src/webui/proto/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/proto/context_pb2.py b/src/webui/proto/context_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..8b4848bc33bfb0eba76590c8a3a627b2db84ca9f --- /dev/null +++ b/src/webui/proto/context_pb2.py @@ -0,0 +1,2535 @@ +# -*- 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() + + + + +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\"\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\"\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\"K\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\"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\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x8d\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12.\n\x12related_service_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12!\n\x04path\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\"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\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*]\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\xa5\r\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\x62\x06proto3' +) + +_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=3468, + serialized_end=3574, +) +_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=3577, + serialized_end=3774, +) +_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=3777, + serialized_end=3920, +) +_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=3923, + serialized_end=4052, +) +_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=4055, + serialized_end=4191, +) +_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) + +ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_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=4193, + serialized_end=4286, +) +_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 +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=26, + serialized_end=33, +) + + +_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=35, + serialized_end=55, +) + + +_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=57, + serialized_end=127, +) + + +_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=129, + serialized_end=177, +) + + +_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=180, + serialized_end=362, +) + + +_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=364, + serialized_end=420, +) + + +_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=422, + serialized_end=471, +) + + +_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=473, + serialized_end=558, +) + + +_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=560, + serialized_end=650, +) + + +_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=652, + serialized_end=778, +) + + +_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=780, + serialized_end=839, +) + + +_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=841, + serialized_end=894, +) + + +_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=896, + serialized_end=984, +) + + +_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=986, + serialized_end=1032, +) + + +_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=1035, + serialized_end=1317, +) + + +_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=1319, + serialized_end=1376, +) + + +_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=1378, + serialized_end=1431, +) + + +_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=1433, + serialized_end=1479, +) + + +_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=1481, + serialized_end=1563, +) + + +_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=1565, + serialized_end=1607, +) + + +_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=1609, + serialized_end=1697, +) + + +_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=1699, + serialized_end=1746, +) + + +_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=1748, + serialized_end=1788, +) + + +_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=1790, + serialized_end=1866, +) + + +_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=1868, + serialized_end=1956, +) + + +_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=1959, + serialized_end=2253, +) + + +_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=2255, + serialized_end=2322, +) + + +_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=2324, + serialized_end=2382, +) + + +_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=2384, + serialized_end=2440, +) + + +_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=2442, + serialized_end=2491, +) + + +_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=2493, + serialized_end=2578, +) + + +_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=2581, + serialized_end=2711, +) + + +_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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2713, + serialized_end=2788, +) + + +_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=2790, + serialized_end=2891, +) + + +_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=2893, + serialized_end=2956, +) + + +_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=2958, + serialized_end=3012, +) + + +_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='related_service_id', full_name='context.Connection.related_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', full_name='context.Connection.path', 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=3015, + serialized_end=3156, +) + + +_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=3158, + serialized_end=3223, +) + + +_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=3225, + serialized_end=3283, +) + + +_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=3285, + serialized_end=3379, +) + + +_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=3381, + serialized_end=3466, +) + +_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 +_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 +_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM +_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID +_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID +_CONNECTION.fields_by_name['related_service_id'].message_type = _SERVICEID +_CONNECTION.fields_by_name['path'].message_type = _ENDPOINTID +_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID +_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION +_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['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['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['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['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) + +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) + +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) + +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=4289, + serialized_end=5990, + 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, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) + +DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/webui/proto/device_pb2.py b/src/webui/proto/device_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e351738e6ac1ea9dadf4310897a979ab38db669b --- /dev/null +++ b/src/webui/proto/device_pb2.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: device.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='device.proto', + package='device', + syntax='proto3', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\x1a\rcontext.proto2\xf0\x01\n\rDeviceService\x12\x31\n\tAddDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x37\n\x0f\x43onfigureDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0c\x44\x65leteDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12>\n\x10GetInitialConfig\x12\x11.context.DeviceId\x1a\x15.context.DeviceConfig\"\x00\x62\x06proto3' + , + dependencies=[context__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_DEVICESERVICE = _descriptor.ServiceDescriptor( + name='DeviceService', + full_name='device.DeviceService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_start=40, + serialized_end=280, + methods=[ + _descriptor.MethodDescriptor( + name='AddDevice', + full_name='device.DeviceService.AddDevice', + index=0, + containing_service=None, + input_type=context__pb2._DEVICE, + output_type=context__pb2._DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ConfigureDevice', + full_name='device.DeviceService.ConfigureDevice', + index=1, + containing_service=None, + input_type=context__pb2._DEVICE, + output_type=context__pb2._DEVICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='DeleteDevice', + full_name='device.DeviceService.DeleteDevice', + index=2, + containing_service=None, + input_type=context__pb2._DEVICEID, + output_type=context__pb2._EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetInitialConfig', + full_name='device.DeviceService.GetInitialConfig', + index=3, + containing_service=None, + input_type=context__pb2._DEVICEID, + output_type=context__pb2._DEVICECONFIG, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), +]) +_sym_db.RegisterServiceDescriptor(_DEVICESERVICE) + +DESCRIPTOR.services_by_name['DeviceService'] = _DEVICESERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/src/webui/proto/monitoring_pb2.py b/src/webui/proto/monitoring_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..7368609d2145f94cc3b746836a5297333151c738 --- /dev/null +++ b/src/webui/proto/monitoring_pb2.py @@ -0,0 +1,617 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: monitoring.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 context_pb2 as context__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\"\x84\x01\n\x10\x43reateKpiRequest\x12\x16\n\x0ekpiDescription\x18\x01 \x01(\t\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12\x32\n\x0fkpi_sample_type\x18\x03 \x01(\x0e\x32\x19.monitoring.KpiSampleType\"h\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x18\n\x10\x63onnexion_time_s\x18\x02 \x01(\r\x12\x16\n\x0esample_rate_ms\x18\x03 \x01(\r\"i\n\x17MonitorDeviceKpiRequest\x12\x1c\n\x03kpi\x18\x01 \x01(\x0b\x32\x0f.monitoring.Kpi\x12\x18\n\x10\x63onnexion_time_s\x18\x02 \x01(\r\x12\x16\n\x0esample_rate_ms\x18\x03 \x01(\r\"s\n\x11IncludeKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x12\n\ntime_stamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x03 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xd6\x01\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\x12\x32\n\x0fkpi_sample_type\x18\x05 \x01(\x0e\x32\x19.monitoring.KpiSampleType\x12$\n\tdevice_id\x18\x06 \x01(\x0b\x32\x11.context.DeviceId\"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\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi*x\n\rKpiSampleType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x17\n\x13PACKETS_TRANSMITTED\x10\x65\x12\x14\n\x10PACKETS_RECEIVED\x10\x66\x12\x16\n\x11\x42YTES_TRANSMITTED\x10\xc9\x01\x12\x13\n\x0e\x42YTES_RECEIVED\x10\xca\x01\x32\x8b\x03\n\x11MonitoringService\x12>\n\tCreateKpi\x12\x1c.monitoring.CreateKpiRequest\x1a\x11.monitoring.KpiId\"\x00\x12=\n\nIncludeKpi\x12\x1d.monitoring.IncludeKpiRequest\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12I\n\x10MonitorDeviceKpi\x12#.monitoring.MonitorDeviceKpiRequest\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,]) + +_KPISAMPLETYPE = _descriptor.EnumDescriptor( + name='KpiSampleType', + full_name='monitoring.KpiSampleType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='PACKETS_TRANSMITTED', index=1, number=101, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='PACKETS_RECEIVED', index=2, number=102, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='BYTES_TRANSMITTED', index=3, number=201, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='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=913, + serialized_end=1033, +) +_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) + +KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) +UNKNOWN = 0 +PACKETS_TRANSMITTED = 101 +PACKETS_RECEIVED = 102 +BYTES_TRANSMITTED = 201 +BYTES_RECEIVED = 202 + + + +_CREATEKPIREQUEST = _descriptor.Descriptor( + name='CreateKpiRequest', + full_name='monitoring.CreateKpiRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='kpiDescription', full_name='monitoring.CreateKpiRequest.kpiDescription', 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='device_id', full_name='monitoring.CreateKpiRequest.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='kpi_sample_type', full_name='monitoring.CreateKpiRequest.kpi_sample_type', 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), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=48, + serialized_end=180, +) + + +_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='connexion_time_s', full_name='monitoring.MonitorKpiRequest.connexion_time_s', index=1, + number=2, 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='sample_rate_ms', full_name='monitoring.MonitorKpiRequest.sample_rate_ms', 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=182, + serialized_end=286, +) + + +_MONITORDEVICEKPIREQUEST = _descriptor.Descriptor( + name='MonitorDeviceKpiRequest', + full_name='monitoring.MonitorDeviceKpiRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='kpi', full_name='monitoring.MonitorDeviceKpiRequest.kpi', 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='connexion_time_s', full_name='monitoring.MonitorDeviceKpiRequest.connexion_time_s', index=1, + number=2, 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='sample_rate_ms', full_name='monitoring.MonitorDeviceKpiRequest.sample_rate_ms', 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=288, + serialized_end=393, +) + + +_INCLUDEKPIREQUEST = _descriptor.Descriptor( + name='IncludeKpiRequest', + full_name='monitoring.IncludeKpiRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='kpi_id', full_name='monitoring.IncludeKpiRequest.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='time_stamp', full_name='monitoring.IncludeKpiRequest.time_stamp', 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.IncludeKpiRequest.kpi_value', 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=395, + serialized_end=510, +) + + +_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=512, + serialized_end=550, +) + + +_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='kpiDescription', full_name='monitoring.Kpi.kpiDescription', 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='kpi_value', full_name='monitoring.Kpi.kpi_value', 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='kpi_sample_type', full_name='monitoring.Kpi.kpi_sample_type', index=4, + number=5, 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.Kpi.device_id', 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=553, + serialized_end=767, +) + + +_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=769, + serialized_end=866, +) + + +_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='kpiList', full_name='monitoring.KpiList.kpiList', 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=868, + serialized_end=911, +) + +_CREATEKPIREQUEST.fields_by_name['device_id'].message_type = context__pb2._DEVICEID +_CREATEKPIREQUEST.fields_by_name['kpi_sample_type'].enum_type = _KPISAMPLETYPE +_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID +_MONITORDEVICEKPIREQUEST.fields_by_name['kpi'].message_type = _KPI +_INCLUDEKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID +_INCLUDEKPIREQUEST.fields_by_name['kpi_value'].message_type = _KPIVALUE +_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 +_KPI.fields_by_name['kpi_sample_type'].enum_type = _KPISAMPLETYPE +_KPI.fields_by_name['device_id'].message_type = context__pb2._DEVICEID +_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['kpiList'].message_type = _KPI +DESCRIPTOR.message_types_by_name['CreateKpiRequest'] = _CREATEKPIREQUEST +DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST +DESCRIPTOR.message_types_by_name['MonitorDeviceKpiRequest'] = _MONITORDEVICEKPIREQUEST +DESCRIPTOR.message_types_by_name['IncludeKpiRequest'] = _INCLUDEKPIREQUEST +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 +DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +CreateKpiRequest = _reflection.GeneratedProtocolMessageType('CreateKpiRequest', (_message.Message,), { + 'DESCRIPTOR' : _CREATEKPIREQUEST, + '__module__' : 'monitoring_pb2' + # @@protoc_insertion_point(class_scope:monitoring.CreateKpiRequest) + }) +_sym_db.RegisterMessage(CreateKpiRequest) + +MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { + 'DESCRIPTOR' : _MONITORKPIREQUEST, + '__module__' : 'monitoring_pb2' + # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) + }) +_sym_db.RegisterMessage(MonitorKpiRequest) + +MonitorDeviceKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorDeviceKpiRequest', (_message.Message,), { + 'DESCRIPTOR' : _MONITORDEVICEKPIREQUEST, + '__module__' : 'monitoring_pb2' + # @@protoc_insertion_point(class_scope:monitoring.MonitorDeviceKpiRequest) + }) +_sym_db.RegisterMessage(MonitorDeviceKpiRequest) + +IncludeKpiRequest = _reflection.GeneratedProtocolMessageType('IncludeKpiRequest', (_message.Message,), { + 'DESCRIPTOR' : _INCLUDEKPIREQUEST, + '__module__' : 'monitoring_pb2' + # @@protoc_insertion_point(class_scope:monitoring.IncludeKpiRequest) + }) +_sym_db.RegisterMessage(IncludeKpiRequest) + +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=1036, + serialized_end=1431, + methods=[ + _descriptor.MethodDescriptor( + name='CreateKpi', + full_name='monitoring.MonitoringService.CreateKpi', + index=0, + containing_service=None, + input_type=_CREATEKPIREQUEST, + output_type=_KPIID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='IncludeKpi', + full_name='monitoring.MonitoringService.IncludeKpi', + index=1, + containing_service=None, + input_type=_INCLUDEKPIREQUEST, + output_type=context__pb2._EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='MonitorKpi', + full_name='monitoring.MonitoringService.MonitorKpi', + index=2, + containing_service=None, + input_type=_MONITORKPIREQUEST, + output_type=context__pb2._EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='MonitorDeviceKpi', + full_name='monitoring.MonitoringService.MonitorDeviceKpi', + index=3, + containing_service=None, + input_type=_MONITORDEVICEKPIREQUEST, + 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/webui/proto/service_pb2.py b/src/webui/proto/service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..7a006915b8be39710a17faab075e382e322d918f --- /dev/null +++ b/src/webui/proto/service_pb2.py @@ -0,0 +1,88 @@ +# -*- 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\xfd\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\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\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=295, + 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, + ), + _descriptor.MethodDescriptor( + name='GetConnectionList', + full_name='service.ServiceService.GetConnectionList', + index=3, + containing_service=None, + input_type=context__pb2._SERVICEID, + output_type=context__pb2._CONNECTIONLIST, + 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/webui/requirements.in b/src/webui/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..8d30ba299df8cdc3c52885082c0dcfdfe0586f70 --- /dev/null +++ b/src/webui/requirements.in @@ -0,0 +1,11 @@ +flask +flask-wtf +flask-healthz +flask-unittest +grpcio +grpcio-health-checking +prometheus-client +pytest +pytest-benchmark +lorem-text +coverage diff --git a/src/webui/service/__init__.py b/src/webui/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..28197a9f58e5031d1a308262779e42df7598ca25 --- /dev/null +++ b/src/webui/service/__init__.py @@ -0,0 +1,58 @@ +import os +from flask import Flask, session +from flask_healthz import healthz, HealthError + +from webui.proto.context_pb2 import Empty +from device.client.DeviceClient import DeviceClient +from context.client.ContextClient import ContextClient +from webui.Config import (CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT, + DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) + + +def get_working_context() -> str: + if 'context_uuid' in session: + return session['context_uuid'] + else: + return 'Not selected' + + +def liveness(): + pass + + +def readiness(): + try: # this component is ready when it is able to connect with the other components it depends on + context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) + context_client.connect() + context_client.close() + device_client: DeviceClient = DeviceClient(DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) + device_client.connect() + device_client.close() + except Exception as e: + raise HealthError('Can\'t connect with the service: ' + e.details()) + + +def create_app(use_config=None): + app = Flask(__name__) + if use_config: + app.config.from_mapping(**use_config) + + app.config.update(HEALTHZ={ + 'live': liveness, + 'ready': readiness + }) + + app.register_blueprint(healthz, url_prefix='/healthz') + + from webui.service.main.routes import main + app.register_blueprint(main) + + from webui.service.service.routes import service + app.register_blueprint(service) + + from webui.service.device.routes import device + app.register_blueprint(device) + + app.jinja_env.globals.update(get_working_context=get_working_context) + + return app diff --git a/src/webui/service/__main__.py b/src/webui/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..2107e139fffdab78a4242aabde768e27a5bfb185 --- /dev/null +++ b/src/webui/service/__main__.py @@ -0,0 +1,27 @@ +import os, sys, logging +from prometheus_client import start_http_server +from webui.service import create_app +from webui.Config import WEBUI_SERVICE_PORT, LOG_LEVEL, METRICS_PORT, HOST, SECRET_KEY, DEBUG + +def main(): + service_port = os.environ.get('WEBUISERVICE_SERVICE_PORT', WEBUI_SERVICE_PORT) + log_level = os.environ.get('LOG_LEVEL', LOG_LEVEL ) + metrics_port = os.environ.get('METRICS_PORT', METRICS_PORT ) + host = os.environ.get('HOST', HOST ) + debug = os.environ.get('DEBUG', DEBUG ) + + logging.basicConfig(level=log_level) + logger = logging.getLogger(__name__) + + logger.info('Starting...') + + start_http_server(metrics_port) + + app = create_app(use_config={'SECRET_KEY': SECRET_KEY}) + app.run(host=host, port=service_port, debug=debug) + + logger.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/webui/service/context/__init__.py b/src/webui/service/context/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/service/context/routes.py b/src/webui/service/context/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..052a91db07a670a984a798a58b4ec0f4822ef508 --- /dev/null +++ b/src/webui/service/context/routes.py @@ -0,0 +1,9 @@ +from flask import render_template, Blueprint, flash + +context = Blueprint('context', __name__) + +@context.route('/') +def home(): + flash('This is an info message', 'info') + flash('This is a danger message', 'danger') + return render_template('main/home.html') diff --git a/src/webui/service/device/__init__.py b/src/webui/service/device/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/service/device/forms.py b/src/webui/service/device/forms.py new file mode 100644 index 0000000000000000000000000000000000000000..8bfad0f5905c92019398dd24fdff4898884e1f7d --- /dev/null +++ b/src/webui/service/device/forms.py @@ -0,0 +1,41 @@ +# external imports +from flask_wtf import FlaskForm +from wtforms import StringField, SelectField, TextAreaField, SubmitField +from wtforms.validators import DataRequired, Length, NumberRange, Regexp, ValidationError + +from webui.utils.form_validators import key_value_validator +from webui.proto.context_pb2 import (DeviceDriverEnum, DeviceOperationalStatusEnum) + +class AddDeviceForm(FlaskForm): + device_id = StringField('ID', + validators=[DataRequired(), Length(min=5)]) + device_type = StringField('Type', + validators=[DataRequired(), Length(min=5)]) + device_config = TextAreaField('Configurations', validators=[key_value_validator()]) + operational_status = SelectField('Operational Status', + # choices=[(-1, 'Select...'), (0, 'Undefined'), (1, 'Disabled'), (2, 'Enabled')], + coerce=int, + validators=[NumberRange(min=0)]) + device_drivers = TextAreaField('Drivers', validators=[DataRequired(), Regexp(r'^\d+(,\d+)*$')]) + submit = SubmitField('Add') + + def validate_operational_status(form, field): + if field.data not in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_number: + raise ValidationError('The operational status value selected is incorrect!') + + def validate_device_drivers(form, field): + if ',' not in field.data: + data = str(field.data) + ',' + else: + data = field.data + for value in data.split(','): + value = value.strip() + if len(value) == 0: + continue + try: + value_int = int(value) + except: + raise ValidationError(f'The value "{value}" is not a valid driver identified.') + if value_int not in DeviceDriverEnum.DESCRIPTOR.values_by_number: + values = ', '.join([str(x) for x in DeviceDriverEnum.DESCRIPTOR.values_by_number]) + raise ValidationError(f'The device driver {value_int} is not correct. Allowed values are: {values}.') diff --git a/src/webui/service/device/routes.py b/src/webui/service/device/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..b5a9399a6015aad6d0a2d39f9259dfa074610675 --- /dev/null +++ b/src/webui/service/device/routes.py @@ -0,0 +1,121 @@ +from flask import render_template, Blueprint, flash, session, redirect +from device.client.DeviceClient import DeviceClient +from context.client.ContextClient import ContextClient +from webui.Config import (CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT, + DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) +from webui.proto.context_pb2 import (ContextId, DeviceList, DeviceId, + Device, DeviceDriverEnum, DeviceOperationalStatusEnum, + ConfigActionEnum, ConfigRule, TopologyIdList, TopologyList) +from webui.service.device.forms import AddDeviceForm + +device = Blueprint('device', __name__, url_prefix='/device') +context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) +device_client: DeviceClient = DeviceClient(DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) + +@device.get('/') +def home(): + request: ContextId = ContextId() + request.context_uuid.uuid = session['context_uuid'] + context_client.connect() + response: DeviceList = context_client.ListDevices(request) + context_client.close() + return render_template('device/home.html', devices=response.devices, + dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) + +@device.route('add', methods=['GET', 'POST']) +def add(): + form = AddDeviceForm() + + request: ContextId = ContextId() + request.context_uuid.uuid = session['context_uuid'] + context_client.connect() + response: TopologyIdList = context_client.ListTopologyIds(request) + context_client.close() + + # listing enum values + form.operational_status.choices = [(-1, 'Select...')] + for key, value in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_name.items(): + form.operational_status.choices.append((DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) + + # device driver ids + device_driver_ids = [] + for key in DeviceDriverEnum.DESCRIPTOR.values_by_name: + device_driver_ids.append(f"{DeviceDriverEnum.Value(key)}={key.replace('DEVICEDRIVER_', '')}") + device_driver_ids = ', '.join(device_driver_ids) + + if form.validate_on_submit(): + device: Device = Device() + device.device_id.device_uuid.uuid = form.device_id.data + device.device_type = form.device_type.data + if '\n' not in form.device_config.data: + data = form.device_config.data.strip() + '\n' + else: + data = form.device_config.data.strip() + + for config in data.split('\n'): + if len(config.strip()) > 0: + parts = config.strip().split('=') + config_rule: ConfigRule = ConfigRule() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.resource_key = parts[0].strip() + config_rule.resource_value = parts[1].strip() + device.device_config.config_rules.append(config_rule) + + device.device_operational_status = form.operational_status.data + + if ',' not in form.device_drivers.data: + data = form.device_drivers.data.strip() + ',' + else: + data = form.device_drivers.data.strip() + + for driver in data.split(','): + driver = driver.strip() + if len(driver) == 0: + continue + device.device_drivers.append(int(driver)) + try: + device_client.connect() + response: DeviceId = device_client.AddDevice(device) + device_client.close() + + flash(f'New device was created with ID "{response.device_uuid.uuid}".', 'success') + return redirect('/device/') + except Exception as e: + flash(f'Problem adding the device. {e.details()}', 'danger') + + return render_template('device/add.html', form=form, + submit_text='Add New Device', + device_driver_ids=device_driver_ids) + +@device.route('detail/<device_uuid>', methods=['GET', 'POST']) +def detail(device_uuid: str): + request: DeviceId = DeviceId() + request.device_uuid.uuid = device_uuid + context_client.connect() + response: Device = context_client.GetDevice(request) + context_client.close() + return render_template('device/detail.html', device=response) + +@device.get('<device_uuid>/delete') +def delete(device_uuid): + try: + + # first, check if device exists! + # request: DeviceId = DeviceId() + # request.device_uuid.uuid = device_uuid + # response: Device = client.GetDevice(request) + # TODO: finalize implementation + + request: DeviceId = DeviceId() + request.device_uuid.uuid = device_uuid + device_client.connect() + response = device_client.DeleteDevice(request) + + device_client.close() + + flash('Device deleted successfully!', 'success') + except Exception as e: + flash(f'Problem deleting the device. {e.details()}', 'danger') + + return redirect('/device/') diff --git a/src/webui/service/main/__init__.py b/src/webui/service/main/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/service/main/forms.py b/src/webui/service/main/forms.py new file mode 100644 index 0000000000000000000000000000000000000000..aacdbf2523e236ba349db6a1860b09e0e4793328 --- /dev/null +++ b/src/webui/service/main/forms.py @@ -0,0 +1,11 @@ +# external imports +from flask_wtf import FlaskForm +from wtforms import SelectField, SubmitField +from wtforms.validators import DataRequired, Length + + +class ContextForm(FlaskForm): + context = SelectField('Context', + choices=[], + validators=[DataRequired(), Length(min=1)]) + submit = SubmitField('Select') diff --git a/src/webui/service/main/routes.py b/src/webui/service/main/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..08ccdea4a94122a61c4875ddf520d544b5d2d4d1 --- /dev/null +++ b/src/webui/service/main/routes.py @@ -0,0 +1,37 @@ +import logging +import sys +from flask import render_template, Blueprint, flash, session +from webui.Config import CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT +from context.client.ContextClient import ContextClient +from webui.proto.context_pb2 import Empty +from webui.service.main.forms import ContextForm + +main = Blueprint('main', __name__) + +context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) + +logger = logging.getLogger(__name__) + +@main.route('/', methods=['GET', 'POST']) +def home(): + # flash('This is an info message', 'info') + # flash('This is a danger message', 'danger') + context_client.connect() + response = context_client.ListContextIds(Empty()) + context_client.close() + context_form: ContextForm = ContextForm() + context_form.context.choices.append(('', 'Select...')) + for context in response.context_ids: + context_form.context.choices.append((context.context_uuid.uuid, context.context_uuid)) + if context_form.validate_on_submit(): + session['context_uuid'] = context_form.context.data + flash(f'The context was successfully set to `{context_form.context.data}`.', 'success') + if 'context_uuid' in session: + context_form.context.data = session['context_uuid'] + + return render_template('main/home.html', context_form=context_form) + + +@main.get('/about') +def about(): + return render_template('main/about.html') diff --git a/src/webui/service/service/__init__.py b/src/webui/service/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/service/service/routes.py b/src/webui/service/service/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..c88d89789295083555fa1998e763ad7fe44bd82b --- /dev/null +++ b/src/webui/service/service/routes.py @@ -0,0 +1,39 @@ +from flask import render_template, Blueprint, flash, session +from webui.Config import CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT +from context.client.ContextClient import ContextClient +from webui.proto.context_pb2 import ContextId, ServiceList, ServiceTypeEnum, ServiceStatusEnum, ConfigActionEnum + + +service = Blueprint('service', __name__, url_prefix='/service') + +context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) + +@service.get('/') +def home(): + # flash('This is an info message', 'info') + # flash('This is a danger message', 'danger') + + request: ContextId = ContextId() + request.context_uuid.uuid = session['context_uuid'] + context_client.connect() + service_list: ServiceList = context_client.ListServices(request) + # print(service_list) + + context_client.close() + return render_template('service/home.html', services=service_list.services, + ste=ServiceTypeEnum, + sse=ServiceStatusEnum) + + +@service.route('add', methods=['GET', 'POST']) +def add(): + flash('Add service route called', 'danger') + raise NotImplementedError() + return render_template('service/home.html') + + +@service.get('detail/<service_uuid>') +def detail(service_uuid: str): + flash('Detail service route called', 'danger') + raise NotImplementedError() + return render_template('service/home.html') diff --git a/src/webui/service/static/partners.png b/src/webui/service/static/partners.png new file mode 100644 index 0000000000000000000000000000000000000000..f88680212f68cdb4c17ad0de55b9d22ef9276a23 Binary files /dev/null and b/src/webui/service/static/partners.png differ diff --git a/src/webui/service/static/site.js b/src/webui/service/static/site.js new file mode 100644 index 0000000000000000000000000000000000000000..e06cea8b0bed68602ad91ed5dc52229b7b7aad75 --- /dev/null +++ b/src/webui/service/static/site.js @@ -0,0 +1,4 @@ +var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) +var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { + return new bootstrap.Tooltip(tooltipTriggerEl) +}) diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html new file mode 100644 index 0000000000000000000000000000000000000000..6ada3c8502d26f9ff8e2ac289bbcdd822d7a4a32 --- /dev/null +++ b/src/webui/service/templates/base.html @@ -0,0 +1,119 @@ +<!doctype html> +<html lang="en"> + <head> + <!-- Required meta tags --> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <link rel="shortcut icon" href="https://teraflow-h2020.eu/sites/teraflow/files/public/favicon.png" type="image/png" /> + + <!-- Bootstrap CSS --> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-uWxY/CJNBR+1zjPWmfnSnVxwRheevXITnMqoEIeG1LJrdI0GlVs/9cVSyPYXdcSF" crossorigin="anonymous"> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css"> + + <title>TeraFlow OFC 2022 Demo</title> + </head> + <body> + <div id="teraflow-branding" style="width: 260px; margin: 7px;"> + <a href="/" title="Home" rel="home" id="main-logo" class="site-logo site-logo-pages"> + <svg id="Capa_1" data-name="Capa 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 436.3 132.1"><defs><style>.cls-1{fill:#36a9e1;}.cls-2{fill:#1d71b8;}.cls-3{fill:none;stroke-width:2.52px;}.cls-10,.cls-3,.cls-4,.cls-5,.cls-7,.cls-8,.cls-9{stroke:#0f77b6;}.cls-3,.cls-4,.cls-8{stroke-miterlimit:10;}.cls-10,.cls-4,.cls-5,.cls-7,.cls-8,.cls-9{fill:#fff;}.cls-4{stroke-width:0.73px;}.cls-5,.cls-7{stroke-miterlimit:10;}.cls-5{stroke-width:0.75px;}.cls-6{fill:#0f77b6;}.cls-7{stroke-width:0.72px;}.cls-8{stroke-width:0.7px;}.cls-9{stroke-miterlimit:10;stroke-width:0.69px;}.cls-10{stroke-miterlimit:10;stroke-width:0.7px;}</style></defs><path class="cls-1" d="M96,57V51.3h44.1V57H121v52.3h-5.9V57Z"></path><path class="cls-1" d="M168.9,95.1l4.7,2.4a26,26,0,0,1-5.3,7.3,22.27,22.27,0,0,1-6.7,4.2,22.64,22.64,0,0,1-8.5,1.4c-7,0-12.5-2.3-16.4-6.9a23.53,23.53,0,0,1-5.9-15.6,23,23,0,0,1,5-14.5c4.2-5.4,9.9-8.1,17-8.1,7.3,0,13.2,2.8,17.5,8.3,3.1,3.9,4.7,8.8,4.7,14.7H136.4a17.48,17.48,0,0,0,4.8,12.3,15.26,15.26,0,0,0,11.4,4.8,20,20,0,0,0,6.4-1.1,19.3,19.3,0,0,0,5.3-3A33.07,33.07,0,0,0,168.9,95.1Zm0-11.6a18.66,18.66,0,0,0-3.2-7.1,15.25,15.25,0,0,0-5.6-4.3,16.87,16.87,0,0,0-7.3-1.6,16.06,16.06,0,0,0-10.9,4.1,18.15,18.15,0,0,0-5,8.9Z"></path><path class="cls-1" d="M182,66.4h5.6v6.3a20,20,0,0,1,5.3-5.5,10.67,10.67,0,0,1,5.8-1.8,9.87,9.87,0,0,1,4.9,1.5l-2.9,4.7a7.52,7.52,0,0,0-2.9-.7,8.09,8.09,0,0,0-5.3,2.3,14.64,14.64,0,0,0-3.9,7c-.7,2.4-1,7.4-1,14.8v14.5H182Z"></path><path class="cls-1" d="M246.2,66.4v42.9h-5.4V102a23.11,23.11,0,0,1-7.8,6.3,21.23,21.23,0,0,1-9.4,2.1,21,21,0,0,1-15.6-6.6,23.07,23.07,0,0,1,.1-32,21.23,21.23,0,0,1,15.7-6.6,20,20,0,0,1,17.1,8.9V66.2h5.3Zm-22.1,4.2a16.67,16.67,0,0,0-8.5,2.3,15.93,15.93,0,0,0-6.2,6.4,17.68,17.68,0,0,0-2.3,8.7,18.26,18.26,0,0,0,2.3,8.7,15.93,15.93,0,0,0,6.2,6.4,16.58,16.58,0,0,0,8.4,2.3,17.59,17.59,0,0,0,8.6-2.3,15.42,15.42,0,0,0,6.2-6.2,17.17,17.17,0,0,0,2.2-8.8,16.73,16.73,0,0,0-4.9-12.4A15.8,15.8,0,0,0,224.1,70.6Z"></path><path class="cls-2" d="M259.5,51.3h29.1V57H265.3V75.2h23.3v5.7H265.3v28.5h-5.8V51.3Z"></path><path class="cls-2" d="M296.9,49.9h5.5v59.5h-5.5Z"></path><path class="cls-2" d="M330.5,65.3a21.1,21.1,0,0,1,16.4,7.2A22.55,22.55,0,0,1,352.8,88a22.24,22.24,0,0,1-6.3,15.7c-4.2,4.5-9.5,6.7-16.1,6.7s-12-2.2-16.1-6.7A22.24,22.24,0,0,1,308,88a22.73,22.73,0,0,1,5.9-15.5A21.81,21.81,0,0,1,330.5,65.3Zm0,5.4a15.83,15.83,0,0,0-11.8,5.1,17,17,0,0,0-4.9,12.3,17.68,17.68,0,0,0,2.3,8.7,15.19,15.19,0,0,0,6.1,6.2,16.48,16.48,0,0,0,8.4,2.2A16,16,0,0,0,339,103a15.82,15.82,0,0,0,6.1-6.2,17.68,17.68,0,0,0,2.3-8.7,17.07,17.07,0,0,0-5-12.3A16.2,16.2,0,0,0,330.5,70.7Z"></path><path class="cls-2" d="M351.2,66.4h5.7L370,97.6l13.7-31.1h1l13.8,31.1,13.4-31.1h5.7L399,109.3h-1L384.3,78.6l-13.7,30.7h-1Z"></path><polyline class="cls-3" points="51 105 51 41.2 27 41.2"></polyline><polyline class="cls-3" points="38.1 33.8 56.4 33.8 56.4 93"></polyline><polyline class="cls-3" points="79.9 33.8 61.5 33.8 61.5 79.2"></polyline><polyline class="cls-3" points="90.7 41.2 66.7 41.2 66.7 105"></polyline><line class="cls-3" x1="83.1" y1="62.6" x2="66.7" y2="62.6"></line><circle class="cls-4" cx="27" cy="41.2" r="5.3"></circle><path class="cls-1" d="M23.3,41.2a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,23.3,41.2Z"></path><circle class="cls-5" cx="51" cy="105" r="5.4"></circle><path class="cls-1" d="M47.3,105a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,47.3,105Z"></path><circle class="cls-6" cx="56.36" cy="93.02" r="3.4"></circle><circle class="cls-6" cx="61.5" cy="79.2" r="2.8"></circle><circle class="cls-7" cx="66.7" cy="105.01" r="5.3"></circle><path class="cls-1" d="M63,105a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,63,105Z"></path><circle class="cls-8" cx="90.7" cy="41.2" r="5.1"></circle><path class="cls-1" d="M87,41.2a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,87,41.2Z"></path><circle class="cls-8" cx="84.7" cy="62.6" r="5.1"></circle><path class="cls-1" d="M81,62.6a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,81,62.6Z"></path><line class="cls-3" x1="34.8" y1="62.6" x2="51.1" y2="62.6"></line><circle class="cls-8" cx="33.1" cy="62.6" r="5.1"></circle><path class="cls-1" d="M36.9,62.6a3.8,3.8,0,1,1-3.8-3.8A3.8,3.8,0,0,1,36.9,62.6Z"></path><line class="cls-3" x1="23.7" y1="26.7" x2="94.1" y2="26.7"></line><circle class="cls-9" cx="94.09" cy="26.67" r="5"></circle><path class="cls-1" d="M90.3,26.7a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,90.3,26.7Z"></path><circle class="cls-6" cx="78" cy="33.8" r="3.8"></circle><circle class="cls-6" cx="40" cy="33.8" r="3.8"></circle><circle class="cls-10" cx="23.71" cy="26.71" r="5.1"></circle><path class="cls-1" d="M20,26.7a3.8,3.8,0,1,0,3.8-3.8A3.8,3.8,0,0,0,20,26.7Z"></path></svg> + </a> + </div> + + <nav class="navbar navbar-expand-lg navbar-dark bg-primary" style="margin-bottom: 10px;"> + <div class="container-fluid"> + <a class="navbar-brand" href="#"> + <img src="https://teraflow-h2020.eu/sites/teraflow/files/public/favicon.png" alt="" width="30" height="24" class="d-inline-block align-text-top"/> + TeraFlow + </a> + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation"> + <span class="navbar-toggler-icon"></span> + </button> + <div class="collapse navbar-collapse" id="navbarColor02"> + <ul class="navbar-nav me-auto mb-2 mb-lg-0"> + <li class="nav-item"> + {% if request.path == '/' %} + <a class="nav-link active" aria-current="page" href="{{ url_for('main.home') }}">Home</a> + {% else %} + <a class="nav-link" href="{{ url_for('main.home') }}">Home</a> + {% endif %} + </li> + <li class="nav-item"> + {% if '/service/' in request.path %} + <a class="nav-link active" aria-current="page" href="{{ url_for('service.home') }}">Service</a> + {% else %} + <a class="nav-link" href="{{ url_for('service.home') }}">Service</a> + {% endif %} + <!-- <a class="nav-link" href="{{ url_for('service.home') }}">Service</a> --> + </li> + <li class="nav-item"> + {% if '/device/' in request.path %} + <a class="nav-link active" aria-current="page" href="{{ url_for('device.home') }}">Device</a> + {% else %} + <a class="nav-link" href="{{ url_for('device.home') }}">Device</a> + {% endif %} + <!-- <a class="nav-link" href="{{ url_for('service.home') }}">Service</a> --> + </li> + <!-- <li class="nav-item"> + <a class="nav-link" href="#">Compute</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="#">Context</a> + </li> + + <li class="nav-item"> + <a class="nav-link" href="#">Monitoring</a> + </li> --> + <li class="nav-item"> + <a class="nav-link" href="{{ url_for('main.about') }}">About</a> + </li> + </ul> + <span class="navbar-text" style="color: #fff;"> + Current context: <b>{{ get_working_context() }}</b> + </span> + </div> + </div> + </nav> + + <main class="container"> + <div class="row"> + <div class="col-md-12"> + {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} + <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert"> + {{ message }} + <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> + </div> + + {% endfor %} + {% endif %} + {% endwith %} + </div> + </div> + <div class="bg-light p-5 rounded"> + {% block content %}{% endblock %} + </div> + </main> + + <footer class="footer" style="background-color: darkgrey;"> + <div class="row"> + <div class="col-md-12"> + <p class="text-muted text-center" style="color: white;">© 2021-2023</p> + </div> + </div> + </footer> + + <!-- Optional JavaScript; choose one of the two! --> + + <!-- Option 1: Bootstrap Bundle with Popper --> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-kQtW33rZJAHjgefvhyyzcGF3C5TFyBQBA13V1RKPf4uH+bwyzQxZ6CmMZHmNBEfJ" crossorigin="anonymous"></script> + <!-- <script src="{{ url_for('static', filename='site.js') }}"/> --> + + <!-- Option 2: Separate Popper and Bootstrap JS --> + <!-- + <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.min.js" integrity="sha384-PsUw7Xwds7x08Ew3exXhqzbhuEYmA2xnwc8BuD6SEr+UmEHlX8/MCltYEodzWA4u" crossorigin="anonymous"></script> + --> + </body> +</html> \ No newline at end of file diff --git a/src/webui/service/templates/context/home.html b/src/webui/service/templates/context/home.html new file mode 100644 index 0000000000000000000000000000000000000000..c389ea658130eb5909d3155462c81b0c85619f97 --- /dev/null +++ b/src/webui/service/templates/context/home.html @@ -0,0 +1,79 @@ +{% extends 'base.html' %} + +{% block content %} + <h1>Service</h1> + + <div class="row"> + <div class="col"> + <a href="{{ url_for('service.add') }}" class="btn btn-primary" style="margin-bottom: 10px;"> + <i class="bi bi-plus"></i> + Add New Service + </a> + </div> + <div class="col"> + {{ services | length }} services found + </div> + <div class="col"> + <form> + <div class="input-group"> + <input type="text" aria-label="Search" placeholder="Search..." class="form-control"/> + <button type="submit" class="btn btn-primary">Search</button> + </div> + </form> + </div> + </div> + + + <table class="table table-striped"> + <thead> + <tr> + <th scope="col">#</th> + <th scope="col">Type</th> + <th scope="col">End points</th> + <th scope="col">Constraints</th> + <th scope="col">State</th> + <th scope="col">Configuration</th> + <th scope="col"></th> + </tr> + </thead> + <tbody> + {% if services %} + {% for service in services %} + <tr> + <td><a href="{{ url_for('service.detail', contextUuid=service.cs_id.contextId.contextUuid.uuid, serviceUuid=service.cs_id.cs_id.uuid) }}">{{ service.cs_id.contextId.contextUuid.uuid }} / {{ service.cs_id.cs_id.uuid }}</a></td> + <td>{{ service.serviceType }}</td> + <td> + <ul> + {% for end_point in service.endpointList %} + <li>{{ end_point }}</li> + {% endfor %} + </ul> + </td> + <td> + <ul> + {% for constraint in service.constraint %} + <li>{{ constraint }}</li> + {% endfor %} + </ul> + </td> + <td>{{ service.serviceState }}</td> + <td>{{ service.serviceConfig }}</td> + <td> + <a href="{{ url_for('service.detail', contextUuid=service.cs_id.contextId.contextUuid.uuid, serviceUuid=service.cs_id.cs_id.uuid) }}"> + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> + <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> + <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> + </svg> + </a> + </td> + </tr> + {% endfor %} + {% else %} + <tr> + <td colspan="7">No services found</td> + </tr> + {% endif %} + </tbody> + </table> + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/add.html b/src/webui/service/templates/device/add.html new file mode 100644 index 0000000000000000000000000000000000000000..dae31a37689e9c7e9704401c38e3182aaed8c311 --- /dev/null +++ b/src/webui/service/templates/device/add.html @@ -0,0 +1,93 @@ +{% extends 'base.html' %} + +{% block content %} + <h1>Add New Device</h1> + + <form id="add_device" method="POST"> + {{ form.hidden_tag() }} + <fieldset> + <div class="row mb-3"> + {{ form.device_id.label(class="col-sm-2 col-form-label") }} + <div class="col-sm-10"> + {% if form.device_id.errors %} + {{ form.device_id(class="form-control is-invalid") }} + <div class="invalid-feedback"> + {% for error in form.device_id.errors %} + <span>{{ error }}</span> + {% endfor %} + </div> + {% else %} + {{ form.device_id(class="form-control") }} + {% endif %} + </div> + </div> + <div class="row mb-3"> + {{ form.device_type.label(class="col-sm-2 col-form-label") }} + <div class="col-sm-10"> + {% if form.device_type.errors %} + {{ form.device_type(class="form-control is-invalid") }} + <div class="invalid-feedback"> + {% for error in form.device_type.errors %} + <span>{{ error }}</span> + {% endfor %} + </div> + {% else %} + {{ form.device_type(class="form-control") }} + {% endif %} + </div> + </div> + <div class="row mb-3"> + {{ form.operational_status.label(class="col-sm-2 col-form-label") }} + <div class="col-sm-10"> + {% if form.operational_status.errors %} + {{ form.operational_status(class="form-control is-invalid") }} + <div class="invalid-feedback"> + {% for error in form.operational_status.errors %} + <span>{{ error }}</span> + {% endfor %} + </div> + {% else %} + {{ form.operational_status(class="form-control") }} + {% endif %} + </div> + </div> + <div class="row mb-3"> + {{ form.device_config.label(class="col-sm-2 col-form-label") }} + <div class="col-sm-10"> + {% if form.device_config.errors %} + {{ form.device_config(class="form-control is-invalid", rows=5) }} + <div class="invalid-feedback"> + {% for error in form.device_config.errors %} + <span>{{ error }}</span> + {% endfor %} + </div> + {% else %} + {{ form.device_config(class="form-control", rows=5) }} + {% endif %} + </div> + <div id="device_config_help" class="form-text">The device configurations should follow a <i>key=value</i> format, one configuration per line.</div> + </div> + <div class="row mb-3"> + {{ form.device_drivers.label(class="col-sm-2 col-form-label") }} + <div class="col-sm-10"> + {% if form.device_drivers.errors %} + {{ form.device_drivers(class="form-control is-invalid", rows=5) }} + <div class="invalid-feedback"> + {% for error in form.device_drivers.errors %} + <span>{{ error }}</span> + {% endfor %} + </div> + {% else %} + {{ form.device_drivers(class="form-control", rows=5) }} + {% endif %} + </div> + <div id="device_drivers_help" class="form-text"> + List the device drivers by their numerical ID, separated by commas, without spaces between them. Numerical IDs: {{ device_driver_ids }}. + </div> + </div> + <div class="row mb-3"> + <button type="submit" class="btn btn-primary">{{ submit_text }}</button> + </div> + </fieldset> + </form> +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/detail.html b/src/webui/service/templates/device/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..c090e13b516954778a1c27842520f1e8b2bc493b --- /dev/null +++ b/src/webui/service/templates/device/detail.html @@ -0,0 +1,73 @@ +{% extends 'base.html' %} + +{% block content %} + <h1>Device {{ device.device_id.device_uuid.uuid }}</h1> + + <div class="row mb-3"> + <div class="col-sm-3"> + <button type="button" class="btn btn-success" onclick="window.location.href = '/device/'"><i class="bi bi-box-arrow-in-left"></i>Back to device list</button> + </div> + <div class="col-sm-3"> + <a id="update" class="btn btn-secondary" href="#"><i class="bi bi-pencil-square"></i>Update</a> + </div> + <div class="col-sm-3"> + <!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete device</button> --> + <button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal"> + <i class="bi bi-x-square"></i>Delete device + </button> + </div> + </div> + + <div class="row mb-3"> + <b>UUID:</b> + <div class="col-sm-10"> + {{ device.device_id.device_uuid.uuid }} + </div> + </div> + <div class="row mb-3"> + <b>Type:</b> + <div class="col-sm-10"> + {{ device.device_type }} + </div> + </div> + <div class="row mb-3"> + <b>Configurations:</b> + <div class="col-sm-10"> + <ul> + {% for config in device.device_config.config_rules %} + <li>{{ config.resource_key }}: {{ config.resource_value }}</li> + {% endfor %} + </ul> + </div> + </div> + <div class="row mb-3"> + <b>Endpoints:</b> + <div class="col-sm-10"> + <ul> + {% for endpoint in device.device_endpoints %} + <li>{{ endpoint.endpoint_id.endpoint_uuid.uuid }}: {{ endpoint.endpoint_type }}</li> + {% endfor %} + </ul> + </div> + </div> + + <!-- Modal --> +<div class="modal fade" id="deleteModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <h5 class="modal-title" id="staticBackdropLabel">Delete device?</h5> + <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> + </div> + <div class="modal-body"> + Are you sure you want to delete the device "{{ device.device_id.device_uuid.uuid }}"? + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">No</button> + <a type="button" class="btn btn-danger" href="{{ url_for('device.delete', device_uuid=device.device_id.device_uuid.uuid) }}"><i class="bi bi-exclamation-diamond"></i>Yes</a> + </div> + </div> + </div> + </div> + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/home.html b/src/webui/service/templates/device/home.html new file mode 100644 index 0000000000000000000000000000000000000000..6010ed6a91c583dc352d14fc4e4b2543ee7e7eef --- /dev/null +++ b/src/webui/service/templates/device/home.html @@ -0,0 +1,93 @@ +{% extends 'base.html' %} + +{% block content %} + <h1>Devices</h1> + + <div class="row"> + <!-- <div class="col"> + <a href="{{ url_for('device.add') }}" class="btn btn-primary" style="margin-bottom: 10px;"> + <i class="bi bi-plus"></i> + Add New Device + </a> + </div> --> + <div class="col"> + {{ devices | length }} devices found in context <i>{{ session['context_uuid'] }}</i> + </div> + <!-- <div class="col"> + <form> + <div class="input-group"> + <input type="text" aria-label="Search" placeholder="Search..." class="form-control"/> + <button type="submit" class="btn btn-primary">Search</button> + </div> + </form> + </div> --> + </div> + + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col">#</th> + <th scope="col">Type</th> + <th scope="col">Endpoints</th> + <th scope="col">Drivers</th> + <th scope="col">Status</th> + <th scope="col">Configuration</th> + <!-- <th scope="col"></th> --> + </tr> + </thead> + <tbody> + {% if devices %} + {% for device in devices %} + <tr> + <td> + <!-- <a href="{{ url_for('device.detail', device_uuid=device.device_id.device_uuid.uuid) }}"> --> + {{ device.device_id.device_uuid.uuid }} + <!-- </a> --> + </td> + <td> + {{ device.device_type }} + </td> + <td> + <ul> + {% for end_point in device.device_endpoints %} + <li>{{ end_point.endpoint_id.endpoint_uuid.uuid }}</li> + {% endfor %} + </ul> + </td> + <td> + <ul> + {% for driver in device.device_drivers %} + <li>{{ dde.Name(driver) }}</li> + {% endfor %} + </ul> + </td> + <td>{{ dose.Name(device.device_operational_status) }}</td> + <td> + <ul> + {% for config in device.device_config.config_rules %} + <li> + Key: {{ config.resource_key }}<br/> + Value: {{ config.resource_value }} + </li> + {% endfor %} + </ul> + </td> + <!-- <td> + <a href="{{ url_for('device.detail', device_uuid=device.device_id.device_uuid.uuid) }}"> + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> + <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> + <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> + </svg> + </a> + </td> --> + </tr> + {% endfor %} + {% else %} + <tr> + <td colspan="7">No devices found</td> + </tr> + {% endif %} + </tbody> + </table> + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/main/about.html b/src/webui/service/templates/main/about.html new file mode 100644 index 0000000000000000000000000000000000000000..9ac1e29e8b326a3cefb8712b2bd9db92eebab226 --- /dev/null +++ b/src/webui/service/templates/main/about.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% block content %} + <h1>TeraFlow OS</h1> + + <p>For more information, visit the <a href="https://teraflow-h2020.eu/" target="_newtf">TeraFlow H2020 webpage</a>.</p> + + <img alt="Consortium" src="{{ url_for('static', filename='partners.png') }}"/> + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/main/home.html b/src/webui/service/templates/main/home.html new file mode 100644 index 0000000000000000000000000000000000000000..2bda77eb02f1b88c3f5363caaf7cb26ed5e1dfac --- /dev/null +++ b/src/webui/service/templates/main/home.html @@ -0,0 +1,37 @@ +{% extends 'base.html' %} + +{% block content %} + <h1>This is the home page</h1> + <p>Here we have have several things.</p> + + {% for field, message in context_form.errors.items() %} + <div class="alert alert-dismissible fade show" role="alert"> + <b>{{ field }}</b>: {{ message }} + <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> + </div> + + {% endfor %} + + <h2>Select the working context</h2> + <form id="select_context" method="POST"> + {{ context_form.hidden_tag() }} + <fieldset class="form-group"> + <div class="input-group mb-3"> + + {% if context_form.context.errors %} + {{ context_form.context(class="form-select is-invalid") }} + <div class="invalid-feedback"> + {% for error in context_form.context.errors %} + <span>{{ error }}</span> + {% endfor %} + </div> + {% else %} + {{ context_form.context(class="form-select") }} + {% endif %} + + {{ context_form.submit(class='btn btn-primary') }} + </div> + </fieldset> + </form> + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/service/home.html b/src/webui/service/templates/service/home.html new file mode 100644 index 0000000000000000000000000000000000000000..648ce99bd9276dd12986f644977520a980f6be79 --- /dev/null +++ b/src/webui/service/templates/service/home.html @@ -0,0 +1,95 @@ +{% extends 'base.html' %} + +{% block content %} + <h1>Services</h1> + + <div class="row"> + <!-- <div class="col"> + <a href="{{ url_for('service.add') }}" class="btn btn-primary" style="margin-bottom: 10px;"> + <i class="bi bi-plus"></i> + Add New Service + </a> + </div> --> + <div class="col"> + {{ services | length }} services found in context <i>{{ session['context_uuid'] }}</i> + </div> + <!-- <div class="col"> + <form> + <div class="input-group"> + <input type="text" aria-label="Search" placeholder="Search..." class="form-control"/> + <button type="submit" class="btn btn-primary">Search</button> + </div> + </form> + </div> --> + </div> + + + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col">#</th> + <th scope="col">Type</th> + <th scope="col">End points</th> + <th scope="col">Constraints</th> + <th scope="col">Status</th> + <th scope="col">Configuration</th> + <!-- <th scope="col"></th> --> + </tr> + </thead> + <tbody> + {% if services %} + {% for service in services %} + <tr> + <td> + <!-- <a href="{{ url_for('service.detail', service_uuid=service.service_id.service_uuid.uuid) }}"> --> + {{ service.service_id.service_uuid.uuid }} + <!-- </a> --> + </td> + <td> + {{ ste.Name(service.service_type) }} + </td> + <td> + <ul> + {% for end_point in service.service_endpoint_ids %} + <li>{{ end_point.device_id.device_uuid.uuid }} / {{ end_point.endpoint_uuid.uuid }}</li> + {% endfor %} + </ul> + </td> + <td> + <ul> + {% for constraint in service.service_constraints %} + <li>{{ constraint.constraint_type }}: {{ constraint.constraint_value }}</li> + {% endfor %} + </ul> + </td> + <td>{{ sse.Name(service.service_status.service_status) }}</td> + <td> + <ul> + {% for rule in service.service_config.config_rules %} + <li> + Key: {{ rule.resource_key }} + <br/> + Value: {{ rule.resource_value }} + </li> + {% endfor %} + </ul> + </td> + <!-- <td> + <a href="{{ url_for('service.detail', service_uuid=service.service_id.service_uuid.uuid) }}"> + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> + <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> + <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> + </svg> + </a> + </td> --> + </tr> + {% endfor %} + {% else %} + <tr> + <td colspan="7">No services found</td> + </tr> + {% endif %} + </tbody> + </table> + +{% endblock %} \ No newline at end of file diff --git a/src/webui/tests/__init__.py b/src/webui/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/tests/test_unitary.py b/src/webui/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..0612c9d05670e9b1a062694f41bf4762b13d1d7e --- /dev/null +++ b/src/webui/tests/test_unitary.py @@ -0,0 +1,156 @@ +# import pytest +from flask_unittest import ClientTestCase +from unittest import mock +from flask.testing import FlaskClient +from flask.app import Flask +from flask.helpers import url_for +# from device.client.DeviceClient import DeviceClient +from webui.service import create_app +from webui.proto.context_pb2 import Empty, DeviceId, DeviceList, TopologyIdList + +class TestWebUI(ClientTestCase): + app = create_app(use_config={'TESTING': True, + 'SERVER_NAME': 'localhost.localdomain', + 'SECRET_KEY': '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(', + 'WTF_CSRF_ENABLED': False}) + + def setUp(self, client: FlaskClient) -> None: + + self.mocker_delete_device = mock.patch('webui.service.device.routes.device_client.DeleteDevice') + self.mocker_delete_device.return_value = Empty() + self.mocker_delete_device.start() + self.addCleanup(self.mocker_delete_device.stop) + + self.mocker_list_devices = mock.patch('webui.service.device.routes.context_client.ListDevices') + self.mocker_list_devices.return_value = DeviceList() # returns an empty list + self.mocker_list_devices.start() + self.addCleanup(self.mocker_list_devices.stop) + + self.mocker_add_device = mock.patch('webui.service.device.routes.device_client.AddDevice') + self.mocker_add_device.return_value = DeviceId() + self.mocker_add_device.start() + self.addCleanup(self.mocker_add_device.stop) + + self.mocker_list_topology_ids = mock.patch('webui.service.device.routes.context_client.ListTopologyIds') + self.mocker_list_topology_ids.return_value = TopologyIdList() + self.mocker_list_topology_ids.start() + self.addCleanup(self.mocker_list_topology_ids.stop) + + return super().setUp(client) + + def tearDown(self, client: FlaskClient) -> None: + mock.patch.stopall() + return super().tearDown(client) + + def test_routes(self, client): + with self.app.app_context(): + url_for('main.home') + url_for('service.home') + url_for('device.home') + url_for('main.about') + + def test_device_add_action_success(self, client): + with client.session_transaction() as sess: + sess['context_uuid'] = 'admin' + DEVICE_EMU = { + 'device_id': 'EMULATED', + 'device_type': 'emulated', + 'device_config': '', + 'operational_status': 1, + 'device_drivers': 0, + 'device_endpoints': [], + } + rv = client.post('/device/add', data=DEVICE_EMU, follow_redirects=True) + self.assertInResponse(b'success', rv) + + def test_device_delete_action(self, client): + with client.session_transaction() as sess: + sess['context_uuid'] = 'admin' + + rv = client.get('/device/EMULATED/delete', follow_redirects=True) + # mocked_list.assert_called() + # mocked_delete.assert_called() + self.assertInResponse(b'success', rv) + + def test_service_up(self, client): + pass + + + +# def test_service_up(client): +# rw = client.get('/') +# assert rw.status_code == 200, 'Service is not up!' + +# def test_home_page(client): +# rw = client.get('/') +# assert rw.status_code == 200, 'Error in the home page!' +# assert b'Select the working context' in rw.data + +# def test_service_home_page(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get('/service/') +# assert rw.status_code == 200 +# assert b'Services' in rw.data +# assert b'Add New Service' in rw.data + +# def test_device_home_page(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get('/device/') +# assert rw.status_code == 200 +# assert b'Devices' in rw.data +# assert b'Add New Device' in rw.data + +# @pytest.mark.parametrize('device_id', ( +# 'DEV1', +# 'DEV2', +# 'DEV3', +# )) +# def test_device_detail_page(client, device_id): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get(f'/device/detail/{device_id}') +# assert rw.status_code == 200 +# assert b'Device' in rw.data +# assert device_id in rw.data.decode() +# assert b'Endpoints' in rw.data, 'Missing endpoint information on the device detail page.' +# # assert b'Add New Device' in rw.data + +# def test_device_add_page(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# rw = client.get('/device/add') +# assert rw.status_code == 200 +# assert b'Add New Device' in rw.data +# assert b'Operational Status' in rw.data, 'Form is not correctly implemented.' +# assert b'Type' in rw.data, 'Form is not correctly implemented.' +# assert b'Configurations' in rw.data, 'Form is not correctly implemented.' +# assert b'Drivers' in rw.data, 'Form is not correctly implemented.' + +# def test_device_add_action(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# DEVICE_EMU = { +# 'device_id': 'EMULATED', +# 'device_type': 'emulated', +# 'device_config': '', +# 'operational_status': 1, +# 'device_drivers': 0, +# 'device_endpoints': [], +# } +# with mock.patch('webui.service.device.routes.device_client.AddDevice') as mocked_add: +# mocked_add.return_value = DeviceId() +# rw = client.post('/device/add', data=DEVICE_EMU, follow_redirects=True) +# assert b'success' in rw.data + +# def test_device_delete_action(client): +# with client.session_transaction() as sess: +# sess['context_uuid'] = 'admin' +# with mock.patch('webui.service.device.routes.device_client.DeleteDevice') as mocked_delete,\ +# mock.patch('webui.service.device.routes.context_client.ListDevices') as mocked_list: +# mocked_list.return_value = DeviceList() # returns an empty list +# rw = client.get('/device/EMULATED/delete', follow_redirects=True) +# mocked_list.assert_called() +# mocked_delete.assert_called() +# assert b'success' in rw.data diff --git a/src/webui/utils/__init__.py b/src/webui/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/webui/utils/form_validators.py b/src/webui/utils/form_validators.py new file mode 100644 index 0000000000000000000000000000000000000000..e339fdcc096ae8994ff0eb61a30f93d778fbe41e --- /dev/null +++ b/src/webui/utils/form_validators.py @@ -0,0 +1,14 @@ +from wtforms.validators import ValidationError + +def key_value_validator(): + def _validate(form, field): + if len(field.data) > 0: + if '\n' not in field.data: # case in which there is only one configuration + if '=' not in field.data: + raise ValidationError(f'Configuration "{field.data}" does not follow the key=value pattern.') + else: # case in which there are several configurations + configurations = field.data.split('\n') + for configutation in configurations: + if '=' not in configutation: + raise ValidationError(f'Configuration "{configutation}" does not follow the key=value pattern.') + return _validate