diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fe5e6c5db2815ff2c5fcbf28b6fedeec3e060c0..2e411116766596d90f77e339f03684449780d9ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ include: - local: '/src/opticalattackmitigator/.gitlab-ci.yml' - local: '/src/opticalattackdetector/.gitlab-ci.yml' # - local: '/src/opticalattackmanager/.gitlab-ci.yml' - - local: '/src/automation/.gitlab-ci.yml' + - local: '/src/ztp/.gitlab-ci.yml' - local: '/src/policy/.gitlab-ci.yml' #- local: '/src/webui/.gitlab-ci.yml' #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' diff --git a/.gitlab/issue_templates/new-feature-with-design.md b/.gitlab/issue_templates/new-feature-with-design.md index ec08771641bcf5193ea4db45581bc85eb1a0a5b9..03c4804e64a2c14ca494947f9a30f920e5c2e5c8 100644 --- a/.gitlab/issue_templates/new-feature-with-design.md +++ b/.gitlab/issue_templates/new-feature-with-design.md @@ -40,7 +40,7 @@ components deployed. ## Impacted Components -List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, Automation, Policy, Compute, etc. +List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, ZTP, Policy, Compute, etc. Just an enumeration, elaboration of impacts is done below. ## Component1 Impact diff --git a/deploy/all.sh b/deploy/all.sh index 9584dd32d121b7f63e7c7f177bf7bee8c287b4c9..bc09083ca110ff3093cb35bd57af1f3411c46a13 100755 --- a/deploy/all.sh +++ b/deploy/all.sh @@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. # By default, only basic components are deployed -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"} +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice compute webui load_generator"} # If not already set, set the tag you want to use for your images. export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} diff --git a/deploy/component.sh b/deploy/component.sh index 922aa5e0ec77a2c6acd73db1195a9ec3d2b160fb..e2648818684f672c41cca19a7ac1281b797f4382 100755 --- a/deploy/component.sh +++ b/deploy/component.sh @@ -59,7 +59,7 @@ for COMPONENT in $TFS_COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" elif [ "$COMPONENT" == "pathcomp" ]; then BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log" diff --git a/deploy/tfs.sh b/deploy/tfs.sh index 95d882c8ba06d53c724559800440a788b7496555..e9045ec888d5c4f05576d001c8068624b4b6cf52 100755 --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. # By default, only basic components are deployed -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"} +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice compute webui load_generator"} # If not already set, set the tag you want to use for your images. export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} @@ -183,6 +183,22 @@ REDIS_PASSWORD=`uuidgen` kubectl create secret generic redis-secrets --namespace=$TFS_K8S_NAMESPACE \ --from-literal=REDIS_PASSWORD=$REDIS_PASSWORD echo "export REDIS_PASSWORD=${REDIS_PASSWORD}" >> $ENV_VARS_SCRIPT +printf "\n" + +DOCKER_BUILD="docker build" +DOCKER_MAJOR_VERSION=$(docker --version | grep -o -E "Docker version [0-9]+\." | grep -o -E "[0-9]+" | cut -c 1-3) +if [[ $DOCKER_MAJOR_VERSION -ge 23 ]]; then + # If Docker version >= 23, build command was migrated to docker-buildx + # In Ubuntu, in practice, means to install package docker-buildx together with docker.io + # Check if docker-buildx plugin is installed + docker buildx version 1>/dev/null 2>/dev/null + if [[ $? -ne 0 ]]; then + echo "Docker buildx command is not installed. Check: https://docs.docker.com/build/architecture/#install-buildx" + echo "If you installed docker through APT package docker.io, consider installing also package docker-buildx" + exit 1; + fi + DOCKER_BUILD="docker buildx build" +fi for COMPONENT in $TFS_COMPONENTS; do echo "Processing '$COMPONENT' component..." @@ -191,25 +207,25 @@ for COMPONENT in $TFS_COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then - docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then + $DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" elif [ "$COMPONENT" == "pathcomp" ]; then BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log" - docker build -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-frontend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/frontend/Dockerfile . > "$BUILD_LOG" BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-backend.log" - docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-backend:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/backend/Dockerfile . > "$BUILD_LOG" # next command is redundant, but helpful to keep cache updated between rebuilds IMAGE_NAME="$COMPONENT-backend:$TFS_IMAGE_TAG-builder" - docker build -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG" + $DOCKER_BUILD -t "$IMAGE_NAME" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG" elif [ "$COMPONENT" == "dlt" ]; then BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-connector.log" - docker build -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-connector:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/connector/Dockerfile . > "$BUILD_LOG" BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-gateway.log" - docker build -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT-gateway:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/gateway/Dockerfile . > "$BUILD_LOG" else - docker build -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" + $DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" fi echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..." diff --git a/expose_ingress_grpc.sh b/expose_ingress_grpc.sh index 2bc0fd64b60cafdfad92b3d8d031cd28d7d6a873..0f073d54a08b569beeb73beca529fe1a4efc6c53 100755 --- a/expose_ingress_grpc.sh +++ b/expose_ingress_grpc.sh @@ -21,7 +21,7 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # If not already set, set the list of components you want to build images for, and deploy. -export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector l3_attackmitigator l3_centralizedattackdetector webui"} +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector l3_attackmitigator l3_centralizedattackdetector webui"} ######################################################################################################################## # Automated steps start here diff --git a/hackfest/containerlab/commands.txt b/hackfest/containerlab/commands.txt index 18c629c0af2fe176a34f9b08a16405731c185243..df5fbc0ce0163f4ce06b862e90e29854dbae204a 100644 --- a/hackfest/containerlab/commands.txt +++ b/hackfest/containerlab/commands.txt @@ -60,22 +60,24 @@ docker exec -it clab-tfs-scenario-client2 bash $ sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)" ## gNMI Capabilities request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify capabilities ## gNMI Get request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interface[name=mgmt0] +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/config/hostname +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /interfaces/interface[name=mgmt0] + ## gNMI Set request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/name/host-name --update-value slr11 +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --update-path /system/config/hostname --update-value srl11 -(we check the changed value) -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/name/host-name +(we check the changed value) +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path /system/config/hostname ## Subscribe request -$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interface[name=mgmt0]/statistics +$ gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interfaces/interface[name=mgmt0]/state/ + (In another terminal, you can generate traffic) -$ssh admin@clab-srlinux-srl1 +$ssh admin@clab-tfs-scenario-srl1 diff --git a/hackfest/p4/deploy_specs.sh b/hackfest/p4/deploy_specs.sh index b988123d5564684bd1bfcb776bab7f187fc628ca..6bd8d07c839ce235cc3cba8fcd29be93214a730f 100755 --- a/hackfest/p4/deploy_specs.sh +++ b/hackfest/p4/deploy_specs.sh @@ -16,7 +16,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation service compute monitoring webui" +export TFS_COMPONENTS="context device ztp service compute monitoring webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/hackfest3 b/hackfest3 new file mode 120000 index 0000000000000000000000000000000000000000..2816e4af9a9b4f4b06651710e87d93f4d5db1f0b --- /dev/null +++ b/hackfest3 @@ -0,0 +1 @@ +src/tests/hackfest3/ \ No newline at end of file diff --git a/install_requirements.sh b/install_requirements.sh index 213edef5af3f6efc75b060f12972926aee2e5c5c..79ec929cf43815092c4a1643e008954a8e7c9c4d 100755 --- a/install_requirements.sh +++ b/install_requirements.sh @@ -16,7 +16,7 @@ # If not already set, set the list of components you want to install dependencies for. # By default, dependencies for all components are installed. # Components still not supported by this script: -# automation & policy : implemented in Java +# ztp & policy : implemented in Java # dlt : under design # pathcomp : under design ALL_COMPONENTS="context device service compute monitoring webui interdomain slice" @@ -38,7 +38,7 @@ printf "\n" echo "Collecting requirements from components..." for COMPONENT in $TFS_COMPONENTS do - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then continue; fi diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in done printf "\n" diff --git a/manifests/servicemonitors.yaml b/manifests/servicemonitors.yaml index e77216af2a723cef8a4c5f468ef564625ea810f1..28dede7ab701ebdcff6d1d5c1ccbcab213ff87dd 100644 --- a/manifests/servicemonitors.yaml +++ b/manifests/servicemonitors.yaml @@ -277,9 +277,9 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running - name: tfs-automationservice-metric + name: tfs-ztpservice-metric labels: - app: automationservice + app: ztpservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing @@ -290,7 +290,7 @@ spec: matchLabels: # Target app service #namespace: tfs - app: automationservice # same as above + app: ztpservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app @@ -474,4 +474,4 @@ spec: namespaceSelector: any: false matchNames: - - tfs # namespace where the app is running \ No newline at end of file + - tfs # namespace where the app is running diff --git a/manifests/automationservice.yaml b/manifests/ztpservice.yaml similarity index 84% rename from manifests/automationservice.yaml rename to manifests/ztpservice.yaml index f4a4def176cd2b9f89d7ee4f10c0af48a08b9733..e2be80cea7b1e779fdc9bb05110ddc0d6b144101 100644 --- a/manifests/automationservice.yaml +++ b/manifests/ztpservice.yaml @@ -19,9 +19,9 @@ metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 labels: - app.kubernetes.io/name: automationservice - app: automationservice - name: automationservice + app.kubernetes.io/name: ztpservice + app: ztpservice + name: ztpservice spec: ports: - name: grpc @@ -32,7 +32,7 @@ spec: port: 9192 targetPort: 8080 selector: - app.kubernetes.io/name: automationservice + app.kubernetes.io/name: ztpservice type: ClusterIP --- apiVersion: apps/v1 @@ -41,21 +41,21 @@ metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 labels: - app: automationservice - app.kubernetes.io/name: automationservice - name: automationservice + app: ztpservice + app.kubernetes.io/name: ztpservice + name: ztpservice spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: automationservice + app.kubernetes.io/name: ztpservice template: metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 labels: - app: automationservice - app.kubernetes.io/name: automationservice + app: ztpservice + app.kubernetes.io/name: ztpservice spec: containers: - env: @@ -67,7 +67,7 @@ spec: value: contextservice - name: DEVICE_SERVICE_HOST value: deviceservice - image: labs.etsi.org:5050/tfs/controller/automation:0.2.0 + image: labs.etsi.org:5050/tfs/controller/ztp:0.2.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -79,7 +79,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 - name: automationservice + name: ztpservice ports: - containerPort: 5050 name: grpc @@ -108,12 +108,12 @@ spec: apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: automationservice-hpa + name: ztpservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: automationservice + name: ztpservice minReplicas: 1 maxReplicas: 10 metrics: diff --git a/my_deploy.sh b/my_deploy.sh index ab1d2695241b2362c00e3fff0ff4363ca82401ad..975d420bda6c29238da3345249d48bb71e86e291 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -25,11 +25,11 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui load_ # Uncomment to activate Monitoring export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Policy Manager -export TFS_COMPONENTS="${TFS_COMPONENTS} policy" +# Uncomment to activate ZTP +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" -# Uncomment to activate Automation Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation" +# Uncomment to activate Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/proto/context.proto b/proto/context.proto index 55a80470d40463742cc3e034ca9e933f4ff6c3f0..22e11bc68b840115a19551958ac322acb71fb9a4 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -174,12 +174,17 @@ message Device { DeviceOperationalStatusEnum device_operational_status = 5; repeated DeviceDriverEnum device_drivers = 6; repeated EndPoint device_endpoints = 7; - repeated Component component = 8; // Used for inventory + repeated Component components = 8; // Used for inventory DeviceId controller_id = 9; // Identifier of node controlling the actual device } -message Component { - repeated string comp_string = 1; +message Component { //Defined previously to this section - Tested OK + Uuid component_uuid = 1; + string name = 2; + string type = 3; + + map<string, string> attributes = 4; // dict[attr.name => json.dumps(attr.value)] + string parent = 5; } message DeviceConfig { @@ -192,7 +197,7 @@ enum DeviceDriverEnum { DEVICEDRIVER_TRANSPORT_API = 2; DEVICEDRIVER_P4 = 3; DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4; - DEVICEDRIVER_ONF_TR_352 = 5; + DEVICEDRIVER_ONF_TR_532 = 5; DEVICEDRIVER_XR = 6; DEVICEDRIVER_IETF_L2VPN = 7; DEVICEDRIVER_GNMI_OPENCONFIG = 8; diff --git a/proto/automation.proto b/proto/ztp.proto similarity index 97% rename from proto/automation.proto rename to proto/ztp.proto index e2dbe33223566c4065ecb0086fbd8231a56834d4..5c895900d8c8b379fc6e58a16bbf4dad3918276b 100644 --- a/proto/automation.proto +++ b/proto/ztp.proto @@ -13,11 +13,11 @@ // limitations under the License. syntax = "proto3"; -package automation; +package ztp; import "context.proto"; -service AutomationService { +service ZtpService { rpc ZtpGetDeviceRole(DeviceRoleId) returns (DeviceRole) {} rpc ZtpGetDeviceRolesByDeviceId(context.DeviceId) returns (DeviceRoleList) {} rpc ZtpAdd(DeviceRole) returns (DeviceRoleState) {} diff --git a/run_tests_docker.sh b/run_tests_docker.sh index d27c4e7d8a36f89b3b0b72e9c5725c80b520141f..ae8dc9162e32d16472ba4be1de96b46bdd20db9b 100755 --- a/run_tests_docker.sh +++ b/run_tests_docker.sh @@ -24,7 +24,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 centralizedattackdetector" +COMPONENTS="context device ztp policy service compute monitoring centralizedattackdetector" # Set the tag you want to use for your images. IMAGE_TAG="tf-dev" @@ -43,7 +43,7 @@ for COMPONENT in $COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" else docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG" diff --git a/scripts/old/deploy_in_kubernetes.sh b/scripts/old/deploy_in_kubernetes.sh index c13a236664bde370a323f1663095afd72f72aaec..df4a550eaa57791a3daa4e0784dbdbaaa821106e 100755 --- a/scripts/old/deploy_in_kubernetes.sh +++ b/scripts/old/deploy_in_kubernetes.sh @@ -24,7 +24,7 @@ export REGISTRY_IMAGE=${REGISTRY_IMAGE:-""} #export REGISTRY_IMAGE="http://my-container-registry.local/" # If not already set, set the list of components you want to build images for, and deploy. -export COMPONENTS=${COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} +export COMPONENTS=${COMPONENTS:-"context device ztp policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} # If not already set, set the tag you want to use for your images. export IMAGE_TAG=${IMAGE_TAG:-"tf-dev"} @@ -78,7 +78,7 @@ for COMPONENT in $COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" else docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" diff --git a/scripts/show_logs_automation.sh b/scripts/show_logs_automation.sh index 46c0dbba9752b207b11136535403f0c009d0a377..5ee561f532a7e424326f38501906f78327c05559 100755 --- a/scripts/show_logs_automation.sh +++ b/scripts/show_logs_automation.sh @@ -24,4 +24,4 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # Automated steps start here ######################################################################################################################## -kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/automationservice +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/ztpservice diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py index f721425f89b84fe76783cd2f26b923c0c9005e5a..45baf39e07ea1ea3dde800c2cefd1641620bb4aa 100644 --- a/scripts/update_license_headers.py +++ b/scripts/update_license_headers.py @@ -55,8 +55,8 @@ def skip_file(file_path : str) -> bool: if '/.mvn/' in file_path: return True if '/hackfest/kafka/kafka_2.13-2.8.0' in file_path: return True if '/src/device/service/drivers/openconfig/templates/' in file_path: return True - if '/automation/target/generated-sources/grpc/' in file_path: return True - if '/automation/target/kubernetes/' in file_path: return True + if '/ztp/target/generated-sources/grpc/' in file_path: return True + if '/ztp/target/kubernetes/' in file_path: return True if '/policy/target/generated-sources/grpc/' in file_path: return True if '/policy/target/kubernetes/' in file_path: return True if '/src/dlt/gateway/' in file_path: return True diff --git a/src/automation/src/main/proto/automation.proto b/src/automation/src/main/proto/automation.proto deleted file mode 120000 index afef7a8e47ec5688ec46498c2197bc345e6c5e92..0000000000000000000000000000000000000000 --- a/src/automation/src/main/proto/automation.proto +++ /dev/null @@ -1 +0,0 @@ -../../../../../proto/automation.proto \ No newline at end of file diff --git a/src/automation/src/main/resources/teraflow-automation-banner.txt b/src/automation/src/main/resources/teraflow-automation-banner.txt deleted file mode 100644 index 3792524170f5b74de9add7340ab32940d7f65a64..0000000000000000000000000000000000000000 --- a/src/automation/src/main/resources/teraflow-automation-banner.txt +++ /dev/null @@ -1,9 +0,0 @@ - - _______ ______ _ _ _ _ - |__ __| | ____| | /\ | | | | (_) - | | ___ _ __ __ _| |__ | | _____ __ / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ - | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \ - | | __/ | | (_| | | | | (_) \ V V / / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | | - |_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_| - - diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationService.java b/src/automation/target/generated-sources/grpc/automation/AutomationService.java deleted file mode 100644 index 8ef5784815a7b8bb6d51b05f89f6ca3a4b23f2e5..0000000000000000000000000000000000000000 --- a/src/automation/target/generated-sources/grpc/automation/AutomationService.java +++ /dev/null @@ -1,26 +0,0 @@ -package automation; - -import io.quarkus.grpc.runtime.MutinyService; - -@javax.annotation.Generated( -value = "by Mutiny Grpc generator", -comments = "Source: automation.proto") -public interface AutomationService extends MutinyService { - - - io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request); - - io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request); - - io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request); - - io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request); - - io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request); - - io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request); - - - - -} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java deleted file mode 100644 index 13d13c431b63baebd22ed7fd566b6b25395977e3..0000000000000000000000000000000000000000 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceClient.java +++ /dev/null @@ -1,48 +0,0 @@ -package automation; - -import java.util.function.BiFunction; - -import io.quarkus.grpc.runtime.MutinyClient; - -@javax.annotation.Generated( -value = "by Mutiny Grpc generator", -comments = "Source: automation.proto") -public class AutomationServiceClient implements AutomationService, MutinyClient<MutinyAutomationServiceGrpc.MutinyAutomationServiceStub> { - - private final MutinyAutomationServiceGrpc.MutinyAutomationServiceStub stub; - - public AutomationServiceClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyAutomationServiceGrpc.MutinyAutomationServiceStub, MutinyAutomationServiceGrpc.MutinyAutomationServiceStub> stubConfigurator) { - this.stub = stubConfigurator.apply(name,MutinyAutomationServiceGrpc.newMutinyStub(channel)); - } - - @Override - public MutinyAutomationServiceGrpc.MutinyAutomationServiceStub getStub() { - return stub; - } - - @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { - return stub.ztpGetDeviceRole(request); - } - @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { - return stub.ztpGetDeviceRolesByDeviceId(request); - } - @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) { - return stub.ztpAdd(request); - } - @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) { - return stub.ztpUpdate(request); - } - @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) { - return stub.ztpDelete(request); - } - @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { - return stub.ztpDeleteAll(request); - } - -} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java b/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java deleted file mode 100644 index 841994ea713bb9d1c0223689386d6cae35c6d014..0000000000000000000000000000000000000000 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceGrpc.java +++ /dev/null @@ -1,645 +0,0 @@ -package automation; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.38.1)", - comments = "Source: automation.proto") -public final class AutomationServiceGrpc { - - private AutomationServiceGrpc() {} - - public static final String SERVICE_NAME = "automation.AutomationService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor<automation.Automation.DeviceRoleId, - automation.Automation.DeviceRole> getZtpGetDeviceRoleMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRole", - requestType = automation.Automation.DeviceRoleId.class, - responseType = automation.Automation.DeviceRole.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<automation.Automation.DeviceRoleId, - automation.Automation.DeviceRole> getZtpGetDeviceRoleMethod() { - io.grpc.MethodDescriptor<automation.Automation.DeviceRoleId, automation.Automation.DeviceRole> getZtpGetDeviceRoleMethod; - if ((getZtpGetDeviceRoleMethod = AutomationServiceGrpc.getZtpGetDeviceRoleMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpGetDeviceRoleMethod = AutomationServiceGrpc.getZtpGetDeviceRoleMethod) == null) { - AutomationServiceGrpc.getZtpGetDeviceRoleMethod = getZtpGetDeviceRoleMethod = - io.grpc.MethodDescriptor.<automation.Automation.DeviceRoleId, automation.Automation.DeviceRole>newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRole")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleId.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRole.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpGetDeviceRole")) - .build(); - } - } - } - return getZtpGetDeviceRoleMethod; - } - - private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, - automation.Automation.DeviceRoleList> getZtpGetDeviceRolesByDeviceIdMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRolesByDeviceId", - requestType = context.ContextOuterClass.DeviceId.class, - responseType = automation.Automation.DeviceRoleList.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, - automation.Automation.DeviceRoleList> getZtpGetDeviceRolesByDeviceIdMethod() { - io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, automation.Automation.DeviceRoleList> getZtpGetDeviceRolesByDeviceIdMethod; - if ((getZtpGetDeviceRolesByDeviceIdMethod = AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpGetDeviceRolesByDeviceIdMethod = AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) { - AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod = getZtpGetDeviceRolesByDeviceIdMethod = - io.grpc.MethodDescriptor.<context.ContextOuterClass.DeviceId, automation.Automation.DeviceRoleList>newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRolesByDeviceId")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - context.ContextOuterClass.DeviceId.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleList.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpGetDeviceRolesByDeviceId")) - .build(); - } - } - } - return getZtpGetDeviceRolesByDeviceIdMethod; - } - - private static volatile io.grpc.MethodDescriptor<automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState> getZtpAddMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpAdd", - requestType = automation.Automation.DeviceRole.class, - responseType = automation.Automation.DeviceRoleState.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState> getZtpAddMethod() { - io.grpc.MethodDescriptor<automation.Automation.DeviceRole, automation.Automation.DeviceRoleState> getZtpAddMethod; - if ((getZtpAddMethod = AutomationServiceGrpc.getZtpAddMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpAddMethod = AutomationServiceGrpc.getZtpAddMethod) == null) { - AutomationServiceGrpc.getZtpAddMethod = getZtpAddMethod = - io.grpc.MethodDescriptor.<automation.Automation.DeviceRole, automation.Automation.DeviceRoleState>newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpAdd")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRole.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleState.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpAdd")) - .build(); - } - } - } - return getZtpAddMethod; - } - - private static volatile io.grpc.MethodDescriptor<automation.Automation.DeviceRoleConfig, - automation.Automation.DeviceRoleState> getZtpUpdateMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpUpdate", - requestType = automation.Automation.DeviceRoleConfig.class, - responseType = automation.Automation.DeviceRoleState.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<automation.Automation.DeviceRoleConfig, - automation.Automation.DeviceRoleState> getZtpUpdateMethod() { - io.grpc.MethodDescriptor<automation.Automation.DeviceRoleConfig, automation.Automation.DeviceRoleState> getZtpUpdateMethod; - if ((getZtpUpdateMethod = AutomationServiceGrpc.getZtpUpdateMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpUpdateMethod = AutomationServiceGrpc.getZtpUpdateMethod) == null) { - AutomationServiceGrpc.getZtpUpdateMethod = getZtpUpdateMethod = - io.grpc.MethodDescriptor.<automation.Automation.DeviceRoleConfig, automation.Automation.DeviceRoleState>newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpUpdate")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleConfig.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleState.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpUpdate")) - .build(); - } - } - } - return getZtpUpdateMethod; - } - - private static volatile io.grpc.MethodDescriptor<automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState> getZtpDeleteMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpDelete", - requestType = automation.Automation.DeviceRole.class, - responseType = automation.Automation.DeviceRoleState.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState> getZtpDeleteMethod() { - io.grpc.MethodDescriptor<automation.Automation.DeviceRole, automation.Automation.DeviceRoleState> getZtpDeleteMethod; - if ((getZtpDeleteMethod = AutomationServiceGrpc.getZtpDeleteMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpDeleteMethod = AutomationServiceGrpc.getZtpDeleteMethod) == null) { - AutomationServiceGrpc.getZtpDeleteMethod = getZtpDeleteMethod = - io.grpc.MethodDescriptor.<automation.Automation.DeviceRole, automation.Automation.DeviceRoleState>newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDelete")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRole.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceRoleState.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDelete")) - .build(); - } - } - } - return getZtpDeleteMethod; - } - - private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, - automation.Automation.DeviceDeletionResult> getZtpDeleteAllMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ZtpDeleteAll", - requestType = context.ContextOuterClass.Empty.class, - responseType = automation.Automation.DeviceDeletionResult.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, - automation.Automation.DeviceDeletionResult> getZtpDeleteAllMethod() { - io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, automation.Automation.DeviceDeletionResult> getZtpDeleteAllMethod; - if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) { - synchronized (AutomationServiceGrpc.class) { - if ((getZtpDeleteAllMethod = AutomationServiceGrpc.getZtpDeleteAllMethod) == null) { - AutomationServiceGrpc.getZtpDeleteAllMethod = getZtpDeleteAllMethod = - io.grpc.MethodDescriptor.<context.ContextOuterClass.Empty, automation.Automation.DeviceDeletionResult>newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDeleteAll")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - context.ContextOuterClass.Empty.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - automation.Automation.DeviceDeletionResult.getDefaultInstance())) - .setSchemaDescriptor(new AutomationServiceMethodDescriptorSupplier("ZtpDeleteAll")) - .build(); - } - } - } - return getZtpDeleteAllMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static AutomationServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory<AutomationServiceStub> factory = - new io.grpc.stub.AbstractStub.StubFactory<AutomationServiceStub>() { - @java.lang.Override - public AutomationServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceStub(channel, callOptions); - } - }; - return AutomationServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static AutomationServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory<AutomationServiceBlockingStub> factory = - new io.grpc.stub.AbstractStub.StubFactory<AutomationServiceBlockingStub>() { - @java.lang.Override - public AutomationServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceBlockingStub(channel, callOptions); - } - }; - return AutomationServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static AutomationServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory<AutomationServiceFutureStub> factory = - new io.grpc.stub.AbstractStub.StubFactory<AutomationServiceFutureStub>() { - @java.lang.Override - public AutomationServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceFutureStub(channel, callOptions); - } - }; - return AutomationServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class AutomationServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void ztpGetDeviceRole(automation.Automation.DeviceRoleId request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRole> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRoleMethod(), responseObserver); - } - - /** - */ - public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleList> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRolesByDeviceIdMethod(), responseObserver); - } - - /** - */ - public void ztpAdd(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpAddMethod(), responseObserver); - } - - /** - */ - public void ztpUpdate(automation.Automation.DeviceRoleConfig request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpUpdateMethod(), responseObserver); - } - - /** - */ - public void ztpDelete(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteMethod(), responseObserver); - } - - /** - */ - public void ztpDeleteAll(context.ContextOuterClass.Empty request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceDeletionResult> responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteAllMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getZtpGetDeviceRoleMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRoleId, - automation.Automation.DeviceRole>( - this, METHODID_ZTP_GET_DEVICE_ROLE))) - .addMethod( - getZtpGetDeviceRolesByDeviceIdMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - context.ContextOuterClass.DeviceId, - automation.Automation.DeviceRoleList>( - this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID))) - .addMethod( - getZtpAddMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState>( - this, METHODID_ZTP_ADD))) - .addMethod( - getZtpUpdateMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRoleConfig, - automation.Automation.DeviceRoleState>( - this, METHODID_ZTP_UPDATE))) - .addMethod( - getZtpDeleteMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState>( - this, METHODID_ZTP_DELETE))) - .addMethod( - getZtpDeleteAllMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - context.ContextOuterClass.Empty, - automation.Automation.DeviceDeletionResult>( - this, METHODID_ZTP_DELETE_ALL))) - .build(); - } - } - - /** - */ - public static final class AutomationServiceStub extends io.grpc.stub.AbstractAsyncStub<AutomationServiceStub> { - private AutomationServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AutomationServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceStub(channel, callOptions); - } - - /** - */ - public void ztpGetDeviceRole(automation.Automation.DeviceRoleId request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRole> responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleList> responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpAdd(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState> responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpAddMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpUpdate(automation.Automation.DeviceRoleConfig request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState> responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpDelete(automation.Automation.DeviceRole request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState> responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void ztpDeleteAll(context.ContextOuterClass.Empty request, - io.grpc.stub.StreamObserver<automation.Automation.DeviceDeletionResult> responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - */ - public static final class AutomationServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<AutomationServiceBlockingStub> { - private AutomationServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AutomationServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceBlockingStub(channel, callOptions); - } - - /** - */ - public automation.Automation.DeviceRole ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpGetDeviceRoleMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleList ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleState ztpAdd(automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpAddMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleState ztpUpdate(automation.Automation.DeviceRoleConfig request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpUpdateMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceRoleState ztpDelete(automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpDeleteMethod(), getCallOptions(), request); - } - - /** - */ - public automation.Automation.DeviceDeletionResult ztpDeleteAll(context.ContextOuterClass.Empty request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getZtpDeleteAllMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class AutomationServiceFutureStub extends io.grpc.stub.AbstractFutureStub<AutomationServiceFutureStub> { - private AutomationServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AutomationServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AutomationServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture<automation.Automation.DeviceRole> ztpGetDeviceRole( - automation.Automation.DeviceRoleId request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId( - context.ContextOuterClass.DeviceId request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture<automation.Automation.DeviceRoleState> ztpAdd( - automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpAddMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture<automation.Automation.DeviceRoleState> ztpUpdate( - automation.Automation.DeviceRoleConfig request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture<automation.Automation.DeviceRoleState> ztpDelete( - automation.Automation.DeviceRole request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture<automation.Automation.DeviceDeletionResult> ztpDeleteAll( - context.ContextOuterClass.Empty request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_ZTP_GET_DEVICE_ROLE = 0; - private static final int METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID = 1; - private static final int METHODID_ZTP_ADD = 2; - private static final int METHODID_ZTP_UPDATE = 3; - private static final int METHODID_ZTP_DELETE = 4; - private static final int METHODID_ZTP_DELETE_ALL = 5; - - private static final class MethodHandlers<Req, Resp> implements - io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, - io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, - io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, - io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { - private final AutomationServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(AutomationServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { - switch (methodId) { - case METHODID_ZTP_GET_DEVICE_ROLE: - serviceImpl.ztpGetDeviceRole((automation.Automation.DeviceRoleId) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRole>) responseObserver); - break; - case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID: - serviceImpl.ztpGetDeviceRolesByDeviceId((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleList>) responseObserver); - break; - case METHODID_ZTP_ADD: - serviceImpl.ztpAdd((automation.Automation.DeviceRole) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver); - break; - case METHODID_ZTP_UPDATE: - serviceImpl.ztpUpdate((automation.Automation.DeviceRoleConfig) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver); - break; - case METHODID_ZTP_DELETE: - serviceImpl.ztpDelete((automation.Automation.DeviceRole) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver); - break; - case METHODID_ZTP_DELETE_ALL: - serviceImpl.ztpDeleteAll((context.ContextOuterClass.Empty) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceDeletionResult>) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver<Req> invoke( - io.grpc.stub.StreamObserver<Resp> responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class AutomationServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - AutomationServiceBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return automation.Automation.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("AutomationService"); - } - } - - private static final class AutomationServiceFileDescriptorSupplier - extends AutomationServiceBaseDescriptorSupplier { - AutomationServiceFileDescriptorSupplier() {} - } - - private static final class AutomationServiceMethodDescriptorSupplier - extends AutomationServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - AutomationServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (AutomationServiceGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new AutomationServiceFileDescriptorSupplier()) - .addMethod(getZtpGetDeviceRoleMethod()) - .addMethod(getZtpGetDeviceRolesByDeviceIdMethod()) - .addMethod(getZtpAddMethod()) - .addMethod(getZtpUpdateMethod()) - .addMethod(getZtpDeleteMethod()) - .addMethod(getZtpDeleteAllMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/src/common/Constants.py b/src/common/Constants.py index 423f2558b71b189b9e771e5af94968d28f8777c0..91d3116359ff53e10adba8f4e3d6e8bcc05c2abb 100644 --- a/src/common/Constants.py +++ b/src/common/Constants.py @@ -40,7 +40,7 @@ class ServiceNameEnum(Enum): DEVICE = 'device' SERVICE = 'service' SLICE = 'slice' - AUTOMATION = 'automation' + ZTP = 'ztp' POLICY = 'policy' MONITORING = 'monitoring' DLT = 'dlt' @@ -68,7 +68,7 @@ DEFAULT_SERVICE_GRPC_PORTS = { ServiceNameEnum.DEVICE .value : 2020, ServiceNameEnum.SERVICE .value : 3030, ServiceNameEnum.SLICE .value : 4040, - ServiceNameEnum.AUTOMATION .value : 5050, + ServiceNameEnum.ZTP .value : 5050, ServiceNameEnum.POLICY .value : 6060, ServiceNameEnum.MONITORING .value : 7070, ServiceNameEnum.DLT .value : 8080, diff --git a/src/common/tests/MockServicerImpl_Context.py b/src/common/tests/MockServicerImpl_Context.py index 667c9ed658cfbe648e345d691523375e1c5f8b79..e5d8ea76d25a81303df5a8e14073e1dcdc103ef0 100644 --- a/src/common/tests/MockServicerImpl_Context.py +++ b/src/common/tests/MockServicerImpl_Context.py @@ -263,7 +263,7 @@ class MockServicerImpl_Context(ContextServiceServicer): reply_device.CopyFrom(device) if exclude_endpoints: del reply_device.device_endpoints [:] # pylint: disable=no-member if exclude_config_rules: del reply_device.device_config.config_rules[:] # pylint: disable=no-member - if exclude_components: del reply_device.component[:] # pylint: disable=no-member + if exclude_components: del reply_device.components[:] # pylint: disable=no-member devices.append(reply_device) reply = DeviceList(devices=devices) diff --git a/src/common/type_checkers/Assertions.py b/src/common/type_checkers/Assertions.py index 25eb42fabf9c670256e9079a060aa38deb3c0f3d..42ea864f3c0c1150c3806f97e67ff3969542ab70 100644 --- a/src/common/type_checkers/Assertions.py +++ b/src/common/type_checkers/Assertions.py @@ -31,7 +31,7 @@ def validate_device_driver_enum(message): 'DEVICEDRIVER_TRANSPORT_API', 'DEVICEDRIVER_P4', 'DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', - 'DEVICEDRIVER_ONF_TR_352', + 'DEVICEDRIVER_ONF_TR_532', 'DEVICEDRIVER_XR', 'DEVICEDRIVER_IETF_L2VPN', 'DEVICEDRIVER_GNMI_OPENCONFIG', diff --git a/src/compute/Dockerfile b/src/compute/Dockerfile index 7a0c9bf6d81c261c76c63fe32abea47026209c9f..9717ea5f79d500246a337ea5f8f3c5bffa8b53c0 100644 --- a/src/compute/Dockerfile +++ b/src/compute/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur @@ -53,7 +53,7 @@ RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto RUN rm *.proto RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Create component sub-folder, get specific Python packages +# Create component sub-folders, get specific Python packages RUN mkdir -p /var/teraflow/compute WORKDIR /var/teraflow/compute COPY src/compute/requirements.in requirements.in diff --git a/src/compute/service/__main__.py b/src/compute/service/__main__.py index 6c744d0dcef67fef1d8ac719eaba9420b530fe58..a9f224e152429624b6b5ce1808f1960a089c08f4 100644 --- a/src/compute/service/__main__.py +++ b/src/compute/service/__main__.py @@ -21,6 +21,7 @@ from common.Settings import ( from .ComputeService import ComputeService from .rest_server.RestServer import RestServer from .rest_server.nbi_plugins.debug_api import register_debug_api +from .rest_server.nbi_plugins.etsi_bwm import register_etsi_bwm_api from .rest_server.nbi_plugins.ietf_l2vpn import register_ietf_l2vpn from .rest_server.nbi_plugins.ietf_network_slice import register_ietf_nss @@ -59,9 +60,10 @@ def main(): grpc_service.start() rest_server = RestServer() + register_debug_api(rest_server) + register_etsi_bwm_api(rest_server) register_ietf_l2vpn(rest_server) # Registering L2VPN entrypoint register_ietf_nss(rest_server) # Registering NSS entrypoint - register_debug_api(rest_server) rest_server.start() # Wait for Ctrl+C or termination signal diff --git a/src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py b/src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py index ffdbba88f077f6490261372f7048b2e2526d8196..5573b7b026b18715f31a91a052c1a5b15c97a5f0 100644 --- a/src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py +++ b/src/compute/service/rest_server/nbi_plugins/debug_api/Resources.py @@ -12,17 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flask_restful import Resource +from flask_restful import Resource, request from common.proto.context_pb2 import Empty from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient from .Tools import ( format_grpc_to_json, grpc_connection_id, grpc_context_id, grpc_device_id, grpc_link_id, grpc_policy_rule_id, - grpc_service_id, grpc_slice_id, grpc_topology_id) + grpc_service_id, grpc_service, grpc_slice_id, grpc_topology_id) class _Resource(Resource): def __init__(self) -> None: super().__init__() self.client = ContextClient() + self.service_client = ServiceClient() class ContextIds(_Resource): def get(self): @@ -60,6 +62,31 @@ class Service(_Resource): def get(self, context_uuid : str, service_uuid : str): return format_grpc_to_json(self.client.GetService(grpc_service_id(context_uuid, service_uuid))) + def post(self, context_uuid : str, service_uuid : str): + service = request.get_json()['services'][0] + return format_grpc_to_json(self.service_client.CreateService(grpc_service( + service_uuid = service['service_id']['service_uuid']['uuid'], + service_type = service['service_type'], + context_uuid = service['service_id']['context_id']['context_uuid']['uuid'], + ))) + + def put(self, context_uuid : str, service_uuid : str): + service = request.get_json()['services'][0] + return format_grpc_to_json(self.service_client.UpdateService(grpc_service( + service_uuid = service['service_id']['service_uuid']['uuid'], + service_type = service['service_type'], + context_uuid = service['service_id']['context_id']['context_uuid']['uuid'], + status = service['service_status']['service_status'], + endpoint_ids = service['service_endpoint_ids'], + constraints = service['service_constraints'], + config_rules = service['service_config']['config_rules'] + ))) + + def delete(self, context_uuid : str, service_uuid : str): + return format_grpc_to_json(self.service_client.DeleteService(grpc_service_id( + context_uuid, service_uuid, + ))) + class SliceIds(_Resource): def get(self, context_uuid : str): return format_grpc_to_json(self.client.ListSliceIds(grpc_context_id(context_uuid))) diff --git a/src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py b/src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py index f3dff545ba9812ff3f4e13c3da53774af7626014..fd5eb2316d44f4f13e6d8bedef7411beee80c46a 100644 --- a/src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py +++ b/src/compute/service/rest_server/nbi_plugins/debug_api/Tools.py @@ -13,15 +13,20 @@ # limitations under the License. from flask.json import jsonify -from common.proto.context_pb2 import ConnectionId, ContextId, DeviceId, LinkId, ServiceId, SliceId, TopologyId +from common.proto.context_pb2 import ( + ConnectionId, ContextId, DeviceId, LinkId, ServiceId, SliceId, TopologyId, Service, ServiceStatusEnum +) from common.proto.policy_pb2 import PolicyRuleId from common.tools.grpc.Tools import grpc_message_to_json from common.tools.object_factory.Connection import json_connection_id from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.ConfigRule import json_config_rule +from common.tools.object_factory.Constraint import json_constraint_custom +from common.tools.object_factory.EndPoint import json_endpoint_id from common.tools.object_factory.Device import json_device_id from common.tools.object_factory.Link import json_link_id from common.tools.object_factory.PolicyRule import json_policyrule_id -from common.tools.object_factory.Service import json_service_id +from common.tools.object_factory.Service import json_service_id, json_service from common.tools.object_factory.Slice import json_slice_id from common.tools.object_factory.Topology import json_topology_id @@ -44,6 +49,37 @@ def grpc_link_id(link_uuid): def grpc_service_id(context_uuid, service_uuid): return ServiceId(**json_service_id(service_uuid, context_id=json_context_id(context_uuid))) +def grpc_service( + service_uuid, service_type, context_uuid, status=None, endpoint_ids=None, constraints=None, config_rules=None +): + json_context = json_context_id(context_uuid) + json_status = status if status else ServiceStatusEnum.SERVICESTATUS_PLANNED + json_endpoints_ids = [ + json_endpoint_id( + json_device_id(endpoint_id['device_id']['device_uuid']['uuid']), + endpoint_id['endpoint_uuid']['uuid'] + ) + for endpoint_id in endpoint_ids + ] if endpoint_ids else [] + json_constraints = [ + json_constraint_custom( + constraint['custom']['constraint_type'], + constraint['custom']['constraint_value'] + ) + for constraint in constraints + ] if constraints else [] + json_config_rules = [ + json_config_rule( + config_rule['action'], + config_rule['custom']['resource_key'], + config_rule['custom']['resource_value'] + ) + for config_rule in config_rules + ] if config_rules else [] + return Service(**json_service( + service_uuid, service_type, json_context, json_status, + json_endpoints_ids, json_constraints, json_config_rules)) + def grpc_slice_id(context_uuid, slice_uuid): return SliceId(**json_slice_id(slice_uuid, context_id=json_context_id(context_uuid))) diff --git a/src/compute/service/rest_server/nbi_plugins/etsi_bwm/Resources.py b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/Resources.py new file mode 100644 index 0000000000000000000000000000000000000000..38534b754d6c1ac502b21af55375c63159c57745 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/Resources.py @@ -0,0 +1,75 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy +from common.Constants import DEFAULT_CONTEXT_NAME +from flask_restful import Resource, request +from context.client.ContextClient import ContextClient +from service.client.ServiceClient import ServiceClient +from .Tools import ( + format_grpc_to_json, grpc_context_id, grpc_service_id, bwInfo_2_service, service_2_bwInfo) + + + +class _Resource(Resource): + def __init__(self) -> None: + super().__init__() + self.client = ContextClient() + self.service_client = ServiceClient() + + +class BwInfo(_Resource): + def get(self): + service_list = self.client.ListServices(grpc_context_id(DEFAULT_CONTEXT_NAME)) + bw_allocations = [service_2_bwInfo(service) for service in service_list.services] + return bw_allocations + + def post(self): + bwinfo = request.get_json() + service = bwInfo_2_service(self.client, bwinfo) + stripped_service = copy.deepcopy(service) + + stripped_service.ClearField('service_endpoint_ids') + stripped_service.ClearField('service_constraints') + stripped_service.ClearField('service_config') + + response = format_grpc_to_json(self.service_client.CreateService(stripped_service)) + response = format_grpc_to_json(self.service_client.UpdateService(service)) + + return response + + +class BwInfoId(_Resource): + + def get(self, allocationId: str): + service = self.client.GetService(grpc_service_id(DEFAULT_CONTEXT_NAME, allocationId)) + return service_2_bwInfo(service) + + def put(self, allocationId: str): + json_data = request.get_json() + service = bwInfo_2_service(self.client, json_data) + response = self.service_client.UpdateService(service) + return format_grpc_to_json(response) + + def patch(self, allocationId: str): + json_data = request.get_json() + if not 'appInsId' in json_data: + json_data['appInsId'] = allocationId + service = bwInfo_2_service(self.client, json_data) + response = self.service_client.UpdateService(service) + return format_grpc_to_json(response) + + def delete(self, allocationId: str): + self.service_client.DeleteService(grpc_service_id(DEFAULT_CONTEXT_NAME, allocationId)) + return diff --git a/src/compute/service/rest_server/nbi_plugins/etsi_bwm/Tools.py b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..023d1006cd807ffeeed40d2e1e7273a580431073 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/Tools.py @@ -0,0 +1,114 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import logging +import time +from flask.json import jsonify +from common.proto.context_pb2 import ContextId, Empty, EndPointId, ServiceId, ServiceTypeEnum, Service, Constraint, Constraint_SLA_Capacity, ConfigRule, ConfigRule_Custom, ConfigActionEnum +from common.tools.grpc.Tools import grpc_message_to_json +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Service import json_service_id + +LOGGER = logging.getLogger(__name__) + + +def service_2_bwInfo(service: Service) -> dict: + response = {} + # allocationDirection = '??' # String: 00 = Downlink (towards the UE); 01 = Uplink (towards the application/session); 10 = Symmetrical + response['appInsId'] = service.service_id.context_id.context_uuid.uuid # String: Application instance identifier + for constraint in service.service_constraints: + if constraint.WhichOneof('constraint') == 'sla_capacity': + response['fixedAllocation'] = str(constraint.sla_capacity.capacity_gbps*1000) # String: Size of requested fixed BW allocation in [bps] + break + + + for config_rule in service.service_config.config_rules: + for key in ['allocationDirection', 'fixedBWPriority', 'requestType', 'sourceIp', 'sourcePort', 'dstPort', 'protocol', 'sessionFilter']: + if config_rule.custom.resource_key == key: + if key != 'sessionFilter': + response[key] = config_rule.custom.resource_value + else: + response[key] = json.loads(config_rule.custom.resource_value) + + + unixtime = time.time() + response['timeStamp'] = { # Time stamp to indicate when the corresponding information elements are sent + "seconds": int(unixtime), + "nanoseconds": int(unixtime%1*1e9) + } + + return response + +def bwInfo_2_service(client, bwInfo: dict) -> Service: + service = Service() + + for key in ['allocationDirection', 'fixedBWPriority', 'requestType', 'timeStamp', 'sessionFilter']: + if key not in bwInfo: + continue + config_rule = ConfigRule() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule_custom = ConfigRule_Custom() + config_rule_custom.resource_key = key + if key != 'sessionFilter': + config_rule_custom.resource_value = str(bwInfo[key]) + else: + config_rule_custom.resource_value = json.dumps(bwInfo[key]) + config_rule.custom.CopyFrom(config_rule_custom) + service.service_config.config_rules.append(config_rule) + + if 'sessionFilter' in bwInfo: + a_ip = bwInfo['sessionFilter'][0]['sourceIp'] + z_ip = bwInfo['sessionFilter'][0]['dstAddress'] + + devices = client.ListDevices(Empty()).devices + for device in devices: + for cr in device.device_config.config_rules: + if cr.WhichOneof('config_rule') == 'custom' and cr.custom.resource_key == '_connect/settings': + for ep in json.loads(cr.custom.resource_value)['endpoints']: + if 'ip' in ep and (ep['ip'] == a_ip or ep['ip'] == z_ip): + ep_id = EndPointId() + ep_id.endpoint_uuid.uuid = ep['uuid'] + ep_id.device_id.device_uuid.uuid = device.device_id.device_uuid.uuid + service.service_endpoint_ids.append(ep_id) + + if len(service.service_endpoint_ids) < 2: + LOGGER.error('No endpoints matched') + return None + + service.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + + if 'appInsId' in bwInfo: + service.service_id.service_uuid.uuid = bwInfo['appInsId'] + service.service_id.context_id.context_uuid.uuid = 'admin' + service.name = bwInfo['appInsId'] + + if 'fixedAllocation' in bwInfo: + capacity = Constraint_SLA_Capacity() + capacity.capacity_gbps = float(bwInfo['fixedAllocation']) + constraint = Constraint() + constraint.sla_capacity.CopyFrom(capacity) + service.service_constraints.append(constraint) + + return service + + +def format_grpc_to_json(grpc_reply): + return jsonify(grpc_message_to_json(grpc_reply)) + +def grpc_context_id(context_uuid): + return ContextId(**json_context_id(context_uuid)) + +def grpc_service_id(context_uuid, service_uuid): + return ServiceId(**json_service_id(service_uuid, context_id=json_context_id(context_uuid))) diff --git a/src/compute/service/rest_server/nbi_plugins/etsi_bwm/__init__.py b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b81a4057a91891bc86bacd34d157a1a61e14934 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/__init__.py @@ -0,0 +1,29 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from compute.service.rest_server.RestServer import RestServer +from .Resources import BwInfo, BwInfoId + +URL_PREFIX = '/bwm/v1' + +# Use 'path' type since some identifiers might contain char '/' and Flask is unable to recognize them in 'string' type. +RESOURCES = [ + # (endpoint_name, resource_class, resource_url) + ('api.bw_info', BwInfo, '/bw_allocations'), + ('api.bw_info_id', BwInfoId, '/bw_allocations/<path:allocationId>'), +] + +def register_etsi_bwm_api(rest_server : RestServer): + for endpoint_name, resource_class, resource_url in RESOURCES: + rest_server.add_resource(resource_class, URL_PREFIX + resource_url, endpoint=endpoint_name) diff --git a/src/compute/service/rest_server/nbi_plugins/etsi_bwm/tests_etsi_bwm.txt b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/tests_etsi_bwm.txt new file mode 100644 index 0000000000000000000000000000000000000000..9cfbe5625de45a044e68a8af8ec8f440423da966 --- /dev/null +++ b/src/compute/service/rest_server/nbi_plugins/etsi_bwm/tests_etsi_bwm.txt @@ -0,0 +1,81 @@ +-----------------------GET----------------------- + +curl --request GET \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations + + +-----------------------POST----------------------- +curl --request POST \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations \ + --header 'Content-Type: application/json' \ + --data '{ + "allocationDirection": "string", + "appInsId": "service_uuid", + "fixedAllocation": "123", + "fixedBWPriority": "SEE_DESCRIPTION", + "requestType": 0, + "sessionFilter": [ + { + "dstAddress": "192.168.3.2", + "dstPort": [ + "b" + ], + "protocol": "string", + "sourceIp": "192.168.1.2", + "sourcePort": [ + "a" + ] + } + ], + "timeStamp": { + "nanoSeconds": 1, + "seconds": 1 + } +}' + + +-----------------------GET2----------------------- +curl --request GET \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid + +-----------------------PUT----------------------- + curl --request PUT \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid \ + --header 'Content-Type: application/json' \ + --data '{ + "allocationDirection": "string", + "appInsId": "service_uuid", + "fixedAllocation": "123", + "fixedBWPriority": "efefe", + "requestType": 0, + "sessionFilter": [ + { + "dstAddress": "192.168.3.2", + "dstPort": [ + "b" + ], + "protocol": "string", + "sourceIp": "192.168.1.2", + "sourcePort": [ + "a" + ] + } + ], + "timeStamp": { + "nanoSeconds": 1, + "seconds": 1 + } +}' + +-----------------------PATCH----------------------- +curl --request PATCH \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid \ + --header 'Content-Type: application/json' \ + --data '{ + "fixedBWPriority": "uuuuuuuuuuuuuu" +}' + + +-----------------------DELETE----------------------- +curl --request DELETE \ + --url http://10.1.7.203:80/restconf/bwm/v1/bw_allocations/service_uuid \ No newline at end of file diff --git a/src/context/Dockerfile b/src/context/Dockerfile index d6fa045c2afab7275dff9f34f6ab31f0ef84563b..18a7fbc54788d70724716b3f0b5b532de3e7054b 100644 --- a/src/context/Dockerfile +++ b/src/context/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur @@ -53,7 +53,7 @@ RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto RUN rm *.proto RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Create component sub-folder, get specific Python packages +# Create component sub-folders, get specific Python packages RUN mkdir -p /var/teraflow/context WORKDIR /var/teraflow/context COPY src/context/requirements.in requirements.in diff --git a/src/context/service/database/Component.py b/src/context/service/database/Component.py new file mode 100644 index 0000000000000000000000000000000000000000..ae873855b1c01c80c101eb4e97e3bf7688619fae --- /dev/null +++ b/src/context/service/database/Component.py @@ -0,0 +1,69 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import datetime, json, logging +from sqlalchemy import delete +from sqlalchemy.dialects.postgresql import insert +from sqlalchemy.orm import Session +from typing import Dict, List, Optional, Set +from common.proto.context_pb2 import Component +from common.proto.context_pb2 import ConfigRule +from common.tools.grpc.Tools import grpc_message_to_json_string +from .models.ComponentModel import ComponentModel +from .uuids._Builder import get_uuid_from_string +from .uuids.EndPoint import endpoint_get_uuid +from sqlalchemy.engine import Engine +from sqlalchemy.orm import Session, selectinload, sessionmaker +from sqlalchemy_cockroachdb import run_transaction +from .models.ComponentModel import ComponentModel + +LOGGER = logging.getLogger(__name__) + +def compose_components_data( + components : List[Component], now : datetime.datetime, + device_uuid : Optional[str] = None, service_uuid : Optional[str] = None, slice_uuid : Optional[str] = None +) -> List[Dict]: + dict_components : List[Dict] = list() + for position,component in enumerate(components): + str_kind = component.WhichOneof('config_rule') + message = (grpc_message_to_json_string(getattr(component, str_kind, {}))) + data = json.loads(message) + resource_key = data["resource_key"] + resource_value = data["resource_value"] + if '/inventory' in resource_key: + resource_value_data = json.loads(resource_value) + name = resource_value_data.pop('name', None) + type_ = resource_value_data.pop('class', None) + parent = resource_value_data.pop('parent-component-references', None) + attributes = resource_value_data.pop('attributes', {}) + if len(resource_value_data) > 0: + LOGGER.warning('Discarding Component Leftovers: {:s}'.format(str(resource_value_data))) + + attributes = { + attr_name:json.dumps(attr_value) + for attr_name,attr_value in attributes.items() + } + component_uuid = get_uuid_from_string(component.custom.resource_key, prefix_for_name=device_uuid) + dict_component = { + 'component_uuid': component_uuid, + 'device_uuid' : device_uuid, + 'name' : name, + 'type' : type_, + 'attributes' : json.dumps(attributes), + 'parent' : parent, + 'created_at' : now, + 'updated_at' : now, + } + dict_components.append(dict_component) + return dict_components diff --git a/src/context/service/database/Device.py b/src/context/service/database/Device.py index df57791adf7faf04cb24c372d82ce547f35b9c72..3aff20ade14532dcb7fbf8ec1033c084aaeead3c 100644 --- a/src/context/service/database/Device.py +++ b/src/context/service/database/Device.py @@ -27,6 +27,7 @@ from common.tools.object_factory.Device import json_device_id from context.service.database.uuids.Topology import topology_get_uuid from .models.DeviceModel import DeviceModel from .models.EndPointModel import EndPointModel +from .models.ComponentModel import ComponentModel from .models.TopologyModel import TopologyDeviceModel, TopologyModel from .models.enums.DeviceDriver import grpc_to_enum__device_driver from .models.enums.DeviceOperationalStatus import grpc_to_enum__device_operational_status @@ -34,6 +35,7 @@ from .models.enums.KpiSampleType import grpc_to_enum__kpi_sample_type from .uuids.Device import device_get_uuid from .uuids.EndPoint import endpoint_get_uuid from .ConfigRule import compose_config_rules_data, upsert_config_rules +from .Component import compose_components_data from .Events import notify_event_context, notify_event_device, notify_event_topology LOGGER = logging.getLogger(__name__) @@ -50,8 +52,8 @@ def device_list_objs(db_engine : Engine) -> DeviceList: obj_list : List[DeviceModel] = session.query(DeviceModel)\ .options(selectinload(DeviceModel.endpoints))\ .options(selectinload(DeviceModel.config_rules))\ + .options(selectinload(DeviceModel.components))\ .all() - #.options(selectinload(DeviceModel.components))\ return [obj.dump() for obj in obj_list] devices = run_transaction(sessionmaker(bind=db_engine), callback) return DeviceList(devices=devices) @@ -62,8 +64,8 @@ def device_get(db_engine : Engine, request : DeviceId) -> Device: obj : Optional[DeviceModel] = session.query(DeviceModel)\ .options(selectinload(DeviceModel.endpoints))\ .options(selectinload(DeviceModel.config_rules))\ + .options(selectinload(DeviceModel.components))\ .filter_by(device_uuid=device_uuid).one_or_none() - #.options(selectinload(DeviceModel.components))\ return None if obj is None else obj.dump() obj = run_transaction(sessionmaker(bind=db_engine), callback) if obj is None: @@ -138,7 +140,8 @@ def device_set(db_engine : Engine, messagebroker : MessageBroker, request : Devi }) topology_uuids.add(endpoint_topology_uuid) - config_rules = compose_config_rules_data(request.device_config.config_rules, now, device_uuid=device_uuid) + components_data = compose_components_data(request.device_config.config_rules, now, device_uuid=device_uuid) + config_rules = compose_config_rules_data(request.device_config.config_rules, now, device_uuid=device_uuid) device_data = [{ 'device_uuid' : device_uuid, @@ -206,6 +209,24 @@ def device_set(db_engine : Engine, messagebroker : MessageBroker, request : Devi device_topology_ids = [obj.dump_id() for obj in device_topologies] LOGGER.warning('device_topology_ids={:s}'.format(str(device_topology_ids))) + updated_components = False + + if len(components_data) > 0: + stmt = insert(ComponentModel).values(components_data) + stmt = stmt.on_conflict_do_update( + index_elements=[ComponentModel.component_uuid], + set_=dict( + name = stmt.excluded.name, + type = stmt.excluded.type, + attributes = stmt.excluded.attributes, + parent = stmt.excluded.parent, + updated_at = stmt.excluded.updated_at, + ) + ) + stmt = stmt.returning(ComponentModel.created_at, ComponentModel.updated_at) + component_updates = session.execute(stmt).fetchall() + updated_components = any([(updated_at > created_at) for created_at,updated_at in component_updates]) + changed_config_rules = upsert_config_rules(session, config_rules, device_uuid=device_uuid) return updated or updated_endpoints or changed_config_rules, device_topology_ids diff --git a/src/context/service/database/models/ComponentModel.py b/src/context/service/database/models/ComponentModel.py new file mode 100644 index 0000000000000000000000000000000000000000..c9acfaeabe95c55fc464732d54459d99f9b5b054 --- /dev/null +++ b/src/context/service/database/models/ComponentModel.py @@ -0,0 +1,55 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +from sqlalchemy import Column, DateTime, ForeignKey, String +from sqlalchemy.dialects.postgresql import UUID +from sqlalchemy.orm import relationship +from typing import Dict +from ._Base import _Base + +class ComponentModel(_Base): + __tablename__ = 'device_component' + + component_uuid = Column(UUID(as_uuid=False), primary_key=True) + device_uuid = Column(ForeignKey('device.device_uuid',ondelete='CASCADE' ), nullable=False, index=True) + name = Column(String, nullable=False) + type = Column(String, nullable=False) + attributes = Column(String, nullable=False) + parent = Column(String, nullable=False) + created_at = Column(DateTime, nullable=False) + updated_at = Column(DateTime, nullable=False) + + device = relationship('DeviceModel', back_populates='components') + def dump_id(self) -> Dict: + return{ + 'device_id' : self.device.dump_id(), + 'component_uuid': {'uuid': self.component_uuid}, + } + + def dump(self) -> Dict: + data = dict() + data['attributes'] = json.loads(self.attributes) + data['component_uuid'] = {'uuid': self.component_uuid} + data['name'] = self.name + data['type'] = self.type + data['parent'] = self.parent + return data + + def dump_name(self) -> Dict: + return { + 'component_id' : self.dump_id(), + 'device_name' : self.device.device_name, + 'component_name': self.name, + } diff --git a/src/context/service/database/models/DeviceModel.py b/src/context/service/database/models/DeviceModel.py index 1097d0b9ab47a86c47ce2ad8394d067ae9f9953e..376dc98c4053f68c511a8c717117d58d9eda1cca 100644 --- a/src/context/service/database/models/DeviceModel.py +++ b/src/context/service/database/models/DeviceModel.py @@ -36,6 +36,7 @@ class DeviceModel(_Base): #topology_devices = relationship('TopologyDeviceModel', back_populates='device') config_rules = relationship('DeviceConfigRuleModel', passive_deletes=True) # lazy='joined', back_populates='device' endpoints = relationship('EndPointModel', passive_deletes=True) # lazy='joined', back_populates='device' + components = relationship('ComponentModel', passive_deletes=True) # lazy='joined', back_populates='device' controller = relationship('DeviceModel', remote_side=[device_uuid], passive_deletes=True) # lazy='joined', back_populates='device' def dump_id(self) -> Dict: @@ -55,7 +56,7 @@ class DeviceModel(_Base): ]} def dump_components(self) -> List[Dict]: - return [] + return [component.dump() for component in self.components] def dump(self, include_endpoints : bool = True, include_config_rules : bool = True, include_components : bool = True, @@ -70,5 +71,5 @@ class DeviceModel(_Base): } if include_endpoints: result['device_endpoints'] = self.dump_endpoints() if include_config_rules: result['device_config'] = self.dump_config_rules() - if include_components: result['component'] = self.dump_components() + if include_components: result['components'] = self.dump_components() return result diff --git a/src/context/service/database/models/_Base.py b/src/context/service/database/models/_Base.py index b87b9b06d6adc5825ab5dd84cf64347eb9c26f66..52eb6b088210b8edc8d121221458ae11ece484a5 100644 --- a/src/context/service/database/models/_Base.py +++ b/src/context/service/database/models/_Base.py @@ -60,6 +60,9 @@ def create_performance_enhancers(db_engine : sqlalchemy.engine.Engine) -> None: index_storing('topology_context_uuid_rec_idx', 'topology', ['context_uuid'], [ 'topology_name', 'created_at', 'updated_at' ]), + index_storing('device_component_idx', 'device_component', ['device_uuid'], [ + 'name', 'type', 'attributes', 'created_at', 'updated_at' + ]), ] def callback(session : Session) -> bool: for stmt in statements: session.execute(stmt) diff --git a/src/context/service/database/models/enums/ConfigAction.py b/src/context/service/database/models/enums/ConfigAction.py index 5d7aa6b44ecb58f769a1c70a5cabdda98ba51bca..526024a1fedf3331ca45e3cb517ff9d58ce28c25 100644 --- a/src/context/service/database/models/enums/ConfigAction.py +++ b/src/context/service/database/models/enums/ConfigAction.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ConfigActionEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ConfigActionEnum should be named +# as in the proto files removing the prefixes. For example, +# proto item ConfigActionEnum.CONFIGACTION_SET should be +# included as SET. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_ConfigActionEnum(enum.Enum): UNDEFINED = ConfigActionEnum.CONFIGACTION_UNDEFINED SET = ConfigActionEnum.CONFIGACTION_SET diff --git a/src/context/service/database/models/enums/ConstraintAction.py b/src/context/service/database/models/enums/ConstraintAction.py index 65533b6f579ffe153b046dfcb39d37758f4c0577..2a53b8e1c5e97e48cbda9648c8473313bce6f4cd 100644 --- a/src/context/service/database/models/enums/ConstraintAction.py +++ b/src/context/service/database/models/enums/ConstraintAction.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ConstraintActionEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ConstraintActionEnum should be named +# as in the proto files removing the prefixes. For example, proto +# item ConstraintActionEnum.CONFIGACTION_SET should be included +# as SET. If item name does not match, automatic mapping of proto +# enums to database enums will fail. class ORM_ConstraintActionEnum(enum.Enum): UNDEFINED = ConstraintActionEnum.CONSTRAINTACTION_UNDEFINED SET = ConstraintActionEnum.CONSTRAINTACTION_SET diff --git a/src/context/service/database/models/enums/DeviceDriver.py b/src/context/service/database/models/enums/DeviceDriver.py index 09be94b1d7ec041f2d3f50f832f15017fb62e63c..66635decc5369c8b7601863da85f497626d70ac8 100644 --- a/src/context/service/database/models/enums/DeviceDriver.py +++ b/src/context/service/database/models/enums/DeviceDriver.py @@ -16,13 +16,18 @@ import enum, functools from common.proto.context_pb2 import DeviceDriverEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_DeviceDriverEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG should be included as +# OPENCONFIG. If item name does not match, automatic mapping of +# proto enums to database enums will fail. class ORM_DeviceDriverEnum(enum.Enum): UNDEFINED = DeviceDriverEnum.DEVICEDRIVER_UNDEFINED OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG TRANSPORT_API = DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API P4 = DeviceDriverEnum.DEVICEDRIVER_P4 IETF_NETWORK_TOPOLOGY = DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY - ONF_TR_352 = DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352 + ONF_TR_532 = DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532 XR = DeviceDriverEnum.DEVICEDRIVER_XR IETF_L2VPN = DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN GNMI_OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG diff --git a/src/context/service/database/models/enums/DeviceOperationalStatus.py b/src/context/service/database/models/enums/DeviceOperationalStatus.py index a121fab86408493bf0b211f4fcc8423aafa969cf..9e98869dce025e51c20ff0aca0dcd78a9ab57fe1 100644 --- a/src/context/service/database/models/enums/DeviceOperationalStatus.py +++ b/src/context/service/database/models/enums/DeviceOperationalStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import DeviceOperationalStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_DeviceOperationalStatusEnum should be +# named as in the proto files removing the prefixes. For example, +# proto item DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED +# should be declared as ENABLED. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_DeviceOperationalStatusEnum(enum.Enum): UNDEFINED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED diff --git a/src/context/service/database/models/enums/KpiSampleType.py b/src/context/service/database/models/enums/KpiSampleType.py index 3bf5d06f047016af7167d0d59a315ac465abfd19..5cef9ac199a0cc3389092e4ea375940e27554066 100644 --- a/src/context/service/database/models/enums/KpiSampleType.py +++ b/src/context/service/database/models/enums/KpiSampleType.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.kpi_sample_types_pb2 import KpiSampleType from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_KpiSampleTypeEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED should be declared as +# BYTES_RECEIVED. If item name does not match, automatic mapping of +# proto enums to database enums will fail. class ORM_KpiSampleTypeEnum(enum.Enum): UNKNOWN = KpiSampleType.KPISAMPLETYPE_UNKNOWN PACKETS_TRANSMITTED = KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED diff --git a/src/context/service/database/models/enums/PolicyRuleState.py b/src/context/service/database/models/enums/PolicyRuleState.py index c4aa950a11605682f1c78e544767ea7e0a7b24b4..e16ee01e36b5e2ec2ad8e07f7cb6201ee091e76f 100644 --- a/src/context/service/database/models/enums/PolicyRuleState.py +++ b/src/context/service/database/models/enums/PolicyRuleState.py @@ -16,6 +16,13 @@ import enum, functools from common.proto.policy_pb2 import PolicyRuleStateEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_PolicyRuleStateEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# PolicyRuleStateEnum.POLICY_INSERTED should be declared as INSERTED. +# In this case, since the entries in the proto enum have a different prefix +# than that specified in class ORM_PolicyRuleStateEnum, we force the prefix +# using argument grpc_enum_prefix. If item name does not match, automatic +# mapping of proto enums to database enums will fail. class ORM_PolicyRuleStateEnum(enum.Enum): UNDEFINED = PolicyRuleStateEnum.POLICY_UNDEFINED # Undefined rule state FAILED = PolicyRuleStateEnum.POLICY_FAILED # Rule failed diff --git a/src/context/service/database/models/enums/ServiceStatus.py b/src/context/service/database/models/enums/ServiceStatus.py index cd2a183b825eff54a51a844ea6834263bbabbc31..ae0ad55bcfe327b981881bcd304124c9bb6576ab 100644 --- a/src/context/service/database/models/enums/ServiceStatus.py +++ b/src/context/service/database/models/enums/ServiceStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ServiceStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ServiceStatusEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# ServiceStatusEnum.SERVICESTATUS_PLANNED should be declared as PLANNED. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_ServiceStatusEnum(enum.Enum): UNDEFINED = ServiceStatusEnum.SERVICESTATUS_UNDEFINED PLANNED = ServiceStatusEnum.SERVICESTATUS_PLANNED diff --git a/src/context/service/database/models/enums/ServiceType.py b/src/context/service/database/models/enums/ServiceType.py index 3937eaa114429ce9d004933a5d5baf1ae6137513..0ed1938a7ca1e566bea815d9ce936150bb91d9dc 100644 --- a/src/context/service/database/models/enums/ServiceType.py +++ b/src/context/service/database/models/enums/ServiceType.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import ServiceTypeEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_ServiceTypeEnum should be named as in +# the proto files removing the prefixes. For example, proto item +# ConfigActionEnum.CONFIGACTION_SET should be declared as SET. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_ServiceTypeEnum(enum.Enum): UNKNOWN = ServiceTypeEnum.SERVICETYPE_UNKNOWN L3NM = ServiceTypeEnum.SERVICETYPE_L3NM diff --git a/src/context/service/database/models/enums/SliceStatus.py b/src/context/service/database/models/enums/SliceStatus.py index 5d77578b4cb4ee155981ede4395b1cafc3be4ef7..32ef0cc4a3d65aa96346b038534ca65bc3e4f95c 100644 --- a/src/context/service/database/models/enums/SliceStatus.py +++ b/src/context/service/database/models/enums/SliceStatus.py @@ -16,6 +16,11 @@ import enum, functools from common.proto.context_pb2 import SliceStatusEnum from ._GrpcToEnum import grpc_to_enum +# IMPORTANT: Entries of enum class ORM_SliceStatusEnum should be named as in +# the proto file but removing the prefixes. For example, proto item +# SliceStatusEnum.SLICESTATUS_PLANNED should be declared as PLANNED. +# If item name does not match, automatic mapping of proto enums to +# database enums will fail. class ORM_SliceStatusEnum(enum.Enum): UNDEFINED = SliceStatusEnum.SLICESTATUS_UNDEFINED PLANNED = SliceStatusEnum.SLICESTATUS_PLANNED diff --git a/src/dbscanserving/Dockerfile b/src/dbscanserving/Dockerfile index 81e3fb28a059faf92f793aa5bd76d1a744e65d9b..2f3f62d6b41e145a419fde54ef37aed47561da50 100644 --- a/src/dbscanserving/Dockerfile +++ b/src/dbscanserving/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/device/service/DeviceServiceServicerImpl.py b/src/device/service/DeviceServiceServicerImpl.py index d29d469cb0812218030698284abbfc7551058411..eeffdd7b0592b5166c06c1597e17f79adcfd25bb 100644 --- a/src/device/service/DeviceServiceServicerImpl.py +++ b/src/device/service/DeviceServiceServicerImpl.py @@ -123,13 +123,13 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): t9 = time.time() - automation_service_host = get_env_var_name(ServiceNameEnum.AUTOMATION, ENVVAR_SUFIX_SERVICE_HOST) + ztp_service_host = get_env_var_name(ServiceNameEnum.ZTP, ENVVAR_SUFIX_SERVICE_HOST) environment_variables = set(os.environ.keys()) - if automation_service_host in environment_variables: - # Automation component is deployed; leave devices disabled. Automation will enable them. + if ztp_service_host in environment_variables: + # ZTP component is deployed; leave devices disabled. ZTP will enable them. device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED else: - # Automation is not deployed; assume the device is ready while onboarding and set them as enabled. + # ZTP is not deployed; assume the device is ready while onboarding and set them as enabled. device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED device_id = context_client.SetDevice(device) diff --git a/src/device/service/driver_api/_Driver.py b/src/device/service/driver_api/_Driver.py index 7adaec79dc99f9b7c836acaec886b0d5bda97fb8..0aa1a6c5a8697d4c75f7044981221c6dd47e3aff 100644 --- a/src/device/service/driver_api/_Driver.py +++ b/src/device/service/driver_api/_Driver.py @@ -24,6 +24,7 @@ RESOURCE_NETWORK_INSTANCES = '__network_instances__' RESOURCE_ROUTING_POLICIES = '__routing_policies__' RESOURCE_SERVICES = '__services__' RESOURCE_ACL = '__acl__' +RESOURCE_INVENTORY = '__inventory__' class _Driver: diff --git a/src/device/service/drivers/__init__.py b/src/device/service/drivers/__init__.py index 4ae7128b0258536dae5fbed2ae86457d4f9f969f..0d85e8ff9668c5715dfc9d830027a5ae1faed9b5 100644 --- a/src/device/service/drivers/__init__.py +++ b/src/device/service/drivers/__init__.py @@ -69,7 +69,7 @@ DRIVERS.append( # DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API, # DeviceDriverEnum.DEVICEDRIVER_P4, # DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, - # DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352, + # DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532, # DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG, # ], #} diff --git a/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py b/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py index 19adc31c30e27f141c7c4dac50b1dcc4c047b1cf..2d3901695abc4c0124a7f443ffa59f825d4e13bf 100644 --- a/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py +++ b/src/device/service/drivers/ietf_l2vpn/TfsDebugApiClient.py @@ -40,7 +40,7 @@ MAPPING_DRIVER = { 'DEVICEDRIVER_TRANSPORT_API' : 2, 'DEVICEDRIVER_P4' : 3, 'DEVICEDRIVER_IETF_NETWORK_TOPOLOGY': 4, - 'DEVICEDRIVER_ONF_TR_352' : 5, + 'DEVICEDRIVER_ONF_TR_532' : 5, 'DEVICEDRIVER_XR' : 6, 'DEVICEDRIVER_IETF_L2VPN' : 7, 'DEVICEDRIVER_GNMI_OPENCONFIG' : 8, diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index b34efbc8fbcc8e4a340e8c2282268b9f0246fddc..8c6e07b3f00a975a909161006e59e89de0ceaaf3 100644 --- a/src/device/service/drivers/openconfig/OpenConfigDriver.py +++ b/src/device/service/drivers/openconfig/OpenConfigDriver.py @@ -109,7 +109,10 @@ class NetconfSessionHandler: @RETRY_DECORATOR def get(self, filter=None, with_defaults=None): # pylint: disable=redefined-builtin with self.__lock: - return self.__manager.get(filter=filter, with_defaults=with_defaults) + if self.__vendor == 'JUNIPER'and not 'component' in str(filter): + return self.__manager.get_config(source="running", filter=filter, with_defaults=with_defaults) + else: + return self.__manager.get(filter=filter, with_defaults=with_defaults) @RETRY_DECORATOR def edit_config( diff --git a/src/device/service/drivers/openconfig/templates/Interfaces.py b/src/device/service/drivers/openconfig/templates/Interfaces.py index 3855db17b45505d4131089b2b9abd995fa221419..3d4c73fc11c686b4d4e181a1f98ed3f5922f7c15 100644 --- a/src/device/service/drivers/openconfig/templates/Interfaces.py +++ b/src/device/service/drivers/openconfig/templates/Interfaces.py @@ -22,6 +22,7 @@ LOGGER = logging.getLogger(__name__) XPATH_INTERFACES = "//oci:interfaces/oci:interface" XPATH_SUBINTERFACES = ".//oci:subinterfaces/oci:subinterface" XPATH_IPV4ADDRESSES = ".//ociip:ipv4/ociip:addresses/ociip:address" +XPATH_IPV6ADDRESSES = ".//ociip:ipv6/ociip:addresses/ociip:address" def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: response = [] @@ -97,6 +98,15 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: #add_value_from_collection(subinterface, 'ipv4_addresses', ipv4_addresses) + for xml_ipv6_address in xml_subinterface.xpath(XPATH_IPV6ADDRESSES, namespaces=NAMESPACES): + #LOGGER.info('xml_ipv6_address = {:s}'.format(str(ET.tostring(xml_ipv6_address)))) + + address = xml_ipv6_address.find('ociip:state/ociip:ip', namespaces=NAMESPACES) + add_value_from_tag(subinterface, 'address_ipv6', address) + + prefix = xml_ipv6_address.find('ociip:state/ociip:prefix-length', namespaces=NAMESPACES) + add_value_from_tag(subinterface, 'address_prefix_v6', prefix, cast=int) + if len(subinterface) == 0: continue resource_key = '/interface[{:s}]/subinterface[{:s}]'.format(interface['name'], str(subinterface['index'])) response.append((resource_key, subinterface)) diff --git a/src/device/service/drivers/openconfig/templates/Inventory.py b/src/device/service/drivers/openconfig/templates/Inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae67ba47dad162b8c8e4a15d3004b27359d4ca2 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/Inventory.py @@ -0,0 +1,157 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, lxml.etree as ET +from typing import Any, Dict, List, Tuple +from .Namespace import NAMESPACES +from .Tools import add_value_from_tag + +LOGGER = logging.getLogger(__name__) + +XPATH_PORTS = "//ocp:components/ocp:component" + +""" +#Method Name: parse + +#Parameters: + + - xml_data: [ET.Element] Represents the XML data to be parsed. + +# Functionality: + + The parse function of the inventerio class has the functionality to parse + an XML document represented by the xml_data parameter and extract specific + information from the XML elements, namely the relevant characteristics of the + components. + + To generate the template the following steps are performed: + + 1) An empty list called response is created to store the results of the analysis. + + 2) Iterate over the XML elements that match the pattern specified by the XPATH_PORTS + expression. These elements represent components in the XML document. + + 3) For each component element: + A dictionary called inventory is initialized that will store the information extracted + from the component.The values of the relevant XML elements are extracted and added to + the dictionary. + +#Return: + List[Tuple[str, Dict[str, Any]]] The response list containing the tuples (path, dictionary) + with the information extracted from the XML document components is returned. +""" + +def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: + response = [] + LOGGER.debug("InventoryPrueba") + parent_types = {} + for xml_component in xml_data.xpath(XPATH_PORTS, namespaces=NAMESPACES): + LOGGER.info('xml_component inventario = {:s}'.format(str(ET.tostring(xml_component)))) + inventory = {} + inventory['parent-component-references'] = '' + inventory['name'] = '' + inventory['class'] = '' + inventory['attributes'] = {} + component_reference = [] + + component_name = xml_component.find('ocp:name', namespaces=NAMESPACES) + if component_name is None or component_name.text is None: continue + add_value_from_tag(inventory, 'name', component_name) + + component_description = xml_component.find('ocp:state/ocp:description', namespaces=NAMESPACES) + if not component_description is None: + add_value_from_tag(inventory['attributes'], 'description', component_description) + + component_location = xml_component.find('ocp:state/ocp:location', namespaces=NAMESPACES) + if not component_location is None: + add_value_from_tag(inventory['attributes'], 'location', component_location) + + component_type = xml_component.find('ocp:state/ocp:type', namespaces=NAMESPACES) + component_type.text = component_type.text.replace('oc-platform-types:','') + if component_type is None: continue + add_value_from_tag(inventory, 'class', component_type) + + if inventory['class'] == 'CPU' or inventory['class'] == 'STORAGE': continue + + component_empty = xml_component.find('ocp:state/ocp:empty', namespaces=NAMESPACES) + if not component_empty is None: + add_value_from_tag(inventory['attributes'], 'empty', component_empty) + + component_parent = xml_component.find('ocp:state/ocp:parent', namespaces=NAMESPACES) + if not component_parent is None: + add_value_from_tag(inventory, 'parent-component-references', component_parent) + + component_HW = xml_component.find('ocp:state/ocp:hardware-version', namespaces=NAMESPACES) + if not component_HW is None: + add_value_from_tag(inventory['attributes'], 'hardware-rev', component_HW) + + component_firmware_version = xml_component.find('ocp:state/ocp:firmware-version', namespaces=NAMESPACES) + if not component_firmware_version is None: + add_value_from_tag(inventory['attributes'], 'firmware-rev', component_firmware_version) + + component_SW = xml_component.find('ocp:state/ocp:software-version', namespaces=NAMESPACES) + if not component_SW is None: + add_value_from_tag(inventory['attributes'], 'software-rev', component_SW) + + component_serial = xml_component.find('ocp:state/ocp:serial-no', namespaces=NAMESPACES) + if not component_serial is None: + add_value_from_tag(inventory['attributes'], 'serial-num', component_serial) + + component_mfg_name = xml_component.find('ocp:state/ocp:mfg-name', namespaces=NAMESPACES) + if not component_mfg_name is None: + add_value_from_tag(inventory['attributes'], 'manufacturer-name', component_mfg_name) + + component_removable = xml_component.find('ocp:state/ocp:removable', namespaces=NAMESPACES) + if not component_removable is None: + add_value_from_tag(inventory['attributes'], 'removable', component_removable) + + component_mfg_date = xml_component.find('ocp:state/ocp:mfg-date', namespaces=NAMESPACES) + if not component_mfg_date is None: + add_value_from_tag(inventory['attributes'], 'mfg-date', component_mfg_date) + + #Transceiver Information + component_serial_t = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:serial-no', namespaces=NAMESPACES) + if not component_serial_t is None: + add_value_from_tag(inventory['attributes'], 'serial-num', component_serial_t) + + component_present = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:present', namespaces=NAMESPACES) + if component_present is not None and 'NOT_PRESENT' in component_present.text: continue + + component_vendor = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:vendor', namespaces=NAMESPACES) + if not component_vendor is None: + add_value_from_tag(inventory['attributes'], 'vendor', component_vendor) + component_connector = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:connector-type', namespaces=NAMESPACES) + if not component_connector is None: + component_connector.text = component_connector.text.replace('oc-opt-types:','') + add_value_from_tag(inventory['attributes'], 'connector-type', component_connector) + + component_form = xml_component.find('ocptr:transceiver/ocptr:state/ocptr:form-factor', namespaces=NAMESPACES) + if not component_form is None: + component_form.text = component_form.text.replace('oc-opt-types:','') + add_value_from_tag(inventory['attributes'], 'form-factor', component_form) + + if inventory['parent-component-references'] not in parent_types: + parent_types[inventory['parent-component-references']] = len(parent_types) + 1 + + component_reference.extend([parent_types[inventory['parent-component-references']]]) + + response.append(('/inventory/{:s}'.format(inventory['name']), inventory)) + + for tupla in response: + if inventory['parent-component-references'] in tupla[0]: + component_reference.extend([tupla[1]['class']]) + + inventory['component-reference'] = component_reference + + return response diff --git a/src/device/service/drivers/openconfig/templates/Namespace.py b/src/device/service/drivers/openconfig/templates/Namespace.py index eede865502b043b7936d763c980be80a7ea817f8..bdc27a1ff30d5ac18b9233cdd420cd8493e7a419 100644 --- a/src/device/service/drivers/openconfig/templates/Namespace.py +++ b/src/device/service/drivers/openconfig/templates/Namespace.py @@ -28,6 +28,7 @@ NAMESPACE_POLICY_TYPES = 'http://openconfig.net/yang/policy-types' NAMESPACE_POLICY_TYPES_2 = 'http://openconfig.net/yang/policy_types' NAMESPACE_ROUTING_POLICY = 'http://openconfig.net/yang/routing-policy' NAMESPACE_VLAN = 'http://openconfig.net/yang/vlan' +NAMESPACE_PLATFORM_TRANSCEIVER = 'http://openconfig.net/yang/platform/transceiver' NAMESPACES = { 'nc' : NAMESPACE_NETCONF, @@ -44,4 +45,5 @@ NAMESPACES = { 'ocpt2': NAMESPACE_POLICY_TYPES_2, 'ocrp' : NAMESPACE_ROUTING_POLICY, 'ocv' : NAMESPACE_VLAN, + 'ocptr': NAMESPACE_PLATFORM_TRANSCEIVER, } diff --git a/src/device/service/drivers/openconfig/templates/__init__.py b/src/device/service/drivers/openconfig/templates/__init__.py index 1f86b719227f4def0bc18c45997925846defbc56..87eea1f0b6673c4bff3222598d81a16b383b4c3b 100644 --- a/src/device/service/drivers/openconfig/templates/__init__.py +++ b/src/device/service/drivers/openconfig/templates/__init__.py @@ -20,15 +20,17 @@ from jinja2 import Environment, PackageLoader, select_autoescape import paramiko from .Tools import generate_templates from device.service.driver_api._Driver import ( - RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES, RESOURCE_ACL) + RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_NETWORK_INSTANCES, RESOURCE_ROUTING_POLICIES, RESOURCE_ACL, RESOURCE_INVENTORY) from .EndPoints import parse as parse_endpoints from .Interfaces import parse as parse_interfaces, parse_counters from .NetworkInstances import parse as parse_network_instances from .RoutingPolicy import parse as parse_routing_policy from .Acl import parse as parse_acl +from .Inventory import parse as parse_inventory LOGGER = logging.getLogger(__name__) ALL_RESOURCE_KEYS = [ + RESOURCE_INVENTORY, RESOURCE_ENDPOINTS, RESOURCE_INTERFACES, RESOURCE_ROUTING_POLICIES, # routing policies should come before network instances @@ -37,6 +39,7 @@ ALL_RESOURCE_KEYS = [ ] RESOURCE_KEY_MAPPINGS = { + RESOURCE_INVENTORY : 'inventory', RESOURCE_ENDPOINTS : 'component', RESOURCE_INTERFACES : 'interface', RESOURCE_NETWORK_INSTANCES: 'network_instance', @@ -45,6 +48,7 @@ RESOURCE_KEY_MAPPINGS = { } RESOURCE_PARSERS = { + 'inventory' : parse_inventory, 'component' : parse_endpoints, 'interface' : parse_interfaces, 'network_instance': parse_network_instances, diff --git a/src/device/service/drivers/openconfig/templates/inventory/get.xml b/src/device/service/drivers/openconfig/templates/inventory/get.xml new file mode 100644 index 0000000000000000000000000000000000000000..aa25ed1e3b11e0c324b361eb52d064dac87a64c5 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/inventory/get.xml @@ -0,0 +1,3 @@ +<components xmlns="http://openconfig.net/yang/platform"> + <component/> +</components> diff --git a/src/device/service/drivers/p4/p4_driver.py b/src/device/service/drivers/p4/p4_driver.py index 8925f3a677b251c531f8cb3b77fc2ceedbb695dd..6bb5fbe41b02ec07a86422ab79afce1bc40c01cd 100644 --- a/src/device/service/drivers/p4/p4_driver.py +++ b/src/device/service/drivers/p4/p4_driver.py @@ -74,15 +74,13 @@ class P4Driver(_Driver): """ def __init__(self, address: str, port: int, **settings) -> None: - # pylint: disable=super-init-not-called + super().__init__(settings.pop('name', DRIVER_NAME), address, port, **settings) self.__manager = None self.__address = address self.__port = int(port) self.__endpoint = None self.__settings = settings self.__id = None - self.__name = DRIVER_NAME - self._name = None self.__vendor = P4_VAL_DEF_VENDOR self.__hw_version = P4_VAL_DEF_HW_VER self.__sw_version = P4_VAL_DEF_SW_VER diff --git a/src/device/service/drivers/xr/README_XR.md b/src/device/service/drivers/xr/README_XR.md index 9c64cdef1b773e84153c0d27a58e71af8bdf238f..6f79cfad0cbc9531c88682445f990560a9f1ff2e 100644 --- a/src/device/service/drivers/xr/README_XR.md +++ b/src/device/service/drivers/xr/README_XR.md @@ -52,7 +52,7 @@ Script requires more variables than before as of February 2023. # See https://labs.etsi.org/rep/tfs/controller/-/blob/develop/my_deploy.sh # Use docker run -d -p 32000:5000 --restart=always --name registry registry:2 export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator" +export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice compute webui load_generator" export TFS_IMAGE_TAG="dev" export TFS_K8S_NAMESPACE="tfs" export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" @@ -113,14 +113,14 @@ Run deploy script to build in docker containers and then instantiate to configur If protobuf definitions have changed, regenerate version controlled Java files manually (it is a horrifying bug in build system that this is not automated!). ``` -cd automation +cd ztp # In case Java is not already installed sudo apt-get install openjdk-11-jdk -y export MAVEN_OPTS='--add-exports=java.base/jdk.internal.module=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' cd src/policy ./mvnw compile cd - -cd src/automation +cd src/ztp ./mvnw compile ``` diff --git a/src/dlt/connector/Dockerfile b/src/dlt/connector/Dockerfile index f4d85ec8c591041e920c7404acc862c3d5a4a560..8e3a2f95380237cfd64508fc2f0a6c0e9be91333 100644 --- a/src/dlt/connector/Dockerfile +++ b/src/dlt/connector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/dlt/mock_blockchain/Dockerfile b/src/dlt/mock_blockchain/Dockerfile index 09fe5d399c8455f8fd898d6b4c9eb992c8c9d469..af1edb3d52f419c31274d24226f9e9b7e9a29f7b 100644 --- a/src/dlt/mock_blockchain/Dockerfile +++ b/src/dlt/mock_blockchain/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/interdomain/Dockerfile b/src/interdomain/Dockerfile index 66c6e938d7adf5bd985fc0b4f87fe284c1370be4..c10fd8220adae8100fa15fd5d33d833d30d189a9 100644 --- a/src/interdomain/Dockerfile +++ b/src/interdomain/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_attackmitigator/Dockerfile b/src/l3_attackmitigator/Dockerfile index 99b7e7a9435ca4172e4ec38f8f8d13c20ebdce57..2333bfa30773dcfe49b550d65fb3aa45376d9e03 100644 --- a/src/l3_attackmitigator/Dockerfile +++ b/src/l3_attackmitigator/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_centralizedattackdetector/Dockerfile b/src/l3_centralizedattackdetector/Dockerfile index 377ecd21b0ad553512797ce7a31f1ce520462a13..376d8904dfc58efd2e1963806d0d07179647b54f 100644 --- a/src/l3_centralizedattackdetector/Dockerfile +++ b/src/l3_centralizedattackdetector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/l3_distributedattackdetector/Dockerfile b/src/l3_distributedattackdetector/Dockerfile index e78c41803f4b80a129ad9537265f68885f0a6d3b..37fb71fbab0ed22b8f2ff6a4281e3cea8dc32684 100644 --- a/src/l3_distributedattackdetector/Dockerfile +++ b/src/l3_distributedattackdetector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ libpcap-dev libtool && \ + apt-get --yes --quiet --quiet install wget g++ git libpcap-dev libtool && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/load_generator/Dockerfile b/src/load_generator/Dockerfile index c9297eb2fa08047ff1883f8c350ebbd1d0b5dd8c..6f7bb0eace4cc3e8561df9e07ce6ef25ebf43855 100644 --- a/src/load_generator/Dockerfile +++ b/src/load_generator/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/load_generator/tests/deploy_specs.sh b/src/load_generator/tests/deploy_specs.sh index 571990ecabfbf120b517f44fd99b4550a4b8a9a1..da09bae6a34e68b036938f61f08fa4f1e9220fbd 100755 --- a/src/load_generator/tests/deploy_specs.sh +++ b/src/load_generator/tests/deploy_specs.sh @@ -17,11 +17,11 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. # Supported components are: -# context device automation policy service compute monitoring webui +# context device ztp policy service compute monitoring webui # interdomain slice pathcomp dlt # dbscanserving opticalattackmitigator opticalattackdetector # l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector -export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" # automation monitoring compute dlt +export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" # ztp monitoring compute dlt # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/src/monitoring/Dockerfile b/src/monitoring/Dockerfile index 946f2cd1b5d16923aa1509948c759135c7f78eef..36aa7eb0967619202dfbcb18271f646657a58125 100644 --- a/src/monitoring/Dockerfile +++ b/src/monitoring/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/opticalattackdetector/Dockerfile b/src/opticalattackdetector/Dockerfile index fd903a616395617fbbe312b5fca8303966fc6053..2b55ae7b00607729bba4c8f0e1f76b10c7170b11 100644 --- a/src/opticalattackdetector/Dockerfile +++ b/src/opticalattackdetector/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/opticalattackmanager/Dockerfile b/src/opticalattackmanager/Dockerfile index 9920d6cefbb4ffc87558ae562cfb4fcee365930f..38637861ae5fa72e4baf0abaa58929136890db63 100644 --- a/src/opticalattackmanager/Dockerfile +++ b/src/opticalattackmanager/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/opticalattackmitigator/Dockerfile b/src/opticalattackmitigator/Dockerfile index e364cbee121c38570c8158946486ec38dcd8b12d..278990306a7ac410eb5d7442537919e410fa957d 100644 --- a/src/opticalattackmitigator/Dockerfile +++ b/src/opticalattackmitigator/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/pathcomp/frontend/Dockerfile b/src/pathcomp/frontend/Dockerfile index 9384b3e19edd5e82b0efcb9706c41105a31321e3..08fe50e0f7443ad71ecabf6fdb337539cc07d203 100644 --- a/src/pathcomp/frontend/Dockerfile +++ b/src/pathcomp/frontend/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/pathcomp/misc/my_deploy-tests.sh b/src/pathcomp/misc/my_deploy-tests.sh index 66564e9a07a6a9ea8eb7cc6ba545c551f614a526..639ddb08ad68ddfcfdbbdca2717718053dc28ab4 100755 --- a/src/pathcomp/misc/my_deploy-tests.sh +++ b/src/pathcomp/misc/my_deploy-tests.sh @@ -17,7 +17,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by comas, you want to build images for, and deploy. # Supported components are: -# context device automation policy service compute monitoring webui +# context device ztp policy service compute monitoring webui # interdomain slice pathcomp dlt # dbscanserving opticalattackmitigator opticalcentralizedattackdetector # l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector diff --git a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java b/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java index c27899b741e9169d645b13d18a79b27e37c727b6..3caadf92e678b54ba7a7654bc93f88e15a78d821 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java +++ b/src/policy/src/main/java/eu/teraflow/policy/PolicyServiceImpl.java @@ -198,53 +198,60 @@ public class PolicyServiceImpl implements PolicyService { "Invalid PolicyRuleConditions in PolicyRule with ID: %s", policyRuleBasic.getPolicyRuleId())); return policyRuleState; + } else { + contextService + .setPolicyRule(policyRule) + .subscribe() + .with( + policyId -> { + setPolicyRuleServiceToContext( + policyRuleService, VALIDATED_POLICYRULE_STATE); + noAlarms = 0; + + // Create an alarmIds list that contains the promised ids returned from + // setKpiAlarm + List<Uni<String>> alarmIds = new ArrayList<Uni<String>>(); + for (AlarmDescriptor alarmDescriptor : alarmDescriptorList) { + LOGGER.infof("alarmDescriptor:"); + LOGGER.infof(alarmDescriptor.toString()); + alarmIds.add(monitoringService.setKpiAlarm(alarmDescriptor)); + } + //LOGGER.infof("THIS IS A TEST!"); + //LOGGER.infof("%s", alarmIds); + // Transform the alarmIds into promised alarms returned from the + // getAlarmResponseStream + List<Multi<AlarmResponse>> alarmResponseStreamList = new ArrayList<>(); + for (Uni<String> alarmId : alarmIds) { + alarmResponseStreamList.add( + alarmId + .onItem() + .transformToMulti( + id -> { + alarmPolicyRuleServiceMap.put(id, policyRuleService); + + // TODO: Create infinite subscription + var alarmSubscription = + new AlarmSubscription(id, 259200, 5000); + return monitoringService.getAlarmResponseStream( + alarmSubscription); + })); + } + + // Merge the promised alarms into one stream (Multi Object) + final var multi = + Multi.createBy().merging().streams(alarmResponseStreamList); + setPolicyRuleServiceToContext( + policyRuleService, PROVISIONED_POLICYRULE_STATE); + + subscriptionList.put(policyId, monitorAlarmResponseForService(multi)); + + // TODO: Resubscribe to the stream, if it has ended + + // TODO: Redesign evaluation of action + // evaluateAction(policyRule, alarmDescriptorList, multi); + }); + return VALIDATED_POLICYRULE_STATE; } - contextService.setPolicyRule(policyRule).subscribe().with(x -> {}); - LOGGER.infof("THIS IS A TEST! 1"); - setPolicyRuleServiceToContext(policyRuleService, VALIDATED_POLICYRULE_STATE); - LOGGER.infof("THIS IS A TEST! 2"); - noAlarms = 0; - - // Create an alarmIds list that contains the promised ids returned from setKpiAlarm - List<Uni<String>> alarmIds = new ArrayList<Uni<String>>(); - for (AlarmDescriptor alarmDescriptor : alarmDescriptorList) { - LOGGER.infof("alarmDescriptor:"); - LOGGER.infof(alarmDescriptor.toString()); - alarmIds.add(monitoringService.setKpiAlarm(alarmDescriptor)); - } - LOGGER.infof("THIS IS A TEST!"); - LOGGER.infof("%s", alarmIds); - // Transform the alarmIds into promised alarms returned from the - // getAlarmResponseStream - List<Multi<AlarmResponse>> alarmResponseStreamList = new ArrayList<>(); - for (Uni<String> alarmId : alarmIds) { - alarmResponseStreamList.add( - alarmId - .onItem() - .transformToMulti( - id -> { - alarmPolicyRuleServiceMap.put(id, policyRuleService); - - // TODO: Create infinite subscription - var alarmSubscription = new AlarmSubscription(id, 259200, 5000); - return monitoringService.getAlarmResponseStream(alarmSubscription); - })); - } - - // Merge the promised alarms into one stream (Multi Object) - final var multi = Multi.createBy().merging().streams(alarmResponseStreamList); - setPolicyRuleServiceToContext(policyRuleService, PROVISIONED_POLICYRULE_STATE); - - subscriptionList.put( - policyRuleService.getPolicyRuleBasic().getPolicyRuleId(), - monitorAlarmResponseForService(multi)); - - // TODO: Resubscribe to the stream, if it has ended - - // TODO: Redesign evaluation of action - // evaluateAction(policyRule, alarmDescriptorList, multi); - - return VALIDATED_POLICYRULE_STATE; }); } @@ -435,6 +442,7 @@ public class PolicyServiceImpl implements PolicyService { .transform( policyRule -> { var policyRuleBasic = policyRule.getPolicyRuleType().getPolicyRuleBasic(); + String policyId = policyRuleBasic.getPolicyRuleId(); policyRule .getPolicyRuleType() @@ -450,8 +458,8 @@ public class PolicyServiceImpl implements PolicyService { "DeletePolicy with id: " + VALID_MESSAGE, policyRuleBasic.getPolicyRuleId())); - contextService.removePolicyRule(policyRuleId); - subscriptionList.get(policyRuleId).cancel(); + contextService.removePolicyRule(policyId).subscribe().with(x -> {}); + subscriptionList.get(policyId).cancel(); return policyRuleBasic.getPolicyRuleState(); }); @@ -780,13 +788,7 @@ public class PolicyServiceImpl implements PolicyService { final var kpiValueRange = convertPolicyRuleConditionToKpiValueRange(policyRuleCondition); return new AlarmDescriptor( - // "alarmId-" + gen(), - "alarmId-" + gen(), - "alarmDescription", - "alarmName-" + gen(), - kpiId, - kpiValueRange, - getTimeStamp()); + "", "alarmDescription", "alarmName-" + gen(), kpiId, kpiValueRange, getTimeStamp()); } private AlarmDescriptor createAlarmDescriptorWithRange( @@ -811,8 +813,7 @@ public class PolicyServiceImpl implements PolicyService { } return new AlarmDescriptor( - // "alarmId-" + gen(), - "alarmId-" + gen(), + "", "alarmDescription", "alarmName-" + gen(), kpiId, diff --git a/src/policy/src/main/java/eu/teraflow/policy/Serializer.java b/src/policy/src/main/java/eu/teraflow/policy/Serializer.java index 5a95f0e6edd200251a27b1e3571b719ebd102e1b..e7fb00029f15d82dbe80c8fff13d098ca5b29f30 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/Serializer.java +++ b/src/policy/src/main/java/eu/teraflow/policy/Serializer.java @@ -2270,8 +2270,8 @@ public class Serializer { return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4; case IETF_NETWORK_TOPOLOGY: return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; - case ONF_TR_352: - return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352; + case ONF_TR_532: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532; case XR: return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR; case IETF_L2VPN: @@ -2293,8 +2293,8 @@ public class Serializer { return DeviceDriverEnum.P4; case DEVICEDRIVER_IETF_NETWORK_TOPOLOGY: return DeviceDriverEnum.IETF_NETWORK_TOPOLOGY; - case DEVICEDRIVER_ONF_TR_352: - return DeviceDriverEnum.ONF_TR_352; + case DEVICEDRIVER_ONF_TR_532: + return DeviceDriverEnum.ONF_TR_532; case DEVICEDRIVER_XR: return DeviceDriverEnum.XR; case DEVICEDRIVER_IETF_L2VPN: diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java index ad763e35dfeef71c2f9f73dbf51785a3e03c0e0d..e4198b9d03a4afcaef71a6311a244072ded2eab0 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java +++ b/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceDriverEnum.java @@ -22,7 +22,7 @@ public enum DeviceDriverEnum { TRANSPORT_API, P4, IETF_NETWORK_TOPOLOGY, - ONF_TR_352, + ONF_TR_532, XR, IETF_L2VPN } diff --git a/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java b/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java index 32055a1820365ffc0f048fa70e99df5f3369fd81..fb60ef8d1a82417f858fe63845b76b27099f488e 100644 --- a/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java +++ b/src/policy/src/test/java/eu/teraflow/policy/SerializerTest.java @@ -3602,8 +3602,8 @@ class SerializerTest { DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY), Arguments.of( - DeviceDriverEnum.ONF_TR_352, - ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352), + DeviceDriverEnum.ONF_TR_532, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532), Arguments.of(DeviceDriverEnum.XR, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR), Arguments.of( DeviceDriverEnum.IETF_L2VPN, diff --git a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java index 136969fe16f0fb0a4f13815973f3361a2ce515ec..85bc0d278365971bbf1bcb135d05fd8523392716 100644 --- a/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/policy/target/generated-sources/grpc/context/ContextOuterClass.java @@ -170,9 +170,9 @@ public final class ContextOuterClass { */ DEVICEDRIVER_IETF_NETWORK_TOPOLOGY(4), /** - * <code>DEVICEDRIVER_ONF_TR_352 = 5;</code> + * <code>DEVICEDRIVER_ONF_TR_532 = 5;</code> */ - DEVICEDRIVER_ONF_TR_352(5), + DEVICEDRIVER_ONF_TR_532(5), /** * <code>DEVICEDRIVER_XR = 6;</code> */ @@ -213,9 +213,9 @@ public final class ContextOuterClass { */ public static final int DEVICEDRIVER_IETF_NETWORK_TOPOLOGY_VALUE = 4; /** - * <code>DEVICEDRIVER_ONF_TR_352 = 5;</code> + * <code>DEVICEDRIVER_ONF_TR_532 = 5;</code> */ - public static final int DEVICEDRIVER_ONF_TR_352_VALUE = 5; + public static final int DEVICEDRIVER_ONF_TR_532_VALUE = 5; /** * <code>DEVICEDRIVER_XR = 6;</code> */ @@ -259,7 +259,7 @@ public final class ContextOuterClass { case 2: return DEVICEDRIVER_TRANSPORT_API; case 3: return DEVICEDRIVER_P4; case 4: return DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; - case 5: return DEVICEDRIVER_ONF_TR_352; + case 5: return DEVICEDRIVER_ONF_TR_532; case 6: return DEVICEDRIVER_XR; case 7: return DEVICEDRIVER_IETF_L2VPN; case 8: return DEVICEDRIVER_GNMI_OPENCONFIG; @@ -15650,43 +15650,43 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ java.util.List<context.ContextOuterClass.Component> - getComponentList(); + getComponentsList(); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - context.ContextOuterClass.Component getComponent(int index); + context.ContextOuterClass.Component getComponents(int index); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - int getComponentCount(); + int getComponentsCount(); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ java.util.List<? extends context.ContextOuterClass.ComponentOrBuilder> - getComponentOrBuilderList(); + getComponentsOrBuilderList(); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index); /** @@ -15734,7 +15734,7 @@ public final class ContextOuterClass { deviceOperationalStatus_ = 0; deviceDrivers_ = java.util.Collections.emptyList(); deviceEndpoints_ = java.util.Collections.emptyList(); - component_ = java.util.Collections.emptyList(); + components_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -15846,10 +15846,10 @@ public final class ContextOuterClass { } case 66: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList<context.ContextOuterClass.Component>(); + components_ = new java.util.ArrayList<context.ContextOuterClass.Component>(); mutable_bitField0_ |= 0x00000004; } - component_.add( + components_.add( input.readMessage(context.ContextOuterClass.Component.parser(), extensionRegistry)); break; } @@ -15888,7 +15888,7 @@ public final class ContextOuterClass { deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); } if (((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -16152,64 +16152,64 @@ public final class ContextOuterClass { return deviceEndpoints_.get(index); } - public static final int COMPONENT_FIELD_NUMBER = 8; - private java.util.List<context.ContextOuterClass.Component> component_; + public static final int COMPONENTS_FIELD_NUMBER = 8; + private java.util.List<context.ContextOuterClass.Component> components_; /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public java.util.List<context.ContextOuterClass.Component> getComponentList() { - return component_; + public java.util.List<context.ContextOuterClass.Component> getComponentsList() { + return components_; } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override public java.util.List<? extends context.ContextOuterClass.ComponentOrBuilder> - getComponentOrBuilderList() { - return component_; + getComponentsOrBuilderList() { + return components_; } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public int getComponentCount() { - return component_.size(); + public int getComponentsCount() { + return components_.size(); } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public context.ContextOuterClass.Component getComponent(int index) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + return components_.get(index); } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - return component_.get(index); + return components_.get(index); } public static final int CONTROLLER_ID_FIELD_NUMBER = 9; @@ -16290,8 +16290,8 @@ public final class ContextOuterClass { for (int i = 0; i < deviceEndpoints_.size(); i++) { output.writeMessage(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { - output.writeMessage(8, component_.get(i)); + for (int i = 0; i < components_.size(); i++) { + output.writeMessage(8, components_.get(i)); } if (controllerId_ != null) { output.writeMessage(9, getControllerId()); @@ -16339,9 +16339,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { + for (int i = 0; i < components_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, component_.get(i)); + .computeMessageSize(8, components_.get(i)); } if (controllerId_ != null) { size += com.google.protobuf.CodedOutputStream @@ -16380,8 +16380,8 @@ public final class ContextOuterClass { if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; if (!getDeviceEndpointsList() .equals(other.getDeviceEndpointsList())) return false; - if (!getComponentList() - .equals(other.getComponentList())) return false; + if (!getComponentsList() + .equals(other.getComponentsList())) return false; if (hasControllerId() != other.hasControllerId()) return false; if (hasControllerId()) { if (!getControllerId() @@ -16420,9 +16420,9 @@ public final class ContextOuterClass { hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; hash = (53 * hash) + getDeviceEndpointsList().hashCode(); } - if (getComponentCount() > 0) { - hash = (37 * hash) + COMPONENT_FIELD_NUMBER; - hash = (53 * hash) + getComponentList().hashCode(); + if (getComponentsCount() > 0) { + hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getComponentsList().hashCode(); } if (hasControllerId()) { hash = (37 * hash) + CONTROLLER_ID_FIELD_NUMBER; @@ -16557,7 +16557,7 @@ public final class ContextOuterClass { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDeviceEndpointsFieldBuilder(); - getComponentFieldBuilder(); + getComponentsFieldBuilder(); } } @java.lang.Override @@ -16589,11 +16589,11 @@ public final class ContextOuterClass { } else { deviceEndpointsBuilder_.clear(); } - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } if (controllerIdBuilder_ == null) { controllerId_ = null; @@ -16655,14 +16655,14 @@ public final class ContextOuterClass { } else { result.deviceEndpoints_ = deviceEndpointsBuilder_.build(); } - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); bitField0_ = (bitField0_ & ~0x00000004); } - result.component_ = component_; + result.components_ = components_; } else { - result.component_ = componentBuilder_.build(); + result.components_ = componentsBuilder_.build(); } if (controllerIdBuilder_ == null) { result.controllerId_ = controllerId_; @@ -16770,29 +16770,29 @@ public final class ContextOuterClass { } } } - if (componentBuilder_ == null) { - if (!other.component_.isEmpty()) { - if (component_.isEmpty()) { - component_ = other.component_; + if (componentsBuilder_ == null) { + if (!other.components_.isEmpty()) { + if (components_.isEmpty()) { + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); } else { - ensureComponentIsMutable(); - component_.addAll(other.component_); + ensureComponentsIsMutable(); + components_.addAll(other.components_); } onChanged(); } } else { - if (!other.component_.isEmpty()) { - if (componentBuilder_.isEmpty()) { - componentBuilder_.dispose(); - componentBuilder_ = null; - component_ = other.component_; + if (!other.components_.isEmpty()) { + if (componentsBuilder_.isEmpty()) { + componentsBuilder_.dispose(); + componentsBuilder_ = null; + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); - componentBuilder_ = + componentsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getComponentFieldBuilder() : null; + getComponentsFieldBuilder() : null; } else { - componentBuilder_.addAllMessages(other.component_); + componentsBuilder_.addAllMessages(other.components_); } } } @@ -17653,30 +17653,30 @@ public final class ContextOuterClass { return deviceEndpointsBuilder_; } - private java.util.List<context.ContextOuterClass.Component> component_ = + private java.util.List<context.ContextOuterClass.Component> components_ = java.util.Collections.emptyList(); - private void ensureComponentIsMutable() { + private void ensureComponentsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList<context.ContextOuterClass.Component>(component_); + components_ = new java.util.ArrayList<context.ContextOuterClass.Component>(components_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentBuilder_; + context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentsBuilder_; /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public java.util.List<context.ContextOuterClass.Component> getComponentList() { - if (componentBuilder_ == null) { - return java.util.Collections.unmodifiableList(component_); + public java.util.List<context.ContextOuterClass.Component> getComponentsList() { + if (componentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(components_); } else { - return componentBuilder_.getMessageList(); + return componentsBuilder_.getMessageList(); } } /** @@ -17684,13 +17684,13 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public int getComponentCount() { - if (componentBuilder_ == null) { - return component_.size(); + public int getComponentsCount() { + if (componentsBuilder_ == null) { + return components_.size(); } else { - return componentBuilder_.getCount(); + return componentsBuilder_.getCount(); } } /** @@ -17698,13 +17698,13 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component getComponent(int index) { - if (componentBuilder_ == null) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + if (componentsBuilder_ == null) { + return components_.get(index); } else { - return componentBuilder_.getMessage(index); + return componentsBuilder_.getMessage(index); } } /** @@ -17712,19 +17712,19 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.set(index, value); + ensureComponentsIsMutable(); + components_.set(index, value); onChanged(); } else { - componentBuilder_.setMessage(index, value); + componentsBuilder_.setMessage(index, value); } return this; } @@ -17733,16 +17733,16 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.set(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.set(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.setMessage(index, builderForValue.build()); + componentsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -17751,18 +17751,18 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent(context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + public Builder addComponents(context.ContextOuterClass.Component value) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(value); + ensureComponentsIsMutable(); + components_.add(value); onChanged(); } else { - componentBuilder_.addMessage(value); + componentsBuilder_.addMessage(value); } return this; } @@ -17771,19 +17771,19 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(index, value); + ensureComponentsIsMutable(); + components_.add(index, value); onChanged(); } else { - componentBuilder_.addMessage(index, value); + componentsBuilder_.addMessage(index, value); } return this; } @@ -17792,16 +17792,16 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent( + public Builder addComponents( context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(builderForValue.build()); + componentsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -17810,16 +17810,16 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(index, builderForValue.build()); + componentsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -17828,17 +17828,17 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addAllComponent( + public Builder addAllComponents( java.lang.Iterable<? extends context.ContextOuterClass.Component> values) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, component_); + values, components_); onChanged(); } else { - componentBuilder_.addAllMessages(values); + componentsBuilder_.addAllMessages(values); } return this; } @@ -17847,15 +17847,15 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder clearComponent() { - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + public Builder clearComponents() { + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } return this; } @@ -17864,15 +17864,15 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder removeComponent(int index) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.remove(index); + public Builder removeComponents(int index) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.remove(index); onChanged(); } else { - componentBuilder_.remove(index); + componentsBuilder_.remove(index); } return this; } @@ -17881,24 +17881,24 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component.Builder getComponentBuilder( + public context.ContextOuterClass.Component.Builder getComponentsBuilder( int index) { - return getComponentFieldBuilder().getBuilder(index); + return getComponentsFieldBuilder().getBuilder(index); } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - if (componentBuilder_ == null) { - return component_.get(index); } else { - return componentBuilder_.getMessageOrBuilder(index); + if (componentsBuilder_ == null) { + return components_.get(index); } else { + return componentsBuilder_.getMessageOrBuilder(index); } } /** @@ -17906,14 +17906,14 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ public java.util.List<? extends context.ContextOuterClass.ComponentOrBuilder> - getComponentOrBuilderList() { - if (componentBuilder_ != null) { - return componentBuilder_.getMessageOrBuilderList(); + getComponentsOrBuilderList() { + if (componentsBuilder_ != null) { + return componentsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(component_); + return java.util.Collections.unmodifiableList(components_); } } /** @@ -17921,10 +17921,10 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component.Builder addComponentBuilder() { - return getComponentFieldBuilder().addBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder() { + return getComponentsFieldBuilder().addBuilder( context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17932,11 +17932,11 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component.Builder addComponentBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder( int index) { - return getComponentFieldBuilder().addBuilder( + return getComponentsFieldBuilder().addBuilder( index, context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17944,25 +17944,25 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ public java.util.List<context.ContextOuterClass.Component.Builder> - getComponentBuilderList() { - return getComponentFieldBuilder().getBuilderList(); + getComponentsBuilderList() { + return getComponentsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> - getComponentFieldBuilder() { - if (componentBuilder_ == null) { - componentBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getComponentsFieldBuilder() { + if (componentsBuilder_ == null) { + componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder>( - component_, + components_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - component_ = null; + components_ = null; } - return componentBuilder_; + return componentsBuilder_; } private context.ContextOuterClass.DeviceId controllerId_; @@ -18177,31 +18177,115 @@ public final class ContextOuterClass { com.google.protobuf.MessageOrBuilder { /** - * <code>repeated string comp_string = 1;</code> - * @return A list containing the compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return Whether the componentUuid field is set. */ - java.util.List<java.lang.String> - getCompStringList(); + boolean hasComponentUuid(); /** - * <code>repeated string comp_string = 1;</code> - * @return The count of compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return The componentUuid. */ - int getCompStringCount(); + context.ContextOuterClass.Uuid getComponentUuid(); /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the element to return. - * @return The compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> */ - java.lang.String getCompString(int index); + context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder(); + /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * <code>string name = 2;</code> + * @return The name. + */ + java.lang.String getName(); + /** + * <code>string name = 2;</code> + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * <code>string type = 3;</code> + * @return The type. + */ + java.lang.String getType(); + /** + * <code>string type = 3;</code> + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + int getAttributesCount(); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + boolean containsAttributes( + java.lang.String key); + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map<java.lang.String, java.lang.String> + getAttributes(); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + java.util.Map<java.lang.String, java.lang.String> + getAttributesMap(); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + java.lang.String getAttributesOrThrow( + java.lang.String key); + + /** + * <code>string parent = 5;</code> + * @return The parent. + */ + java.lang.String getParent(); + /** + * <code>string parent = 5;</code> + * @return The bytes for parent. */ com.google.protobuf.ByteString - getCompStringBytes(int index); + getParentBytes(); } /** + * <pre> + *Defined previously to this section - Tested OK + * </pre> + * * Protobuf type {@code context.Component} */ public static final class Component extends @@ -18214,7 +18298,9 @@ public final class ContextOuterClass { super(builder); } private Component() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; + name_ = ""; + type_ = ""; + parent_ = ""; } @java.lang.Override @@ -18249,12 +18335,47 @@ public final class ContextOuterClass { done = true; break; case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (componentUuid_ != null) { + subBuilder = componentUuid_.toBuilder(); + } + componentUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(componentUuid_); + componentUuid_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 34: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(); + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; } - compString_.add(s); + com.google.protobuf.MapEntry<java.lang.String, java.lang.String> + attributes__ = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put( + attributes__.getKey(), attributes__.getValue()); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; break; } default: { @@ -18272,9 +18393,6 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -18284,6 +18402,18 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18292,39 +18422,241 @@ public final class ContextOuterClass { context.ContextOuterClass.Component.class, context.ContextOuterClass.Component.Builder.class); } - public static final int COMP_STRING_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList compString_; + public static final int COMPONENT_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid componentUuid_; /** - * <code>repeated string comp_string = 1;</code> - * @return A list containing the compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return Whether the componentUuid field is set. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_; + @java.lang.Override + public boolean hasComponentUuid() { + return componentUuid_ != null; } /** - * <code>repeated string comp_string = 1;</code> - * @return The count of compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return The componentUuid. */ - public int getCompStringCount() { - return compString_.size(); + @java.lang.Override + public context.ContextOuterClass.Uuid getComponentUuid() { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the element to return. - * @return The compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + return getComponentUuid(); } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * <code>string name = 2;</code> + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * <code>string name = 2;</code> + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object type_; + /** + * <code>string type = 3;</code> + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * <code>string type = 3;</code> + * @return The bytes for type. */ + @java.lang.Override public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .<java.lang.String, java.lang.String>newDefaultInstance( + context.ContextOuterClass.internal_static_context_Component_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField<java.lang.String, java.lang.String> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map<java.lang.String, java.lang.String> getAttributes() { + return getAttributesMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PARENT_FIELD_NUMBER = 5; + private volatile java.lang.Object parent_; + /** + * <code>string parent = 5;</code> + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * <code>string parent = 5;</code> + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -18341,8 +18673,23 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < compString_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, compString_.getRaw(i)); + if (componentUuid_ != null) { + output.writeMessage(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAttributes(), + AttributesDefaultEntryHolder.defaultEntry, + 4); + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); } unknownFields.writeTo(output); } @@ -18353,13 +18700,28 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - { - int dataSize = 0; - for (int i = 0; i < compString_.size(); i++) { - dataSize += computeStringSizeNoTag(compString_.getRaw(i)); - } - size += dataSize; - size += 1 * getCompStringList().size(); + if (componentUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + for (java.util.Map.Entry<java.lang.String, java.lang.String> entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry<java.lang.String, java.lang.String> + attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attributes__); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -18376,8 +18738,19 @@ public final class ContextOuterClass { } context.ContextOuterClass.Component other = (context.ContextOuterClass.Component) obj; - if (!getCompStringList() - .equals(other.getCompStringList())) return false; + if (hasComponentUuid() != other.hasComponentUuid()) return false; + if (hasComponentUuid()) { + if (!getComponentUuid() + .equals(other.getComponentUuid())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (!internalGetAttributes().equals( + other.internalGetAttributes())) return false; + if (!getParent() + .equals(other.getParent())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18389,10 +18762,20 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getCompStringCount() > 0) { - hash = (37 * hash) + COMP_STRING_FIELD_NUMBER; - hash = (53 * hash) + getCompStringList().hashCode(); + if (hasComponentUuid()) { + hash = (37 * hash) + COMPONENT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getComponentUuid().hashCode(); } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -18489,6 +18872,10 @@ public final class ContextOuterClass { return builder; } /** + * <pre> + *Defined previously to this section - Tested OK + * </pre> + * * Protobuf type {@code context.Component} */ public static final class Builder extends @@ -18500,6 +18887,28 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18526,8 +18935,19 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + name_ = ""; + + type_ = ""; + + internalGetMutableAttributes().clear(); + parent_ = ""; + return this; } @@ -18555,11 +18975,16 @@ public final class ContextOuterClass { public context.ContextOuterClass.Component buildPartial() { context.ContextOuterClass.Component result = new context.ContextOuterClass.Component(this); int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + result.componentUuid_ = componentUuid_; + } else { + result.componentUuid_ = componentUuidBuilder_.build(); } - result.compString_ = compString_; + result.name_ = name_; + result.type_ = type_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.parent_ = parent_; onBuilt(); return result; } @@ -18608,14 +19033,21 @@ public final class ContextOuterClass { public Builder mergeFrom(context.ContextOuterClass.Component other) { if (other == context.ContextOuterClass.Component.getDefaultInstance()) return this; - if (!other.compString_.isEmpty()) { - if (compString_.isEmpty()) { - compString_ = other.compString_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCompStringIsMutable(); - compString_.addAll(other.compString_); - } + if (other.hasComponentUuid()) { + mergeComponentUuid(other.getComponentUuid()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; onChanged(); } this.mergeUnknownFields(other.unknownFields); @@ -18648,112 +19080,505 @@ public final class ContextOuterClass { } private int bitField0_; - private com.google.protobuf.LazyStringList compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureCompStringIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(compString_); - bitField0_ |= 0x00000001; - } + private context.ContextOuterClass.Uuid componentUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> componentUuidBuilder_; + /** + * <code>.context.Uuid component_uuid = 1;</code> + * @return Whether the componentUuid field is set. + */ + public boolean hasComponentUuid() { + return componentUuidBuilder_ != null || componentUuid_ != null; } /** - * <code>repeated string comp_string = 1;</code> - * @return A list containing the compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return The componentUuid. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_.getUnmodifiableView(); + public context.ContextOuterClass.Uuid getComponentUuid() { + if (componentUuidBuilder_ == null) { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } else { + return componentUuidBuilder_.getMessage(); + } } /** - * <code>repeated string comp_string = 1;</code> - * @return The count of compString. + * <code>.context.Uuid component_uuid = 1;</code> */ - public int getCompStringCount() { - return compString_.size(); + public Builder setComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + componentUuid_ = value; + onChanged(); + } else { + componentUuidBuilder_.setMessage(value); + } + + return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the element to return. - * @return The compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + public Builder setComponentUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (componentUuidBuilder_ == null) { + componentUuid_ = builderForValue.build(); + onChanged(); + } else { + componentUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> + */ + public Builder mergeComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (componentUuid_ != null) { + componentUuid_ = + context.ContextOuterClass.Uuid.newBuilder(componentUuid_).mergeFrom(value).buildPartial(); + } else { + componentUuid_ = value; + } + onChanged(); + } else { + componentUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + public Builder clearComponentUuid() { + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + onChanged(); + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + public context.ContextOuterClass.Uuid.Builder getComponentUuidBuilder() { + + onChanged(); + return getComponentUuidFieldBuilder().getBuilder(); + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + if (componentUuidBuilder_ != null) { + return componentUuidBuilder_.getMessageOrBuilder(); + } else { + return componentUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getComponentUuidFieldBuilder() { + if (componentUuidBuilder_ == null) { + componentUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getComponentUuid(), + getParentForChildren(), + isClean()); + componentUuid_ = null; + } + return componentUuidBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * <code>string name = 2;</code> + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string name = 2;</code> + * @return The bytes for name. */ public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index to set the value at. - * @param value The compString to set. + * <code>string name = 2;</code> + * @param value The name to set. * @return This builder for chaining. */ - public Builder setCompString( - int index, java.lang.String value) { + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.set(index, value); + + name_ = value; onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param value The compString to add. + * <code>string name = 2;</code> + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * <code>string name = 2;</code> + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * <code>string type = 3;</code> + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string type = 3;</code> + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string type = 3;</code> + * @param value The type to set. * @return This builder for chaining. */ - public Builder addCompString( + public Builder setType( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.add(value); + + type_ = value; onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param values The compString to add. + * <code>string type = 3;</code> * @return This builder for chaining. */ - public Builder addAllCompString( - java.lang.Iterable<java.lang.String> values) { - ensureCompStringIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, compString_); + public Builder clearType() { + + type_ = getDefaultInstance().getType(); onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> + * <code>string type = 3;</code> + * @param value The bytes for type to set. * @return This builder for chaining. */ - public Builder clearCompString() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; onChanged(); return this; } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField<java.lang.String, java.lang.String> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField<java.lang.String, java.lang.String> + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map<java.lang.String, java.lang.String> getAttributes() { + return getAttributesMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap() + .clear(); + return this; + } /** - * <code>repeated string comp_string = 1;</code> - * @param value The bytes of the compString to add. + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + public Builder removeAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map<java.lang.String, java.lang.String> + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + public Builder putAttributes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .put(key, value); + return this; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + public Builder putAllAttributes( + java.util.Map<java.lang.String, java.lang.String> values) { + internalGetMutableAttributes().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * <code>string parent = 5;</code> + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string parent = 5;</code> + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string parent = 5;</code> + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * <code>string parent = 5;</code> * @return This builder for chaining. */ - public Builder addCompStringBytes( + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * <code>string parent = 5;</code> + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - ensureCompStringIsMutable(); - compString_.add(value); + + parent_ = value; onChanged(); return this; } @@ -73706,6 +74531,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_Component_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Component_AttributesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Component_AttributesEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_DeviceConfig_descriptor; private static final @@ -74043,290 +74873,294 @@ public final class ContextOuterClass { "vent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013t" + "opology_id\030\002 \001(\0132\023.context.TopologyId\".\n" + "\010DeviceId\022\"\n\013device_uuid\030\001 \001(\0132\r.context" + - ".Uuid\"\371\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + + ".Uuid\"\372\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + "ntext.DeviceId\022\014\n\004name\030\002 \001(\t\022\023\n\013device_t" + "ype\030\003 \001(\t\022,\n\rdevice_config\030\004 \001(\0132\025.conte" + "xt.DeviceConfig\022G\n\031device_operational_st" + "atus\030\005 \001(\0162$.context.DeviceOperationalSt" + "atusEnum\0221\n\016device_drivers\030\006 \003(\0162\031.conte" + "xt.DeviceDriverEnum\022+\n\020device_endpoints\030" + - "\007 \003(\0132\021.context.EndPoint\022%\n\tcomponent\030\010 " + - "\003(\0132\022.context.Component\022(\n\rcontroller_id" + - "\030\t \001(\0132\021.context.DeviceId\" \n\tComponent\022\023" + - "\n\013comp_string\030\001 \003(\t\"9\n\014DeviceConfig\022)\n\014c" + - "onfig_rules\030\001 \003(\0132\023.context.ConfigRule\"5" + - "\n\014DeviceIdList\022%\n\ndevice_ids\030\001 \003(\0132\021.con" + - "text.DeviceId\".\n\nDeviceList\022 \n\007devices\030\001" + - " \003(\0132\017.context.Device\"\216\001\n\014DeviceFilter\022)" + - "\n\ndevice_ids\030\001 \001(\0132\025.context.DeviceIdLis" + - "t\022\031\n\021include_endpoints\030\002 \001(\010\022\034\n\024include_" + - "config_rules\030\003 \001(\010\022\032\n\022include_components" + - "\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016." + - "context.Event\022$\n\tdevice_id\030\002 \001(\0132\021.conte" + - "xt.DeviceId\022,\n\rdevice_config\030\003 \001(\0132\025.con" + - "text.DeviceConfig\"*\n\006LinkId\022 \n\tlink_uuid" + - "\030\001 \001(\0132\r.context.Uuid\"f\n\004Link\022 \n\007link_id" + - "\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002 \001(\t\022.\n" + - "\021link_endpoint_ids\030\003 \003(\0132\023.context.EndPo" + - "intId\"/\n\nLinkIdList\022!\n\010link_ids\030\001 \003(\0132\017." + - "context.LinkId\"(\n\010LinkList\022\034\n\005links\030\001 \003(" + - "\0132\r.context.Link\"L\n\tLinkEvent\022\035\n\005event\030\001" + - " \001(\0132\016.context.Event\022 \n\007link_id\030\002 \001(\0132\017." + - "context.LinkId\"X\n\tServiceId\022&\n\ncontext_i" + - "d\030\001 \001(\0132\022.context.ContextId\022#\n\014service_u" + - "uid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007Service\022&\n\n" + - "service_id\030\001 \001(\0132\022.context.ServiceId\022\014\n\004" + - "name\030\002 \001(\t\022.\n\014service_type\030\003 \001(\0162\030.conte" + - "xt.ServiceTypeEnum\0221\n\024service_endpoint_i" + - "ds\030\004 \003(\0132\023.context.EndPointId\0220\n\023service" + - "_constraints\030\005 \003(\0132\023.context.Constraint\022" + - ".\n\016service_status\030\006 \001(\0132\026.context.Servic" + - "eStatus\022.\n\016service_config\030\007 \001(\0132\026.contex" + - "t.ServiceConfig\022%\n\ttimestamp\030\010 \001(\0132\022.con" + - "text.Timestamp\"C\n\rServiceStatus\0222\n\016servi" + - "ce_status\030\001 \001(\0162\032.context.ServiceStatusE" + - "num\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003" + - "(\0132\023.context.ConfigRule\"8\n\rServiceIdList" + - "\022\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceI" + - "d\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.con" + - "text.Service\"\225\001\n\rServiceFilter\022+\n\013servic" + - "e_ids\030\001 \001(\0132\026.context.ServiceIdList\022\034\n\024i" + - "nclude_endpoint_ids\030\002 \001(\010\022\033\n\023include_con" + - "straints\030\003 \001(\010\022\034\n\024include_config_rules\030\004" + - " \001(\010\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001(\0132\016.co" + - "ntext.Event\022&\n\nservice_id\030\002 \001(\0132\022.contex" + - "t.ServiceId\"T\n\007SliceId\022&\n\ncontext_id\030\001 \001" + - "(\0132\022.context.ContextId\022!\n\nslice_uuid\030\002 \001" + - "(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"\n\010slice_id\030" + - "\001 \001(\0132\020.context.SliceId\022\014\n\004name\030\002 \001(\t\022/\n" + - "\022slice_endpoint_ids\030\003 \003(\0132\023.context.EndP" + - "ointId\022.\n\021slice_constraints\030\004 \003(\0132\023.cont" + - "ext.Constraint\022-\n\021slice_service_ids\030\005 \003(" + - "\0132\022.context.ServiceId\022,\n\022slice_subslice_" + - "ids\030\006 \003(\0132\020.context.SliceId\022*\n\014slice_sta" + - "tus\030\007 \001(\0132\024.context.SliceStatus\022*\n\014slice" + - "_config\030\010 \001(\0132\024.context.SliceConfig\022(\n\013s" + - "lice_owner\030\t \001(\0132\023.context.SliceOwner\022%\n" + - "\ttimestamp\030\n \001(\0132\022.context.Timestamp\"E\n\n" + - "SliceOwner\022!\n\nowner_uuid\030\001 \001(\0132\r.context" + - ".Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013SliceStat" + - "us\022.\n\014slice_status\030\001 \001(\0162\030.context.Slice" + - "StatusEnum\"8\n\013SliceConfig\022)\n\014config_rule" + - "s\030\001 \003(\0132\023.context.ConfigRule\"2\n\013SliceIdL" + - "ist\022#\n\tslice_ids\030\001 \003(\0132\020.context.SliceId" + - "\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.context." + - "Slice\"\312\001\n\013SliceFilter\022\'\n\tslice_ids\030\001 \001(\013" + - "2\024.context.SliceIdList\022\034\n\024include_endpoi" + - "nt_ids\030\002 \001(\010\022\033\n\023include_constraints\030\003 \001(" + - "\010\022\033\n\023include_service_ids\030\004 \001(\010\022\034\n\024includ" + - "e_subslice_ids\030\005 \001(\010\022\034\n\024include_config_r" + - "ules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132" + - "\016.context.Event\022\"\n\010slice_id\030\002 \001(\0132\020.cont" + - "ext.SliceId\"6\n\014ConnectionId\022&\n\017connectio" + - "n_uuid\030\001 \001(\0132\r.context.Uuid\"2\n\025Connectio" + - "nSettings_L0\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"" + - "\236\001\n\025ConnectionSettings_L2\022\027\n\017src_mac_add" + - "ress\030\001 \001(\t\022\027\n\017dst_mac_address\030\002 \001(\t\022\022\n\ne" + - "ther_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls" + - "_label\030\005 \001(\r\022\032\n\022mpls_traffic_class\030\006 \001(\r" + - "\"t\n\025ConnectionSettings_L3\022\026\n\016src_ip_addr" + - "ess\030\001 \001(\t\022\026\n\016dst_ip_address\030\002 \001(\t\022\014\n\004dsc" + - "p\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[" + - "\n\025ConnectionSettings_L4\022\020\n\010src_port\030\001 \001(" + - "\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013" + - "\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSettings\022*\n\002l0" + - "\030\001 \001(\0132\036.context.ConnectionSettings_L0\022*" + - "\n\002l2\030\002 \001(\0132\036.context.ConnectionSettings_" + - "L2\022*\n\002l3\030\003 \001(\0132\036.context.ConnectionSetti" + - "ngs_L3\022*\n\002l4\030\004 \001(\0132\036.context.ConnectionS" + - "ettings_L4\"\363\001\n\nConnection\022,\n\rconnection_" + - "id\030\001 \001(\0132\025.context.ConnectionId\022&\n\nservi" + - "ce_id\030\002 \001(\0132\022.context.ServiceId\0223\n\026path_" + - "hops_endpoint_ids\030\003 \003(\0132\023.context.EndPoi" + - "ntId\022+\n\017sub_service_ids\030\004 \003(\0132\022.context." + - "ServiceId\022-\n\010settings\030\005 \001(\0132\033.context.Co" + - "nnectionSettings\"A\n\020ConnectionIdList\022-\n\016" + - "connection_ids\030\001 \003(\0132\025.context.Connectio" + - "nId\":\n\016ConnectionList\022(\n\013connections\030\001 \003" + - "(\0132\023.context.Connection\"^\n\017ConnectionEve" + - "nt\022\035\n\005event\030\001 \001(\0132\016.context.Event\022,\n\rcon" + - "nection_id\030\002 \001(\0132\025.context.ConnectionId\"" + - "\202\001\n\nEndPointId\022(\n\013topology_id\030\001 \001(\0132\023.co" + - "ntext.TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.co" + - "ntext.DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r." + - "context.Uuid\"\302\001\n\010EndPoint\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\014\n\004name\030\002 \001(" + - "\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020kpi_sample_t" + - "ypes\030\004 \003(\0162\037.kpi_sample_types.KpiSampleT" + - "ype\022,\n\021endpoint_location\030\005 \001(\0132\021.context" + - ".Location\"{\n\014EndPointName\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\023\n\013device_na" + - "me\030\002 \001(\t\022\025\n\rendpoint_name\030\003 \001(\t\022\025\n\rendpo" + - "int_type\030\004 \001(\t\";\n\016EndPointIdList\022)\n\014endp" + - "oint_ids\030\001 \003(\0132\023.context.EndPointId\"A\n\020E" + - "ndPointNameList\022-\n\016endpoint_names\030\001 \003(\0132" + - "\025.context.EndPointName\"A\n\021ConfigRule_Cus" + - "tom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016resource_va" + - "lue\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(\n\013endpoint_" + - "id\030\001 \001(\0132\023.context.EndPointId\022!\n\010rule_se" + - "t\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\nConfigRule\022" + - ")\n\006action\030\001 \001(\0162\031.context.ConfigActionEn" + - "um\022,\n\006custom\030\002 \001(\0132\032.context.ConfigRule_" + - "CustomH\000\022&\n\003acl\030\003 \001(\0132\027.context.ConfigRu" + - "le_ACLH\000B\r\n\013config_rule\"F\n\021Constraint_Cu" + - "stom\022\027\n\017constraint_type\030\001 \001(\t\022\030\n\020constra" + - "int_value\030\002 \001(\t\"E\n\023Constraint_Schedule\022\027" + - "\n\017start_timestamp\030\001 \001(\002\022\025\n\rduration_days" + - "\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010latitude\030\001 \001(\002" + - "\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Location\022\020\n\006regio" + - "n\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001(\0132\025.contex" + - "t.GPS_PositionH\000B\n\n\010location\"l\n\033Constrai" + - "nt_EndPointLocation\022(\n\013endpoint_id\030\001 \001(\013" + - "2\023.context.EndPointId\022#\n\010location\030\002 \001(\0132" + - "\021.context.Location\"Y\n\033Constraint_EndPoin" + - "tPriority\022(\n\013endpoint_id\030\001 \001(\0132\023.context" + - ".EndPointId\022\020\n\010priority\030\002 \001(\r\"0\n\026Constra" + - "int_SLA_Latency\022\026\n\016e2e_latency_ms\030\001 \001(\002\"" + - "0\n\027Constraint_SLA_Capacity\022\025\n\rcapacity_g" + - "bps\030\001 \001(\002\"c\n\033Constraint_SLA_Availability" + - "\022\032\n\022num_disjoint_paths\030\001 \001(\r\022\022\n\nall_acti" + - "ve\030\002 \001(\010\022\024\n\014availability\030\003 \001(\002\"V\n\036Constr" + - "aint_SLA_Isolation_level\0224\n\017isolation_le" + - "vel\030\001 \003(\0162\033.context.IsolationLevelEnum\"\242" + - "\001\n\025Constraint_Exclusions\022\024\n\014is_permanent" + - "\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021.context.Dev" + - "iceId\022)\n\014endpoint_ids\030\003 \003(\0132\023.context.En" + - "dPointId\022!\n\010link_ids\030\004 \003(\0132\017.context.Lin" + - "kId\"\333\004\n\nConstraint\022-\n\006action\030\001 \001(\0162\035.con" + - "text.ConstraintActionEnum\022,\n\006custom\030\002 \001(" + - "\0132\032.context.Constraint_CustomH\000\0220\n\010sched" + - "ule\030\003 \001(\0132\034.context.Constraint_ScheduleH" + - "\000\022A\n\021endpoint_location\030\004 \001(\0132$.context.C" + - "onstraint_EndPointLocationH\000\022A\n\021endpoint" + - "_priority\030\005 \001(\0132$.context.Constraint_End" + - "PointPriorityH\000\0228\n\014sla_capacity\030\006 \001(\0132 ." + - "context.Constraint_SLA_CapacityH\000\0226\n\013sla" + - "_latency\030\007 \001(\0132\037.context.Constraint_SLA_" + - "LatencyH\000\022@\n\020sla_availability\030\010 \001(\0132$.co" + - "ntext.Constraint_SLA_AvailabilityH\000\022@\n\rs" + - "la_isolation\030\t \001(\0132\'.context.Constraint_" + - "SLA_Isolation_levelH\000\0224\n\nexclusions\030\n \001(" + - "\0132\036.context.Constraint_ExclusionsH\000B\014\n\nc" + - "onstraint\"^\n\022TeraFlowController\022&\n\nconte" + - "xt_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_ad" + - "dress\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticat" + - "ionResult\022&\n\ncontext_id\030\001 \001(\0132\022.context." + - "ContextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEven" + - "tTypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EV" + - "ENTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024" + - "\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020DeviceDriverEnu" + - "m\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICED" + - "RIVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANS" + - "PORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVIC" + - "EDRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVIC" + - "EDRIVER_ONF_TR_352\020\005\022\023\n\017DEVICEDRIVER_XR\020" + - "\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020\007\022 \n\034DEVICE" + - "DRIVER_GNMI_OPENCONFIG\020\010*\217\001\n\033DeviceOpera" + - "tionalStatusEnum\022%\n!DEVICEOPERATIONALSTA" + - "TUS_UNDEFINED\020\000\022$\n DEVICEOPERATIONALSTAT" + - "US_DISABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS" + - "_ENABLED\020\002*\225\001\n\017ServiceTypeEnum\022\027\n\023SERVIC" + - "ETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n" + - "\020SERVICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_" + - "CONNECTIVITY_SERVICE\020\003\022\022\n\016SERVICETYPE_TE" + - "\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027SERVICESTATU" + - "S_UNDEFINED\020\000\022\031\n\025SERVICESTATUS_PLANNED\020\001" + - "\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n\026SERVICESTA" + - "TUS_UPDATING\020\003\022!\n\035SERVICESTATUS_PENDING_" + - "REMOVAL\020\004\022\036\n\032SERVICESTATUS_SLA_VIOLATED\020" + - "\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLICESTATUS_UND" + - "EFINED\020\000\022\027\n\023SLICESTATUS_PLANNED\020\001\022\024\n\020SLI" + - "CESTATUS_INIT\020\002\022\026\n\022SLICESTATUS_ACTIVE\020\003\022" + - "\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SLICESTATUS_S" + - "LA_VIOLATED\020\005*]\n\020ConfigActionEnum\022\032\n\026CON" + - "FIGACTION_UNDEFINED\020\000\022\024\n\020CONFIGACTION_SE" + - "T\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*m\n\024Constrai" + - "ntActionEnum\022\036\n\032CONSTRAINTACTION_UNDEFIN" + - "ED\020\000\022\030\n\024CONSTRAINTACTION_SET\020\001\022\033\n\027CONSTR" + - "AINTACTION_DELETE\020\002*\203\002\n\022IsolationLevelEn" + - "um\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSICAL_ISOLATI" + - "ON\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025\n\021PROCESS_I" + - "SOLATION\020\003\022\035\n\031PHYSICAL_MEMORY_ISOLATION\020" + - "\004\022\036\n\032PHYSICAL_NETWORK_ISOLATION\020\005\022\036\n\032VIR" + - "TUAL_RESOURCE_ISOLATION\020\006\022\037\n\033NETWORK_FUN" + - "CTIONS_ISOLATION\020\007\022\025\n\021SERVICE_ISOLATION\020" + - "\0102\245\026\n\016ContextService\022:\n\016ListContextIds\022\016" + - ".context.Empty\032\026.context.ContextIdList\"\000" + - "\0226\n\014ListContexts\022\016.context.Empty\032\024.conte" + - "xt.ContextList\"\000\0224\n\nGetContext\022\022.context" + - ".ContextId\032\020.context.Context\"\000\0224\n\nSetCon" + - "text\022\020.context.Context\032\022.context.Context" + - "Id\"\000\0225\n\rRemoveContext\022\022.context.ContextI" + - "d\032\016.context.Empty\"\000\022=\n\020GetContextEvents\022" + - "\016.context.Empty\032\025.context.ContextEvent\"\000" + - "0\001\022@\n\017ListTopologyIds\022\022.context.ContextI" + - "d\032\027.context.TopologyIdList\"\000\022=\n\016ListTopo" + - "logies\022\022.context.ContextId\032\025.context.Top" + - "ologyList\"\000\0227\n\013GetTopology\022\023.context.Top" + - "ologyId\032\021.context.Topology\"\000\022E\n\022GetTopol" + - "ogyDetails\022\023.context.TopologyId\032\030.contex" + - "t.TopologyDetails\"\000\0227\n\013SetTopology\022\021.con" + - "text.Topology\032\023.context.TopologyId\"\000\0227\n\016" + - "RemoveTopology\022\023.context.TopologyId\032\016.co" + - "ntext.Empty\"\000\022?\n\021GetTopologyEvents\022\016.con" + - "text.Empty\032\026.context.TopologyEvent\"\0000\001\0228" + - "\n\rListDeviceIds\022\016.context.Empty\032\025.contex" + - "t.DeviceIdList\"\000\0224\n\013ListDevices\022\016.contex" + - "t.Empty\032\023.context.DeviceList\"\000\0221\n\tGetDev" + - "ice\022\021.context.DeviceId\032\017.context.Device\"" + - "\000\0221\n\tSetDevice\022\017.context.Device\032\021.contex" + - "t.DeviceId\"\000\0223\n\014RemoveDevice\022\021.context.D" + - "eviceId\032\016.context.Empty\"\000\022;\n\017GetDeviceEv" + - "ents\022\016.context.Empty\032\024.context.DeviceEve" + - "nt\"\0000\001\022<\n\014SelectDevice\022\025.context.DeviceF" + - "ilter\032\023.context.DeviceList\"\000\022I\n\021ListEndP" + - "ointNames\022\027.context.EndPointIdList\032\031.con" + - "text.EndPointNameList\"\000\0224\n\013ListLinkIds\022\016" + - ".context.Empty\032\023.context.LinkIdList\"\000\0220\n" + - "\tListLinks\022\016.context.Empty\032\021.context.Lin" + - "kList\"\000\022+\n\007GetLink\022\017.context.LinkId\032\r.co" + - "ntext.Link\"\000\022+\n\007SetLink\022\r.context.Link\032\017" + - ".context.LinkId\"\000\022/\n\nRemoveLink\022\017.contex" + - "t.LinkId\032\016.context.Empty\"\000\0227\n\rGetLinkEve" + - "nts\022\016.context.Empty\032\022.context.LinkEvent\"" + - "\0000\001\022>\n\016ListServiceIds\022\022.context.ContextI" + - "d\032\026.context.ServiceIdList\"\000\022:\n\014ListServi" + - "ces\022\022.context.ContextId\032\024.context.Servic" + - "eList\"\000\0224\n\nGetService\022\022.context.ServiceI" + - "d\032\020.context.Service\"\000\0224\n\nSetService\022\020.co" + - "ntext.Service\032\022.context.ServiceId\"\000\0226\n\014U" + - "nsetService\022\020.context.Service\032\022.context." + - "ServiceId\"\000\0225\n\rRemoveService\022\022.context.S" + - "erviceId\032\016.context.Empty\"\000\022=\n\020GetService" + - "Events\022\016.context.Empty\032\025.context.Service" + - "Event\"\0000\001\022?\n\rSelectService\022\026.context.Ser" + - "viceFilter\032\024.context.ServiceList\"\000\022:\n\014Li" + - "stSliceIds\022\022.context.ContextId\032\024.context" + - ".SliceIdList\"\000\0226\n\nListSlices\022\022.context.C" + - "ontextId\032\022.context.SliceList\"\000\022.\n\010GetSli" + - "ce\022\020.context.SliceId\032\016.context.Slice\"\000\022." + - "\n\010SetSlice\022\016.context.Slice\032\020.context.Sli" + - "ceId\"\000\0220\n\nUnsetSlice\022\016.context.Slice\032\020.c" + - "ontext.SliceId\"\000\0221\n\013RemoveSlice\022\020.contex" + - "t.SliceId\032\016.context.Empty\"\000\0229\n\016GetSliceE" + - "vents\022\016.context.Empty\032\023.context.SliceEve" + - "nt\"\0000\001\0229\n\013SelectSlice\022\024.context.SliceFil" + - "ter\032\022.context.SliceList\"\000\022D\n\021ListConnect" + - "ionIds\022\022.context.ServiceId\032\031.context.Con" + - "nectionIdList\"\000\022@\n\017ListConnections\022\022.con" + - "text.ServiceId\032\027.context.ConnectionList\"" + - "\000\022=\n\rGetConnection\022\025.context.ConnectionI" + - "d\032\023.context.Connection\"\000\022=\n\rSetConnectio" + - "n\022\023.context.Connection\032\025.context.Connect" + - "ionId\"\000\022;\n\020RemoveConnection\022\025.context.Co" + - "nnectionId\032\016.context.Empty\"\000\022C\n\023GetConne" + - "ctionEvents\022\016.context.Empty\032\030.context.Co" + - "nnectionEvent\"\0000\001b\006proto3" + "\007 \003(\0132\021.context.EndPoint\022&\n\ncomponents\030\010" + + " \003(\0132\022.context.Component\022(\n\rcontroller_i" + + "d\030\t \001(\0132\021.context.DeviceId\"\311\001\n\tComponent" + + "\022%\n\016component_uuid\030\001 \001(\0132\r.context.Uuid\022" + + "\014\n\004name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\0226\n\nattribute" + + "s\030\004 \003(\0132\".context.Component.AttributesEn" + + "try\022\016\n\006parent\030\005 \001(\t\0321\n\017AttributesEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"9\n\014Device" + + "Config\022)\n\014config_rules\030\001 \003(\0132\023.context.C" + + "onfigRule\"5\n\014DeviceIdList\022%\n\ndevice_ids\030" + + "\001 \003(\0132\021.context.DeviceId\".\n\nDeviceList\022 " + + "\n\007devices\030\001 \003(\0132\017.context.Device\"\216\001\n\014Dev" + + "iceFilter\022)\n\ndevice_ids\030\001 \001(\0132\025.context." + + "DeviceIdList\022\031\n\021include_endpoints\030\002 \001(\010\022" + + "\034\n\024include_config_rules\030\003 \001(\010\022\032\n\022include" + + "_components\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005eve" + + "nt\030\001 \001(\0132\016.context.Event\022$\n\tdevice_id\030\002 " + + "\001(\0132\021.context.DeviceId\022,\n\rdevice_config\030" + + "\003 \001(\0132\025.context.DeviceConfig\"*\n\006LinkId\022 " + + "\n\tlink_uuid\030\001 \001(\0132\r.context.Uuid\"f\n\004Link" + + "\022 \n\007link_id\030\001 \001(\0132\017.context.LinkId\022\014\n\004na" + + "me\030\002 \001(\t\022.\n\021link_endpoint_ids\030\003 \003(\0132\023.co" + + "ntext.EndPointId\"/\n\nLinkIdList\022!\n\010link_i" + + "ds\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034\n" + + "\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEvent" + + "\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link_" + + "id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022&" + + "\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022#" + + "\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007" + + "Service\022&\n\nservice_id\030\001 \001(\0132\022.context.Se" + + "rviceId\022\014\n\004name\030\002 \001(\t\022.\n\014service_type\030\003 " + + "\001(\0162\030.context.ServiceTypeEnum\0221\n\024service" + + "_endpoint_ids\030\004 \003(\0132\023.context.EndPointId" + + "\0220\n\023service_constraints\030\005 \003(\0132\023.context." + + "Constraint\022.\n\016service_status\030\006 \001(\0132\026.con" + + "text.ServiceStatus\022.\n\016service_config\030\007 \001" + + "(\0132\026.context.ServiceConfig\022%\n\ttimestamp\030" + + "\010 \001(\0132\022.context.Timestamp\"C\n\rServiceStat" + + "us\0222\n\016service_status\030\001 \001(\0162\032.context.Ser" + + "viceStatusEnum\":\n\rServiceConfig\022)\n\014confi" + + "g_rules\030\001 \003(\0132\023.context.ConfigRule\"8\n\rSe" + + "rviceIdList\022\'\n\013service_ids\030\001 \003(\0132\022.conte" + + "xt.ServiceId\"1\n\013ServiceList\022\"\n\010services\030" + + "\001 \003(\0132\020.context.Service\"\225\001\n\rServiceFilte" + + "r\022+\n\013service_ids\030\001 \001(\0132\026.context.Service" + + "IdList\022\034\n\024include_endpoint_ids\030\002 \001(\010\022\033\n\023" + + "include_constraints\030\003 \001(\010\022\034\n\024include_con" + + "fig_rules\030\004 \001(\010\"U\n\014ServiceEvent\022\035\n\005event" + + "\030\001 \001(\0132\016.context.Event\022&\n\nservice_id\030\002 \001" + + "(\0132\022.context.ServiceId\"T\n\007SliceId\022&\n\ncon" + + "text_id\030\001 \001(\0132\022.context.ContextId\022!\n\nsli" + + "ce_uuid\030\002 \001(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"" + + "\n\010slice_id\030\001 \001(\0132\020.context.SliceId\022\014\n\004na" + + "me\030\002 \001(\t\022/\n\022slice_endpoint_ids\030\003 \003(\0132\023.c" + + "ontext.EndPointId\022.\n\021slice_constraints\030\004" + + " \003(\0132\023.context.Constraint\022-\n\021slice_servi" + + "ce_ids\030\005 \003(\0132\022.context.ServiceId\022,\n\022slic" + + "e_subslice_ids\030\006 \003(\0132\020.context.SliceId\022*" + + "\n\014slice_status\030\007 \001(\0132\024.context.SliceStat" + + "us\022*\n\014slice_config\030\010 \001(\0132\024.context.Slice" + + "Config\022(\n\013slice_owner\030\t \001(\0132\023.context.Sl" + + "iceOwner\022%\n\ttimestamp\030\n \001(\0132\022.context.Ti" + + "mestamp\"E\n\nSliceOwner\022!\n\nowner_uuid\030\001 \001(" + + "\0132\r.context.Uuid\022\024\n\014owner_string\030\002 \001(\t\"=" + + "\n\013SliceStatus\022.\n\014slice_status\030\001 \001(\0162\030.co" + + "ntext.SliceStatusEnum\"8\n\013SliceConfig\022)\n\014" + + "config_rules\030\001 \003(\0132\023.context.ConfigRule\"" + + "2\n\013SliceIdList\022#\n\tslice_ids\030\001 \003(\0132\020.cont" + + "ext.SliceId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\013" + + "2\016.context.Slice\"\312\001\n\013SliceFilter\022\'\n\tslic" + + "e_ids\030\001 \001(\0132\024.context.SliceIdList\022\034\n\024inc" + + "lude_endpoint_ids\030\002 \001(\010\022\033\n\023include_const" + + "raints\030\003 \001(\010\022\033\n\023include_service_ids\030\004 \001(" + + "\010\022\034\n\024include_subslice_ids\030\005 \001(\010\022\034\n\024inclu" + + "de_config_rules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005e" + + "vent\030\001 \001(\0132\016.context.Event\022\"\n\010slice_id\030\002" + + " \001(\0132\020.context.SliceId\"6\n\014ConnectionId\022&" + + "\n\017connection_uuid\030\001 \001(\0132\r.context.Uuid\"2" + + "\n\025ConnectionSettings_L0\022\031\n\021lsp_symbolic_" + + "name\030\001 \001(\t\"\236\001\n\025ConnectionSettings_L2\022\027\n\017" + + "src_mac_address\030\001 \001(\t\022\027\n\017dst_mac_address" + + "\030\002 \001(\t\022\022\n\nether_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 " + + "\001(\r\022\022\n\nmpls_label\030\005 \001(\r\022\032\n\022mpls_traffic_" + + "class\030\006 \001(\r\"t\n\025ConnectionSettings_L3\022\026\n\016" + + "src_ip_address\030\001 \001(\t\022\026\n\016dst_ip_address\030\002" + + " \001(\t\022\014\n\004dscp\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003" + + "ttl\030\005 \001(\r\"[\n\025ConnectionSettings_L4\022\020\n\010sr" + + "c_port\030\001 \001(\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_fl" + + "ags\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSet" + + "tings\022*\n\002l0\030\001 \001(\0132\036.context.ConnectionSe" + + "ttings_L0\022*\n\002l2\030\002 \001(\0132\036.context.Connecti" + + "onSettings_L2\022*\n\002l3\030\003 \001(\0132\036.context.Conn" + + "ectionSettings_L3\022*\n\002l4\030\004 \001(\0132\036.context." + + "ConnectionSettings_L4\"\363\001\n\nConnection\022,\n\r" + + "connection_id\030\001 \001(\0132\025.context.Connection" + + "Id\022&\n\nservice_id\030\002 \001(\0132\022.context.Service" + + "Id\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.con" + + "text.EndPointId\022+\n\017sub_service_ids\030\004 \003(\013" + + "2\022.context.ServiceId\022-\n\010settings\030\005 \001(\0132\033" + + ".context.ConnectionSettings\"A\n\020Connectio" + + "nIdList\022-\n\016connection_ids\030\001 \003(\0132\025.contex" + + "t.ConnectionId\":\n\016ConnectionList\022(\n\013conn" + + "ections\030\001 \003(\0132\023.context.Connection\"^\n\017Co" + + "nnectionEvent\022\035\n\005event\030\001 \001(\0132\016.context.E" + + "vent\022,\n\rconnection_id\030\002 \001(\0132\025.context.Co" + + "nnectionId\"\202\001\n\nEndPointId\022(\n\013topology_id" + + "\030\001 \001(\0132\023.context.TopologyId\022$\n\tdevice_id" + + "\030\002 \001(\0132\021.context.DeviceId\022$\n\rendpoint_uu" + + "id\030\003 \001(\0132\r.context.Uuid\"\302\001\n\010EndPoint\022(\n\013" + + "endpoint_id\030\001 \001(\0132\023.context.EndPointId\022\014" + + "\n\004name\030\002 \001(\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020k" + + "pi_sample_types\030\004 \003(\0162\037.kpi_sample_types" + + ".KpiSampleType\022,\n\021endpoint_location\030\005 \001(" + + "\0132\021.context.Location\"{\n\014EndPointName\022(\n\013" + + "endpoint_id\030\001 \001(\0132\023.context.EndPointId\022\023" + + "\n\013device_name\030\002 \001(\t\022\025\n\rendpoint_name\030\003 \001" + + "(\t\022\025\n\rendpoint_type\030\004 \001(\t\";\n\016EndPointIdL" + + "ist\022)\n\014endpoint_ids\030\001 \003(\0132\023.context.EndP" + + "ointId\"A\n\020EndPointNameList\022-\n\016endpoint_n" + + "ames\030\001 \003(\0132\025.context.EndPointName\"A\n\021Con" + + "figRule_Custom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016" + + "resource_value\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(" + + "\n\013endpoint_id\030\001 \001(\0132\023.context.EndPointId" + + "\022!\n\010rule_set\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\n" + + "ConfigRule\022)\n\006action\030\001 \001(\0162\031.context.Con" + + "figActionEnum\022,\n\006custom\030\002 \001(\0132\032.context." + + "ConfigRule_CustomH\000\022&\n\003acl\030\003 \001(\0132\027.conte" + + "xt.ConfigRule_ACLH\000B\r\n\013config_rule\"F\n\021Co" + + "nstraint_Custom\022\027\n\017constraint_type\030\001 \001(\t" + + "\022\030\n\020constraint_value\030\002 \001(\t\"E\n\023Constraint" + + "_Schedule\022\027\n\017start_timestamp\030\001 \001(\002\022\025\n\rdu" + + "ration_days\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010lat" + + "itude\030\001 \001(\002\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Locati" + + "on\022\020\n\006region\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001" + + "(\0132\025.context.GPS_PositionH\000B\n\n\010location\"" + + "l\n\033Constraint_EndPointLocation\022(\n\013endpoi" + + "nt_id\030\001 \001(\0132\023.context.EndPointId\022#\n\010loca" + + "tion\030\002 \001(\0132\021.context.Location\"Y\n\033Constra" + + "int_EndPointPriority\022(\n\013endpoint_id\030\001 \001(" + + "\0132\023.context.EndPointId\022\020\n\010priority\030\002 \001(\r" + + "\"0\n\026Constraint_SLA_Latency\022\026\n\016e2e_latenc" + + "y_ms\030\001 \001(\002\"0\n\027Constraint_SLA_Capacity\022\025\n" + + "\rcapacity_gbps\030\001 \001(\002\"c\n\033Constraint_SLA_A" + + "vailability\022\032\n\022num_disjoint_paths\030\001 \001(\r\022" + + "\022\n\nall_active\030\002 \001(\010\022\024\n\014availability\030\003 \001(" + + "\002\"V\n\036Constraint_SLA_Isolation_level\0224\n\017i" + + "solation_level\030\001 \003(\0162\033.context.Isolation" + + "LevelEnum\"\242\001\n\025Constraint_Exclusions\022\024\n\014i" + + "s_permanent\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021." + + "context.DeviceId\022)\n\014endpoint_ids\030\003 \003(\0132\023" + + ".context.EndPointId\022!\n\010link_ids\030\004 \003(\0132\017." + + "context.LinkId\"\333\004\n\nConstraint\022-\n\006action\030" + + "\001 \001(\0162\035.context.ConstraintActionEnum\022,\n\006" + + "custom\030\002 \001(\0132\032.context.Constraint_Custom" + + "H\000\0220\n\010schedule\030\003 \001(\0132\034.context.Constrain" + + "t_ScheduleH\000\022A\n\021endpoint_location\030\004 \001(\0132" + + "$.context.Constraint_EndPointLocationH\000\022" + + "A\n\021endpoint_priority\030\005 \001(\0132$.context.Con" + + "straint_EndPointPriorityH\000\0228\n\014sla_capaci" + + "ty\030\006 \001(\0132 .context.Constraint_SLA_Capaci" + + "tyH\000\0226\n\013sla_latency\030\007 \001(\0132\037.context.Cons" + + "traint_SLA_LatencyH\000\022@\n\020sla_availability" + + "\030\010 \001(\0132$.context.Constraint_SLA_Availabi" + + "lityH\000\022@\n\rsla_isolation\030\t \001(\0132\'.context." + + "Constraint_SLA_Isolation_levelH\000\0224\n\nexcl" + + "usions\030\n \001(\0132\036.context.Constraint_Exclus" + + "ionsH\000B\014\n\nconstraint\"^\n\022TeraFlowControll" + + "er\022&\n\ncontext_id\030\001 \001(\0132\022.context.Context" + + "Id\022\022\n\nip_address\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024" + + "AuthenticationResult\022&\n\ncontext_id\030\001 \001(\013" + + "2\022.context.ContextId\022\025\n\rauthenticated\030\002 " + + "\001(\010*j\n\rEventTypeEnum\022\027\n\023EVENTTYPE_UNDEFI" + + "NED\020\000\022\024\n\020EVENTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE" + + "_UPDATE\020\002\022\024\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020Devi" + + "ceDriverEnum\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000" + + "\022\033\n\027DEVICEDRIVER_OPENCONFIG\020\001\022\036\n\032DEVICED" + + "RIVER_TRANSPORT_API\020\002\022\023\n\017DEVICEDRIVER_P4" + + "\020\003\022&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY" + + "\020\004\022\033\n\027DEVICEDRIVER_ONF_TR_532\020\005\022\023\n\017DEVIC" + + "EDRIVER_XR\020\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020" + + "\007\022 \n\034DEVICEDRIVER_GNMI_OPENCONFIG\020\010*\217\001\n\033" + + "DeviceOperationalStatusEnum\022%\n!DEVICEOPE" + + "RATIONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPER" + + "ATIONALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERAT" + + "IONALSTATUS_ENABLED\020\002*\225\001\n\017ServiceTypeEnu" + + "m\022\027\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYP" + + "E_L3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVIC" + + "ETYPE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SER" + + "VICETYPE_TE\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027S" + + "ERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATU" + + "S_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n" + + "\026SERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTAT" + + "US_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_SL" + + "A_VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLIC" + + "ESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLANN" + + "ED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTATU" + + "S_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SL" + + "ICESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigAction" + + "Enum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CONF" + + "IGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*" + + "m\n\024ConstraintActionEnum\022\036\n\032CONSTRAINTACT" + + "ION_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET\020" + + "\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isola" + + "tionLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSI" + + "CAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025" + + "\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMORY" + + "_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLATI" + + "ON\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n\033" + + "NETWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVICE" + + "_ISOLATION\020\0102\245\026\n\016ContextService\022:\n\016ListC" + + "ontextIds\022\016.context.Empty\032\026.context.Cont" + + "extIdList\"\000\0226\n\014ListContexts\022\016.context.Em" + + "pty\032\024.context.ContextList\"\000\0224\n\nGetContex" + + "t\022\022.context.ContextId\032\020.context.Context\"" + + "\000\0224\n\nSetContext\022\020.context.Context\032\022.cont" + + "ext.ContextId\"\000\0225\n\rRemoveContext\022\022.conte" + + "xt.ContextId\032\016.context.Empty\"\000\022=\n\020GetCon" + + "textEvents\022\016.context.Empty\032\025.context.Con" + + "textEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.conte" + + "xt.ContextId\032\027.context.TopologyIdList\"\000\022" + + "=\n\016ListTopologies\022\022.context.ContextId\032\025." + + "context.TopologyList\"\000\0227\n\013GetTopology\022\023." + + "context.TopologyId\032\021.context.Topology\"\000\022" + + "E\n\022GetTopologyDetails\022\023.context.Topology" + + "Id\032\030.context.TopologyDetails\"\000\0227\n\013SetTop" + + "ology\022\021.context.Topology\032\023.context.Topol" + + "ogyId\"\000\0227\n\016RemoveTopology\022\023.context.Topo" + + "logyId\032\016.context.Empty\"\000\022?\n\021GetTopologyE" + + "vents\022\016.context.Empty\032\026.context.Topology" + + "Event\"\0000\001\0228\n\rListDeviceIds\022\016.context.Emp" + + "ty\032\025.context.DeviceIdList\"\000\0224\n\013ListDevic" + + "es\022\016.context.Empty\032\023.context.DeviceList\"" + + "\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.cont" + + "ext.Device\"\000\0221\n\tSetDevice\022\017.context.Devi" + + "ce\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022" + + "\021.context.DeviceId\032\016.context.Empty\"\000\022;\n\017" + + "GetDeviceEvents\022\016.context.Empty\032\024.contex" + + "t.DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.cont" + + "ext.DeviceFilter\032\023.context.DeviceList\"\000\022" + + "I\n\021ListEndPointNames\022\027.context.EndPointI" + + "dList\032\031.context.EndPointNameList\"\000\0224\n\013Li" + + "stLinkIds\022\016.context.Empty\032\023.context.Link" + + "IdList\"\000\0220\n\tListLinks\022\016.context.Empty\032\021." + + "context.LinkList\"\000\022+\n\007GetLink\022\017.context." + + "LinkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.con" + + "text.Link\032\017.context.LinkId\"\000\022/\n\nRemoveLi" + + "nk\022\017.context.LinkId\032\016.context.Empty\"\000\0227\n" + + "\rGetLinkEvents\022\016.context.Empty\032\022.context" + + ".LinkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.conte" + + "xt.ContextId\032\026.context.ServiceIdList\"\000\022:" + + "\n\014ListServices\022\022.context.ContextId\032\024.con" + + "text.ServiceList\"\000\0224\n\nGetService\022\022.conte" + + "xt.ServiceId\032\020.context.Service\"\000\0224\n\nSetS" + + "ervice\022\020.context.Service\032\022.context.Servi" + + "ceId\"\000\0226\n\014UnsetService\022\020.context.Service" + + "\032\022.context.ServiceId\"\000\0225\n\rRemoveService\022" + + "\022.context.ServiceId\032\016.context.Empty\"\000\022=\n" + + "\020GetServiceEvents\022\016.context.Empty\032\025.cont" + + "ext.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026." + + "context.ServiceFilter\032\024.context.ServiceL" + + "ist\"\000\022:\n\014ListSliceIds\022\022.context.ContextI" + + "d\032\024.context.SliceIdList\"\000\0226\n\nListSlices\022" + + "\022.context.ContextId\032\022.context.SliceList\"" + + "\000\022.\n\010GetSlice\022\020.context.SliceId\032\016.contex" + + "t.Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020." + + "context.SliceId\"\000\0220\n\nUnsetSlice\022\016.contex" + + "t.Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSli" + + "ce\022\020.context.SliceId\032\016.context.Empty\"\000\0229" + + "\n\016GetSliceEvents\022\016.context.Empty\032\023.conte" + + "xt.SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.conte" + + "xt.SliceFilter\032\022.context.SliceList\"\000\022D\n\021" + + "ListConnectionIds\022\022.context.ServiceId\032\031." + + "context.ConnectionIdList\"\000\022@\n\017ListConnec" + + "tions\022\022.context.ServiceId\032\027.context.Conn" + + "ectionList\"\000\022=\n\rGetConnection\022\025.context." + + "ConnectionId\032\023.context.Connection\"\000\022=\n\rS" + + "etConnection\022\023.context.Connection\032\025.cont" + + "ext.ConnectionId\"\000\022;\n\020RemoveConnection\022\025" + + ".context.ConnectionId\032\016.context.Empty\"\000\022" + + "C\n\023GetConnectionEvents\022\016.context.Empty\032\030" + + ".context.ConnectionEvent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -74435,13 +75269,19 @@ public final class ContextOuterClass { internal_static_context_Device_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Device_descriptor, - new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Component", "ControllerId", }); + new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Components", "ControllerId", }); internal_static_context_Component_descriptor = getDescriptor().getMessageTypes().get(17); internal_static_context_Component_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Component_descriptor, - new java.lang.String[] { "CompString", }); + new java.lang.String[] { "ComponentUuid", "Name", "Type", "Attributes", "Parent", }); + internal_static_context_Component_AttributesEntry_descriptor = + internal_static_context_Component_descriptor.getNestedTypes().get(0); + internal_static_context_Component_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Component_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); internal_static_context_DeviceConfig_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_context_DeviceConfig_fieldAccessorTable = new diff --git a/src/policy/target/kubernetes/kubernetes.yml b/src/policy/target/kubernetes/kubernetes.yml index 8407a7ed4681a8a2a535238f2ac849e9a16e61a9..9c17b78739e5b85b40341276958f025795c43b4f 100644 --- a/src/policy/target/kubernetes/kubernetes.yml +++ b/src/policy/target/kubernetes/kubernetes.yml @@ -3,8 +3,8 @@ apiVersion: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 253c09f7b13dadba57439fb61916ecde0b7af751 - app.quarkus.io/build-timestamp: 2023-10-02 - 10:48:40 +0000 + app.quarkus.io/commit-id: 447bcf0c8224e0b15715f54d82a0936dd93f5542 + app.quarkus.io/build-timestamp: 2023-11-07 - 12:10:37 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" @@ -29,8 +29,8 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 253c09f7b13dadba57439fb61916ecde0b7af751 - app.quarkus.io/build-timestamp: 2023-10-02 - 10:48:40 +0000 + app.quarkus.io/commit-id: 447bcf0c8224e0b15715f54d82a0936dd93f5542 + app.quarkus.io/build-timestamp: 2023-11-07 - 12:10:37 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" @@ -47,8 +47,8 @@ spec: template: metadata: annotations: - app.quarkus.io/commit-id: 253c09f7b13dadba57439fb61916ecde0b7af751 - app.quarkus.io/build-timestamp: 2023-10-02 - 10:48:40 +0000 + app.quarkus.io/commit-id: 447bcf0c8224e0b15715f54d82a0936dd93f5542 + app.quarkus.io/build-timestamp: 2023-11-07 - 12:10:37 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" diff --git a/src/service/Dockerfile b/src/service/Dockerfile index 5988374e07a731c0f99f732a271c767e16281114..fc431decabe2e1c90b6dcd0dfcfcc72090571751 100644 --- a/src/service/Dockerfile +++ b/src/service/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/service/service/service_handler_api/FilterFields.py b/src/service/service/service_handler_api/FilterFields.py index 1b22c5c42e908e9b9455358edd2abf54442628f5..430e25938601d522187046b0ebd4cad6971261bb 100644 --- a/src/service/service/service_handler_api/FilterFields.py +++ b/src/service/service/service_handler_api/FilterFields.py @@ -33,7 +33,7 @@ DEVICE_DRIVER_VALUES = { DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API, DeviceDriverEnum.DEVICEDRIVER_P4, DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, - DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352, + DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532, DeviceDriverEnum.DEVICEDRIVER_XR, DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN, DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG, diff --git a/src/service/service/service_handlers/__init__.py b/src/service/service/service_handlers/__init__.py index 7ea0d4f627b5d6010f6e40135f6005471efe8d71..cb926e5b767ae56ea2024aad7cb9afa632f9d6bb 100644 --- a/src/service/service/service_handlers/__init__.py +++ b/src/service/service/service_handlers/__init__.py @@ -71,7 +71,7 @@ SERVICE_HANDLERS = [ (MicrowaveServiceHandler, [ { FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_L2NM, - FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352], + FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532], } ]), (P4ServiceHandler, [ diff --git a/src/slice/Dockerfile b/src/slice/Dockerfile index 4c434e212da441c5a56e58e9a9509195c202355f..94d5fc040dff083407cae514ed0363b5d2ea9bb1 100644 --- a/src/slice/Dockerfile +++ b/src/slice/Dockerfile @@ -16,7 +16,7 @@ FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ + apt-get --yes --quiet --quiet install wget g++ git && \ rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/te/config/sys.config.src b/src/te/config/sys.config.src index edcd4384a3236df42b1e530c8b3a92b96c80e09e..0d57845070f53734fe413de80ff77ddf780d09ff 100644 --- a/src/te/config/sys.config.src +++ b/src/te/config/sys.config.src @@ -36,8 +36,8 @@ {context, [ {http, {env, "CONTEXTSERVICE_SERVICE_HOST"}, {env, "CONTEXTSERVICE_SERVICE_PORT_GRPC"}, []} ], #{}}, - {automation, [ - {http, {env, "AUTOMATIONSERVICE_SERVICE_HOST"}, {env, "AUTOMATIONSERVICE_SERVICE_PORT_GRPC"}, []} + {ztp, [ + {http, {env, "ZTPSERVICE_SERVICE_HOST"}, {env, "ZTPSERVICE_SERVICE_PORT_GRPC"}, []} ], #{}} ]} ]}, @@ -98,4 +98,4 @@ }} ]} ]} -]. \ No newline at end of file +]. diff --git a/src/te/tests/deploy_specs.sh b/src/te/tests/deploy_specs.sh index 818fb2b0d69ae63b197a83683e68aed96e50d6e2..ebc5ac1d678ba833b72d3288b4d45e1efad0520a 100644 --- a/src/te/tests/deploy_specs.sh +++ b/src/te/tests/deploy_specs.sh @@ -25,8 +25,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/benchmark/policy/deploy_specs.sh b/src/tests/benchmark/policy/deploy_specs.sh index 7d408f003ce411566b9bf2435d89c72ff5db1459..51bc99cf7ae6cc7ecfc4cbd79bca19e9fcbdc353 100644 --- a/src/tests/benchmark/policy/deploy_specs.sh +++ b/src/tests/benchmark/policy/deploy_specs.sh @@ -19,7 +19,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui" +export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice compute webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/src/tests/benchmark/automation/.gitignore b/src/tests/benchmark/ztp/.gitignore similarity index 100% rename from src/tests/benchmark/automation/.gitignore rename to src/tests/benchmark/ztp/.gitignore diff --git a/src/tests/benchmark/automation/README.md b/src/tests/benchmark/ztp/README.md similarity index 100% rename from src/tests/benchmark/automation/README.md rename to src/tests/benchmark/ztp/README.md diff --git a/src/tests/benchmark/automation/ZtpAdd.js b/src/tests/benchmark/ztp/ZtpAdd.js similarity index 92% rename from src/tests/benchmark/automation/ZtpAdd.js rename to src/tests/benchmark/ztp/ZtpAdd.js index d7740ad32c8b685a31a31c5fc09a7a7cc6ef27a0..3d7a7831a0cd9dfc73eab8133681ecd20d2f81ef 100644 --- a/src/tests/benchmark/automation/ZtpAdd.js +++ b/src/tests/benchmark/ztp/ZtpAdd.js @@ -19,7 +19,7 @@ import exec from "k6/execution"; import { check, sleep } from 'k6'; const client = new grpc.Client(); -client.load(['../../../../proto'], 'automation.proto'); +client.load(['../../../../proto'], 'ztp.proto'); export const data = []; for (let i = 1; i < 801; i++) { @@ -51,7 +51,7 @@ export default () => { }); var item = data[exec.scenario.iterationInInstance]; - const response = client.invoke('automation.AutomationService/ZtpAdd', item); + const response = client.invoke('ztp.ZTPService/ZtpAdd', item); check(response, { 'status is OK': (r) => r && r.status === grpc.StatusOK, diff --git a/src/tests/benchmark/automation/ZtpDelete.js b/src/tests/benchmark/ztp/ZtpDelete.js similarity index 92% rename from src/tests/benchmark/automation/ZtpDelete.js rename to src/tests/benchmark/ztp/ZtpDelete.js index b1b7f3a09734d484ef14868cbf93c87dce79f357..4b5d41340a9ac4d42899a996380a3bc5203bc1fd 100644 --- a/src/tests/benchmark/automation/ZtpDelete.js +++ b/src/tests/benchmark/ztp/ZtpDelete.js @@ -19,7 +19,7 @@ import exec from "k6/execution"; import { check, sleep } from 'k6'; const client = new grpc.Client(); -client.load(['../../../../proto'], 'automation.proto'); +client.load(['../../../../proto'], 'ztp.proto'); export const data = []; for (let i = 1; i < 801; i++) { @@ -51,7 +51,7 @@ export default () => { }); var item = data[exec.scenario.iterationInInstance]; - const response = client.invoke('automation.AutomationService/ZtpDelete', item); + const response = client.invoke('ztp.ZTPService/ZtpDelete', item); check(response, { 'status is OK': (r) => r && r.status === grpc.StatusOK, diff --git a/src/tests/benchmark/automation/ZtpUpdate.js b/src/tests/benchmark/ztp/ZtpUpdate.js similarity index 93% rename from src/tests/benchmark/automation/ZtpUpdate.js rename to src/tests/benchmark/ztp/ZtpUpdate.js index c274d22861ae6df52906d57cfb545eb1dc3c94c2..61d38bc993d7ceeda9c8c7ce29e1b9804e6825f4 100644 --- a/src/tests/benchmark/automation/ZtpUpdate.js +++ b/src/tests/benchmark/ztp/ZtpUpdate.js @@ -19,7 +19,7 @@ import exec from "k6/execution"; import { check, sleep } from 'k6'; const client = new grpc.Client(); -client.load(['../../../../proto'], 'automation.proto'); +client.load(['../../../../proto'], 'ztp.proto'); export const data = []; for (let i = 1; i < 801; i++) { @@ -56,7 +56,7 @@ export default () => { }); var item = data[exec.scenario.iterationInInstance]; - const response = client.invoke('automation.AutomationService/ZtpUpdate', item); + const response = client.invoke('ztp.ZTPService/ZtpUpdate', item); check(response, { 'status is OK': (r) => r && r.status === grpc.StatusOK, diff --git a/src/tests/benchmark/automation/__init__.py b/src/tests/benchmark/ztp/__init__.py similarity index 100% rename from src/tests/benchmark/automation/__init__.py rename to src/tests/benchmark/ztp/__init__.py diff --git a/src/tests/benchmark/automation/run_test_01_bootstrap.sh b/src/tests/benchmark/ztp/run_test_01_bootstrap.sh similarity index 90% rename from src/tests/benchmark/automation/run_test_01_bootstrap.sh rename to src/tests/benchmark/ztp/run_test_01_bootstrap.sh index 2382521b26cbf6217aacea7c2f9d86fdac1209be..bbd0b5111ab3ddb05513396b253fe4c7e630d3a5 100755 --- a/src/tests/benchmark/automation/run_test_01_bootstrap.sh +++ b/src/tests/benchmark/ztp/run_test_01_bootstrap.sh @@ -14,4 +14,4 @@ # limitations under the License. source tfs_runtime_env_vars.sh -pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/automation/tests/test_functional_bootstrap.py +pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/ztp/tests/test_functional_bootstrap.py diff --git a/src/tests/benchmark/automation/run_test_02_cleanup.sh b/src/tests/benchmark/ztp/run_test_02_cleanup.sh similarity index 91% rename from src/tests/benchmark/automation/run_test_02_cleanup.sh rename to src/tests/benchmark/ztp/run_test_02_cleanup.sh index 56965d2007b441ab76ab07777a04c25b38eb8b28..6b98bca0097b17c96793c9168c0976bd1e48fe3a 100755 --- a/src/tests/benchmark/automation/run_test_02_cleanup.sh +++ b/src/tests/benchmark/ztp/run_test_02_cleanup.sh @@ -14,4 +14,4 @@ # limitations under the License. source tfs_runtime_env_vars.sh -pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/automation/tests/test_functional_cleanup.py +pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/ztp/tests/test_functional_cleanup.py diff --git a/src/tests/benchmark/automation/tests/.gitignore b/src/tests/benchmark/ztp/tests/.gitignore similarity index 100% rename from src/tests/benchmark/automation/tests/.gitignore rename to src/tests/benchmark/ztp/tests/.gitignore diff --git a/src/tests/benchmark/automation/tests/Fixtures.py b/src/tests/benchmark/ztp/tests/Fixtures.py similarity index 100% rename from src/tests/benchmark/automation/tests/Fixtures.py rename to src/tests/benchmark/ztp/tests/Fixtures.py diff --git a/src/tests/benchmark/automation/tests/Objects.py b/src/tests/benchmark/ztp/tests/Objects.py similarity index 100% rename from src/tests/benchmark/automation/tests/Objects.py rename to src/tests/benchmark/ztp/tests/Objects.py diff --git a/src/tests/benchmark/automation/tests/__init__.py b/src/tests/benchmark/ztp/tests/__init__.py similarity index 100% rename from src/tests/benchmark/automation/tests/__init__.py rename to src/tests/benchmark/ztp/tests/__init__.py diff --git a/src/tests/benchmark/automation/tests/test_functional_bootstrap.py b/src/tests/benchmark/ztp/tests/test_functional_bootstrap.py similarity index 100% rename from src/tests/benchmark/automation/tests/test_functional_bootstrap.py rename to src/tests/benchmark/ztp/tests/test_functional_bootstrap.py diff --git a/src/tests/benchmark/automation/tests/test_functional_cleanup.py b/src/tests/benchmark/ztp/tests/test_functional_cleanup.py similarity index 100% rename from src/tests/benchmark/automation/tests/test_functional_cleanup.py rename to src/tests/benchmark/ztp/tests/test_functional_cleanup.py diff --git a/src/tests/ecoc22/deploy_specs.sh b/src/tests/ecoc22/deploy_specs.sh index b1ee5ef6d6e500078bf0e170af5dfb32f01df088..4a12c3b2df5af430b88281e73ff4d0768a33f91d 100755 --- a/src/tests/ecoc22/deploy_specs.sh +++ b/src/tests/ecoc22/deploy_specs.sh @@ -26,8 +26,8 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/hackfest3/commands.txt b/src/tests/hackfest3/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..0db6497122c4ac3f7de52057cd41e257f4cb37af --- /dev/null +++ b/src/tests/hackfest3/commands.txt @@ -0,0 +1,111 @@ +################## TFS deployment and setup ####################### + +###### Deployment +# To deploy TFS: +cd ~/contoller +source my_deploy.sh +./deploy.sh + +###### Experiments +# To onboard the experiment +cd ~/contoller + +# Setup the compiled files +./src/tests/hackfest3/setup.sh + +# Register the devices +./src/tests/hackfest3/run_test_01_bootstrap.sh + +# Create the service +./src/tests/hackfest3/run_test_02_create_service.sh + +# Delete the service +./src/tests/hackfest3/run_test_03_delete_service.sh + +# Cleanup TFS +./src/tests/hackfest3/run_test_04_cleanup.sh + + +########################## MININET ################## +# To get the mininet cli +cd ~/ngsdn-tutorial +make mn-cli + +#### screen +# To open a screen in mininet + # For client + MN: client screen -S <name> + + # For server + MN: server screen -S <name> + +# To get out +Press <Ctrl+A> + d + +# To reconnect +MN: client screen -r <name> + + +####################### PROBE ###################### +### old probe +# agent +source tfs_runtime_env_vars.sh + +cd ~/controller/src/tests/hackfest3/probe/probe-tfs + +./deploy.sh +./connect_to_mininet.sh +./tfsagent + +# pinger +# In mininet +cd ~/ngsdn-tutorial +make mn-cli +MN: client ./tfsping + + +### new probe +cd ~/controller/src/tests/hackfest3/new-probe +./copy.sh + +# agent: +# import PYTHONPATH by tfs_enviromental variables +source tfs_runtime_env_vars.sh +python agent.py + +# pinger +# In mininet +cd ~/ngsdn-tutorial +make mn-cli +MN: client python ping2.py 10.0.0.2 + +# To enter delay or packet loss +cd ~/controller/src/tests/hackfest3/new-probe +./connect_to_mininet.sh +tc qdisc add dev <switch-iface> root netem delay <x>ms +tc qdisc add dev <switch-iface> root netem loss <x>% + +################ INT (interactive session 2) ########### +# build the new code +cd ~/controller/src/tests/hackfest3/int +build_p4.sh <p4-program to build> + +# copy the receiver, sender and helper script to docker container +cd ~/controller/src/tests/hackfest3/int +./copy_int_helpers.sh +./connect_to_mininet.sh +./install-scapy.sh + +# Run the receiver in server screen +cd ~/ngsdn-tutorial +make mn-cli +MN: server screen -S rec + MN/Screen: python receive.py + <Ctrl+A> + d + +# Run the sender in client +MN: client python send.py 10.0.0.1 "test" 1 + +# Check the output in receiver +MN: server screen -r rec + <Ctrl+A> + d diff --git a/src/tests/hackfest3/deploy_specs.sh b/src/tests/hackfest3/deploy_specs.sh index 862c1e533d921da113aab21165ea8cd61a214f1f..d3f2b5566ec47e58bad906ffa465d22842de2776 100755 --- a/src/tests/hackfest3/deploy_specs.sh +++ b/src/tests/hackfest3/deploy_specs.sh @@ -29,7 +29,7 @@ export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" export TFS_COMPONENTS="${TFS_COMPONENTS} policy" # Uncomment to activate Automation Manager -export TFS_COMPONENTS="${TFS_COMPONENTS} automation" +#export TFS_COMPONENTS="${TFS_COMPONENTS} automation" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/hackfest3/grafana/dashboard.json b/src/tests/hackfest3/grafana/dashboard.json new file mode 100644 index 0000000000000000000000000000000000000000..1c464cecf5304e56c2fd871f99e3e44457fb919a --- /dev/null +++ b/src/tests/hackfest3/grafana/dashboard.json @@ -0,0 +1,276 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 11, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "WdiCIPwVk" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "State" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "ACTIVE": { + "color": "green", + "index": 2 + }, + "ENFORCED": { + "color": "red", + "index": 3 + }, + "PROVISIONED": { + "color": "yellow", + "index": 1 + }, + "VALIDATED": { + "color": "blue", + "index": 0 + } + }, + "type": "value" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 4, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^State$/", + "values": true + }, + "textMode": "auto" + }, + "pluginVersion": "8.5.22", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "WdiCIPwVk" + }, + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n updated_at as \"time\",\n policyrule_state as \"State\"\nFROM policyrule\nORDER BY 1", + "refId": "A", + "select": [ + [ + { + "params": [ + "policyrule_state" + ], + "type": "column" + } + ] + ], + "table": "policyrule", + "timeColumn": "updated_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Policy State", + "type": "stat" + }, + { + "datasource": { + "type": "postgres", + "uid": "nSmCIEw4k" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "latency", + "axisPlacement": "right", + "axisSoftMin": -1, + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "line+area" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "orange", + "value": 10000 + } + ] + }, + "unit": "µs" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 4 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "nSmCIEw4k" + }, + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n timestamp AS \"time\",\n kpi_value AS metric\nFROM tfs_monitoring_kpis\nWHERE\n $__timeFilter(timestamp)\nORDER BY timestamp", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "end-to-end latency", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 36, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "HPSR23", + "uid": "F-t42xU4z", + "version": 1, + "weekStart": "" +} diff --git a/src/tests/hackfest3/grafana/only_metrics.json b/src/tests/hackfest3/grafana/only_metrics.json new file mode 100644 index 0000000000000000000000000000000000000000..966fb738e8292dc7ce6b873a8b0c206ad8c95382 --- /dev/null +++ b/src/tests/hackfest3/grafana/only_metrics.json @@ -0,0 +1,157 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 11, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "3xPv3eMIk" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "3xPv3eMIk" + }, + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n timestamp AS \"time\",\n kpi_value AS metric\nFROM tfs_monitoring_kpis\nWHERE\n $__timeFilter(timestamp)\nORDER BY timestamp", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Panel Title", + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 36, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "hackfest3", + "uid": "SNg63eGSk", + "version": 1, + "weekStart": "" +} diff --git a/src/tests/hackfest3/grpc/addPolicy.sh b/src/tests/hackfest3/grpc/addPolicy.sh new file mode 100755 index 0000000000000000000000000000000000000000..71300d3ac00ff99786947cdc56b3776f858fcd3e --- /dev/null +++ b/src/tests/hackfest3/grpc/addPolicy.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +./grpcurl/grpcurl -plaintext -d @ localhost:30060 policy.PolicyService/PolicyAddService < policyAddService.json diff --git a/src/tests/hackfest3/grpc/grpcurl/LICENSE b/src/tests/hackfest3/grpc/grpcurl/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6b678c507101c0682cfcd340bc97522ccabe7e4d --- /dev/null +++ b/src/tests/hackfest3/grpc/grpcurl/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 FullStory, Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/src/tests/hackfest3/grpc/grpcurl/grpcurl b/src/tests/hackfest3/grpc/grpcurl/grpcurl new file mode 100755 index 0000000000000000000000000000000000000000..89a7bd8bfea5ba8d3baa8c636e779a97c0e47448 Binary files /dev/null and b/src/tests/hackfest3/grpc/grpcurl/grpcurl differ diff --git a/src/tests/hackfest3/grpc/policyAddService.json b/src/tests/hackfest3/grpc/policyAddService.json new file mode 100644 index 0000000000000000000000000000000000000000..5cada37425fce4851303858281032373d558dd68 --- /dev/null +++ b/src/tests/hackfest3/grpc/policyAddService.json @@ -0,0 +1,48 @@ +{ + "serviceId": { + "context_id": { + "context_uuid": { + "uuid": "43813baf-195e-5da6-af20-b3d0922e71a7" + } + }, + "service_uuid": { + "uuid": "c7d6c3f4-395e-5973-98d3-8d90f8fc9141" + } + }, + "policyRuleBasic": { + "priority": 0, + "policyRuleId": { + "uuid": { + "uuid": "1" + } + }, + "booleanOperator": "POLICYRULE_CONDITION_BOOLEAN_OR", + "policyRuleState": { + "policyRuleStateMessage": "" + }, + "actionList": [ + { + "action": "POLICY_RULE_ACTION_RECALCULATE_PATH", + "action_config": [ + { + "action_key": "", + "action_value": "" + } + ] + } + ], + "conditionList": [ + { + "numericalOperator": "POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN", + "kpiValue": { + "floatVal": 10000 + }, + "kpiId": { + "kpi_id": { + "uuid": "1" + } + } + } + ] + } +} diff --git a/src/tests/hackfest3/grpc/removePolicy.sh b/src/tests/hackfest3/grpc/removePolicy.sh new file mode 100755 index 0000000000000000000000000000000000000000..fc6103f41224915abdae1c6688b1284d3e5f21ae --- /dev/null +++ b/src/tests/hackfest3/grpc/removePolicy.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Remove policy +./grpcurl/grpcurl -plaintext -d @ localhost:30060 policy.PolicyService/PolicyDelete < removePolicyRule.json diff --git a/src/tests/hackfest3/grpc/removePolicyRule.json b/src/tests/hackfest3/grpc/removePolicyRule.json new file mode 100644 index 0000000000000000000000000000000000000000..2abe6aeb26a9ce1d278dedec8a8bb0f383bb23f8 --- /dev/null +++ b/src/tests/hackfest3/grpc/removePolicyRule.json @@ -0,0 +1,5 @@ +{ + "uuid": { + "uuid": "c4b5e66e-fa99-5075-9b6e-760476791fc1" + } +} diff --git a/src/tests/hackfest3/int/build_p4.sh b/src/tests/hackfest3/int/build_p4.sh new file mode 100755 index 0000000000000000000000000000000000000000..184fe17ec6271ef689f2aa2b280c8e9b1b8c6ee2 --- /dev/null +++ b/src/tests/hackfest3/int/build_p4.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +get_next_backup_dir() { + local prefix="/home/teraflow/controller/src/tests/hackfest3/p4/backup" + local num=1 + + while [[ -d "$prefix$num" ]]; do + ((num++)) + done + + echo "$prefix$num" +} + +backup_dir=$(get_next_backup_dir) +mkdir "$backup_dir" + +if [[ -d "$backup_dir" ]]; then + mv ~/controller/src/tests/hackfest3/p4/*json "$backup_dir" + mv ~/controller/src/tests/hackfest3/p4/*p4 "$backup_dir" + mv ~/controller/src/tests/hackfest3/p4/*txt "$backup_dir" +else + echo "Backup directory not created. Files were not moved." +fi + +cp $1 ~/controller/src/tests/hackfest3/p4/ + +rm -rf ~/ngsdn-tutorial/p4src/* +cp $1 ~/ngsdn-tutorial/p4src/main.p4 +cd ~/ngsdn-tutorial +make p4-build + +cp ~/ngsdn-tutorial/p4src/build/* ~/controller/src/tests/hackfest3/p4/ diff --git a/src/tests/hackfest3/int/connect_to_mininet.sh b/src/tests/hackfest3/int/connect_to_mininet.sh new file mode 100755 index 0000000000000000000000000000000000000000..a82d3767fc2669e7627bee0b5ca60e5626c920f2 --- /dev/null +++ b/src/tests/hackfest3/int/connect_to_mininet.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker exec -it $CONTAINER /bin/bash diff --git a/src/tests/hackfest3/int/copy_int_helpers.sh b/src/tests/hackfest3/int/copy_int_helpers.sh new file mode 100755 index 0000000000000000000000000000000000000000..726ff55dfb512a34819063bd0bddddb5ad076ce3 --- /dev/null +++ b/src/tests/hackfest3/int/copy_int_helpers.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# get container id +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker cp send.py $CONTAINER:/root +docker cp receive.py $CONTAINER:/root +docker cp install-scapy.sh $CONTAINER:/root diff --git a/src/tests/hackfest3/int/install-scapy.sh b/src/tests/hackfest3/int/install-scapy.sh new file mode 100755 index 0000000000000000000000000000000000000000..9cfa948f682400032af18d1595a3a79009dc3c49 --- /dev/null +++ b/src/tests/hackfest3/int/install-scapy.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list +sed -i 's|security.debian.org|archive.debian.org/debian-security/|g' /etc/apt/sources.list +sed -i '/stretch-updates/d' /etc/apt/sources.list +chmod 1777 /tmp +apt update +apt install -y python-scapy diff --git a/src/tests/hackfest3/int/qdepth_int_basic.p4 b/src/tests/hackfest3/int/qdepth_int_basic.p4 new file mode 100644 index 0000000000000000000000000000000000000000..6bef091b96f4a4b59b50a3d97224e003abe2acf0 --- /dev/null +++ b/src/tests/hackfest3/int/qdepth_int_basic.p4 @@ -0,0 +1,278 @@ +/* + * Copyright 2019-present Open Networking Foundation + * + * 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. + */ + + +#include <core.p4> +#include <v1model.p4> + +typedef bit<9> port_num_t; +typedef bit<48> mac_addr_t; + +//------------------------------------------------------------------------------ +// HEADER DEFINITIONS +//------------------------------------------------------------------------------ + +#define MAX_INT_HEADERS 9 + +const bit<16> TYPE_IPV4 = 0x800; +const bit<5> IPV4_OPTION_INT = 31; + +typedef bit<9> egressSpec_t; +typedef bit<48> macAddr_t; +typedef bit<32> ip4Addr_t; + +typedef bit<13> switch_id_t; +typedef bit<13> queue_depth_t; +typedef bit<6> output_port_t; + +header ethernet_t { + macAddr_t dstAddr; + macAddr_t srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<6> dscp; + bit<2> ecn; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + ip4Addr_t srcAddr; + ip4Addr_t dstAddr; +} + +header ipv4_option_t { + bit<1> copyFlag; + bit<2> optClass; + bit<5> option; + bit<8> optionLength; +} + +header int_count_t { + bit<16> num_switches; +} + +header int_header_t { + switch_id_t switch_id; + queue_depth_t queue_depth; + output_port_t output_port; +} + + +struct parser_metadata_t { + bit<16> num_headers_remaining; +} + +struct local_metadata_t { + parser_metadata_t parser_metadata; +} + +struct parsed_headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + ipv4_option_t ipv4_option; + int_count_t int_count; + int_header_t[MAX_INT_HEADERS] int_headers; +} + +error { IPHeaderWithoutOptions } + +//------------------------------------------------------------------------------ +// INGRESS PIPELINE +//------------------------------------------------------------------------------ + +parser ParserImpl(packet_in packet, + out parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + state start { + + packet.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType){ + TYPE_IPV4: parse_ipv4; + default: accept; + } + } + + state parse_ipv4 { + packet.extract(hdr.ipv4); + //Check if ihl is bigger than 5. Packets without ip options set ihl to 5. + verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions); + transition select(hdr.ipv4.ihl) { + 5 : accept; + default : parse_ipv4_option; + } + } + + state parse_ipv4_option { + packet.extract(hdr.ipv4_option); + transition select(hdr.ipv4_option.option){ + + IPV4_OPTION_INT: parse_int; + default: accept; + + } + } + + state parse_int { + packet.extract(hdr.int_count); + local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches; + transition select(local_metadata.parser_metadata.num_headers_remaining){ + 0: accept; + default: parse_int_headers; + } + } + + state parse_int_headers { + packet.extract(hdr.int_headers.next); + local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ; + transition select(local_metadata.parser_metadata.num_headers_remaining){ + 0: accept; + default: parse_int_headers; + } + } +} + +control VerifyChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t meta) +{ + apply { /* EMPTY */ } +} + + +control IngressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + action drop() { + mark_to_drop(standard_metadata); + } + + action set_egress_port(port_num_t port) { + standard_metadata.egress_spec = port; + } + + // --- l2_exact_table ------------------ + + table l2_exact_table { + key = { + standard_metadata.ingress_port: exact; + } + actions = { + set_egress_port; + @defaultonly drop; + } + const default_action = drop; + } + + apply { + l2_exact_table.apply(); + } +} + +//------------------------------------------------------------------------------ +// EGRESS PIPELINE +//------------------------------------------------------------------------------ + +control EgressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + + action add_int_header(switch_id_t swid){ + //increase int stack counter by one + hdr.int_count.num_switches = hdr.int_count.num_switches + 1; + hdr.int_headers.push_front(1); + // This was not needed in older specs. Now by default pushed + // invalid elements are + hdr.int_headers[0].setValid(); + hdr.int_headers[0].switch_id = (bit<13>)swid; + hdr.int_headers[0].queue_depth = (bit<13>)standard_metadata.deq_qdepth; + hdr.int_headers[0].output_port = (bit<6>)standard_metadata.egress_port; + + //update ip header length + hdr.ipv4.ihl = hdr.ipv4.ihl + 1; + hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4; + hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4; + } + + table int_table { + actions = { + add_int_header; + NoAction; + } + default_action = add_int_header(1); + } + + apply { + if (hdr.int_count.isValid()){ + int_table.apply(); + } + } +} + + +control ComputeChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t local_metadata) +{ + apply { + update_checksum( + hdr.ipv4.isValid(), + { hdr.ipv4.version, + hdr.ipv4.ihl, + hdr.ipv4.dscp, + hdr.ipv4.ecn, + hdr.ipv4.totalLen, + hdr.ipv4.identification, + hdr.ipv4.flags, + hdr.ipv4.fragOffset, + hdr.ipv4.ttl, + hdr.ipv4.protocol, + hdr.ipv4.srcAddr, + hdr.ipv4.dstAddr }, + hdr.ipv4.hdrChecksum, + HashAlgorithm.csum16); + } +} + +control DeparserImpl(packet_out packet, in parsed_headers_t hdr) { + apply { + + //parsed headers have to be added again into the packet. + packet.emit(hdr.ethernet); + packet.emit(hdr.ipv4); + packet.emit(hdr.ipv4_option); + packet.emit(hdr.int_count); + packet.emit(hdr.int_headers); + + } +} + +V1Switch( + ParserImpl(), + VerifyChecksumImpl(), + IngressPipeImpl(), + EgressPipeImpl(), + ComputeChecksumImpl(), + DeparserImpl() +) main; diff --git a/src/tests/hackfest3/int/receive.py b/src/tests/hackfest3/int/receive.py new file mode 100644 index 0000000000000000000000000000000000000000..fb1aac1ca2527e7df5981d2a747f2ebc4a6e8775 --- /dev/null +++ b/src/tests/hackfest3/int/receive.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import struct + +from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr +from scapy.all import Packet, IPOption +from scapy.all import PacketListField, ShortField, IntField, LongField, BitField, FieldListField, FieldLenField +from scapy.all import IP, UDP, Raw +from scapy.layers.inet import _IPOption_HDR + + +def get_if(): + ifs=get_if_list() + iface=None + for i in get_if_list(): + if "eth0" in i: + iface=i + break + if not iface: + print("Cannot find eth0 interface") + exit(1) + return iface + + +class SwitchTrace(Packet): + fields_desc = [ BitField("swid", 0, 13), + BitField("qdepth", 0,13), + BitField("portid",0,6)] + def extract_padding(self, p): + return "", p + + +class IPOption_INT(IPOption): + name = "INT" + option = 31 + fields_desc = [ _IPOption_HDR, + FieldLenField("length", None, fmt="B", + length_of="int_headers", + adjust=lambda pkt,l:l*2+4), + ShortField("count", 0), + PacketListField("int_headers", + [], + SwitchTrace, + count_from=lambda pkt:(pkt.count*1)) ] + + +def handle_pkt(pkt): + print("got a packet") + pkt.show2() + sys.stdout.flush() + + +def main(): + iface = 'server-eth0' + print("sniffing on %s" % iface) + sys.stdout.flush() + sniff(filter="udp and port 4321", iface = iface, + prn = lambda x: handle_pkt(x)) + + +if __name__ == '__main__': + main() diff --git a/src/tests/hackfest3/int/send.py b/src/tests/hackfest3/int/send.py new file mode 100644 index 0000000000000000000000000000000000000000..38b4b4d6274922e5917206681e9502c9d8ac3576 --- /dev/null +++ b/src/tests/hackfest3/int/send.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import sys +import socket +import random +import struct + +from scapy.all import sendp, send, hexdump, get_if_list, get_if_hwaddr +from scapy.all import Packet, IPOption +from scapy.all import Ether, IP, UDP +from scapy.all import IntField, FieldListField, FieldLenField, ShortField, PacketListField, BitField +from scapy.layers.inet import _IPOption_HDR + +from time import sleep + + +def get_if(): + ifs=get_if_list() + iface=None + for i in get_if_list(): + if "eth0" in i: + iface=i + break + if not iface: + print("Cannot find eth0 interface") + exit(1) + return iface + + +class SwitchTrace(Packet): + fields_desc = [ BitField("swid", 0, 13), + BitField("qdepth", 0,13), + BitField("portid",0,6)] + def extract_padding(self, p): + return "", p + +class IPOption_INT(IPOption): + name = "INT" + option = 31 + fields_desc = [ _IPOption_HDR, + FieldLenField("length", None, fmt="B", + length_of="int_headers", + adjust=lambda pkt,l:l*2+4), + ShortField("count", 0), + PacketListField("int_headers", + [], + SwitchTrace, + count_from=lambda pkt:(pkt.count*1)) ] + + +def main(): + + if len(sys.argv)<4: + print('pass 3 arguments: <destination> "<message>" <number of packets>') + exit(1) + + addr = socket.gethostbyname(sys.argv[1]) + iface = get_if() + + pkt = Ether(src=get_if_hwaddr(iface), dst="ff:ff:ff:ff:ff:ff") / IP( + dst=addr, options = IPOption_INT(count=0, + int_headers=[])) / UDP( + dport=1234, sport=4321) / sys.argv[2] + + pkt.show2() + + try: + for i in range(int(sys.argv[3])): + sendp(pkt, iface=iface) + sleep(1) + except KeyboardInterrupt: + raise + + +if __name__ == '__main__': + main() diff --git a/src/tests/hackfest3/int/solution/p4_service_handler.py b/src/tests/hackfest3/int/solution/p4_service_handler.py new file mode 100644 index 0000000000000000000000000000000000000000..558f6a590620ec96e4dd3db88599acd037041268 --- /dev/null +++ b/src/tests/hackfest3/int/solution/p4_service_handler.py @@ -0,0 +1,389 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +P4 service handler for the TeraFlowSDN controller. +""" + +import logging +from typing import Any, List, Optional, Tuple, Union +from common.method_wrappers.Decorator import MetricsPool, metered_subclass_method +from common.proto.context_pb2 import ConfigRule, DeviceId, Service +from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.tools.object_factory.Device import json_device_id +from common.type_checkers.Checkers import chk_type +from service.service.service_handler_api._ServiceHandler import _ServiceHandler +from service.service.task_scheduler.TaskExecutor import TaskExecutor + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('Service', 'Handler', labels={'handler': 'p4'}) + +def create_rule_set(endpoint_a, endpoint_b): + return json_config_rule_set( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_exact_table', + 'match-fields': [ + { + 'match-field': 'standard_metadata.ingress_port', + 'match-value': endpoint_a + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port', + 'action-value': endpoint_b + } + ] + } + ) + +def create_rule_del(endpoint_a, endpoint_b): + return json_config_rule_delete( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_exact_table', + 'match-fields': [ + { + 'match-field': 'standard_metadata.ingress_port', + 'match-value': endpoint_a + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port', + 'action-value': endpoint_b + } + ] + } + ) + +def create_int_set(endpoint_a, id): + return json_config_rule_set( + 'table', + { + 'table-name': 'EgressPipeImpl.int_table', + 'match-fields': [ + { + 'match-field': 'standard_metadata.ingress_port', + 'match-value': endpoint_a + } + ], + 'action-name': 'EgressPipeImpl.add_int_header', + 'action-params': [ + { + 'action-param': 'swid', + 'action-value': id + } + ] + } + ) + +def create_int_del(endpoint_a, id): + return json_config_rule_delete( + 'table', + { + 'table-name': 'EgressPipeImpl.int_table', + 'match-fields': [ + { + 'match-field': 'standard_metadata.ingress_port', + 'match-value': endpoint_a + } + ], + 'action-name': 'EgressPipeImpl.add_int_header', + 'action-params': [ + { + 'action-param': 'swid', + 'action-value': id + } + ] + } + ) + +def find_names(uuid_a, uuid_b, device_endpoints): + endpoint_a, endpoint_b = None, None + for endpoint in device_endpoints: + if endpoint.endpoint_id.endpoint_uuid.uuid == uuid_a: + endpoint_a = endpoint.name + elif endpoint.endpoint_id.endpoint_uuid.uuid == uuid_b: + endpoint_b = endpoint.name + + return (endpoint_a, endpoint_b) + +class P4ServiceHandler(_ServiceHandler): + def __init__(self, + service: Service, + task_executor : TaskExecutor, + **settings) -> None: + """ Initialize Driver. + Parameters: + service + The service instance (gRPC message) to be managed. + task_executor + An instance of Task Executor providing access to the + service handlers factory, the context and device clients, + and an internal cache of already-loaded gRPC entities. + **settings + Extra settings required by the service handler. + """ + self.__service = service + self.__task_executor = task_executor # pylint: disable=unused-private-member + + @metered_subclass_method(METRICS_POOL) + def SetEndpoint( + self, endpoints : List[Tuple[str, str, Optional[str]]], + connection_uuid : Optional[str] = None + ) -> List[Union[bool, Exception]]: + """ Create/Update service endpoints form a list. + Parameters: + endpoints: List[Tuple[str, str, Optional[str]]] + List of tuples, each containing a device_uuid, + endpoint_uuid and, optionally, the topology_uuid + of the endpoint to be added. + connection_uuid : Optional[str] + If specified, is the UUID of the connection this endpoint is associated to. + Returns: + results: List[Union[bool, Exception]] + List of results for endpoint changes requested. + Return values must be in the same order as the requested + endpoints. If an endpoint is properly added, True must be + returned; otherwise, the Exception that is raised during + the processing must be returned. + """ + chk_type('endpoints', endpoints, list) + if len(endpoints) == 0: return [] + + service_uuid = self.__service.service_id.service_uuid.uuid + + history = {} + + results = [] + index = {} + i = 0 + for endpoint in endpoints: + device_uuid, endpoint_uuid = endpoint[0:2] # ignore topology_uuid by now + if device_uuid in history: + try: + matched_endpoint_uuid = history.pop(device_uuid) + device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid))) + + del device.device_config.config_rules[:] + + # Find names from uuids + (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints) + if endpoint_a is None: + LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) + raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) + if endpoint_b is None: + LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) + raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) + + # One way + rule = create_rule_set(endpoint_a, endpoint_b) + device.device_config.config_rules.append(ConfigRule(**rule)) + # The other way + rule = create_rule_set(endpoint_b, endpoint_a) + device.device_config.config_rules.append(ConfigRule(**rule)) + + rule = create_int_set(endpoint_a, device.name[-1]) + device.device_config.config_rules.append(ConfigRule(**rule)) + + self.__task_executor.configure_device(device) + + results.append(True) + results[index[device_uuid]] = True + except Exception as e: + LOGGER.exception('Unable to SetEndpoint({:s})'.format(str(endpoint))) + results.append(e) + else: + history[device_uuid] = endpoint_uuid + index[device_uuid] = i + results.append(False) + i = i+1 + + return results + + @metered_subclass_method(METRICS_POOL) + def DeleteEndpoint( + self, endpoints : List[Tuple[str, str, Optional[str]]], + connection_uuid : Optional[str] = None + ) -> List[Union[bool, Exception]]: + """ Delete service endpoints form a list. + Parameters: + endpoints: List[Tuple[str, str, Optional[str]]] + List of tuples, each containing a device_uuid, + endpoint_uuid, and the topology_uuid of the endpoint + to be removed. + connection_uuid : Optional[str] + If specified, is the UUID of the connection this endpoint is associated to. + Returns: + results: List[Union[bool, Exception]] + List of results for endpoint deletions requested. + Return values must be in the same order as the requested + endpoints. If an endpoint is properly deleted, True must be + returned; otherwise, the Exception that is raised during + the processing must be returned. + """ + chk_type('endpoints', endpoints, list) + if len(endpoints) == 0: return [] + + service_uuid = self.__service.service_id.service_uuid.uuid + + history = {} + + results = [] + index = {} + i = 0 + for endpoint in endpoints: + device_uuid, endpoint_uuid = endpoint[0:2] # ignore topology_uuid by now + if device_uuid in history: + try: + matched_endpoint_uuid = history.pop(device_uuid) + device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid))) + + del device.device_config.config_rules[:] + + # Find names from uuids + (endpoint_a, endpoint_b) = find_names(matched_endpoint_uuid, endpoint_uuid, device.device_endpoints) + if endpoint_a is None: + LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) + raise Exception('Unable to find name of endpoint({:s})'.format(str(matched_endpoint_uuid))) + if endpoint_b is None: + LOGGER.exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) + raise Exception('Unable to find name of endpoint({:s})'.format(str(endpoint_uuid))) + + # One way + rule = create_rule_del(endpoint_a, endpoint_b) + device.device_config.config_rules.append(ConfigRule(**rule)) + # The other way + rule = create_rule_del(endpoint_b, endpoint_a) + device.device_config.config_rules.append(ConfigRule(**rule)) + + rule = create_int_del(endpoint_a, device.name[-1]) + device.device_config.config_rules.append(ConfigRule(**rule)) + + self.__task_executor.configure_device(device) + + results.append(True) + results[index[device_uuid]] = True + except Exception as e: + LOGGER.exception('Unable to SetEndpoint({:s})'.format(str(endpoint))) + results.append(e) + else: + history[device_uuid] = endpoint_uuid + index[device_uuid] = i + results.append(False) + i = i+1 + + return results + + @metered_subclass_method(METRICS_POOL) + def SetConstraint(self, constraints: List[Tuple[str, Any]]) \ + -> List[Union[bool, Exception]]: + """ Create/Update service constraints. + Parameters: + constraints: List[Tuple[str, Any]] + List of tuples, each containing a constraint_type and the + new constraint_value to be set. + Returns: + results: List[Union[bool, Exception]] + List of results for constraint changes requested. + Return values must be in the same order as the requested + constraints. If a constraint is properly set, True must be + returned; otherwise, the Exception that is raised during + the processing must be returned. + """ + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[SetConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + @metered_subclass_method(METRICS_POOL) + def DeleteConstraint(self, constraints: List[Tuple[str, Any]]) \ + -> List[Union[bool, Exception]]: + """ Delete service constraints. + Parameters: + constraints: List[Tuple[str, Any]] + List of tuples, each containing a constraint_type pointing + to the constraint to be deleted, and a constraint_value + containing possible additionally required values to locate + the constraint to be removed. + Returns: + results: List[Union[bool, Exception]] + List of results for constraint deletions requested. + Return values must be in the same order as the requested + constraints. If a constraint is properly deleted, True must + be returned; otherwise, the Exception that is raised during + the processing must be returned. + """ + chk_type('constraints', constraints, list) + if len(constraints) == 0: return [] + + msg = '[DeleteConstraint] Method not implemented. Constraints({:s}) are being ignored.' + LOGGER.warning(msg.format(str(constraints))) + return [True for _ in range(len(constraints))] + + @metered_subclass_method(METRICS_POOL) + def SetConfig(self, resources: List[Tuple[str, Any]]) \ + -> List[Union[bool, Exception]]: + """ Create/Update configuration for a list of service resources. + Parameters: + resources: List[Tuple[str, Any]] + List of tuples, each containing a resource_key pointing to + the resource to be modified, and a resource_value + containing the new value to be set. + Returns: + results: List[Union[bool, Exception]] + List of results for resource key changes requested. + Return values must be in the same order as the requested + resource keys. If a resource is properly set, True must be + returned; otherwise, the Exception that is raised during + the processing must be returned. + """ + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + msg = '[SetConfig] Method not implemented. Resources({:s}) are being ignored.' + LOGGER.warning(msg.format(str(resources))) + return [True for _ in range(len(resources))] + + @metered_subclass_method(METRICS_POOL) + def DeleteConfig(self, resources: List[Tuple[str, Any]]) \ + -> List[Union[bool, Exception]]: + """ Delete configuration for a list of service resources. + Parameters: + resources: List[Tuple[str, Any]] + List of tuples, each containing a resource_key pointing to + the resource to be modified, and a resource_value containing + possible additionally required values to locate the value + to be removed. + Returns: + results: List[Union[bool, Exception]] + List of results for resource key deletions requested. + Return values must be in the same order as the requested + resource keys. If a resource is properly deleted, True must + be returned; otherwise, the Exception that is raised during + the processing must be returned. + """ + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + msg = '[SetConfig] Method not implemented. Resources({:s}) are being ignored.' + LOGGER.warning(msg.format(str(resources))) + return [True for _ in range(len(resources))] \ No newline at end of file diff --git a/src/tests/hackfest3/int/solution/qdepth_int_basic.p4 b/src/tests/hackfest3/int/solution/qdepth_int_basic.p4 new file mode 100644 index 0000000000000000000000000000000000000000..4a4f56c255c31d11c505afd3cf3bf72211ba0317 --- /dev/null +++ b/src/tests/hackfest3/int/solution/qdepth_int_basic.p4 @@ -0,0 +1,281 @@ +/* + * Copyright 2019-present Open Networking Foundation + * + * 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. + */ + + +#include <core.p4> +#include <v1model.p4> + +typedef bit<9> port_num_t; +typedef bit<48> mac_addr_t; + +//------------------------------------------------------------------------------ +// HEADER DEFINITIONS +//------------------------------------------------------------------------------ + +#define MAX_INT_HEADERS 9 + +const bit<16> TYPE_IPV4 = 0x800; +const bit<5> IPV4_OPTION_INT = 31; + +typedef bit<9> egressSpec_t; +typedef bit<48> macAddr_t; +typedef bit<32> ip4Addr_t; + +typedef bit<13> switch_id_t; +typedef bit<13> queue_depth_t; +typedef bit<6> output_port_t; + +header ethernet_t { + macAddr_t dstAddr; + macAddr_t srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<6> dscp; + bit<2> ecn; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + ip4Addr_t srcAddr; + ip4Addr_t dstAddr; +} + +header ipv4_option_t { + bit<1> copyFlag; + bit<2> optClass; + bit<5> option; + bit<8> optionLength; +} + +header int_count_t { + bit<16> num_switches; +} + +header int_header_t { + switch_id_t switch_id; + queue_depth_t queue_depth; + output_port_t output_port; +} + + +struct parser_metadata_t { + bit<16> num_headers_remaining; +} + +struct local_metadata_t { + parser_metadata_t parser_metadata; +} + +struct parsed_headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + ipv4_option_t ipv4_option; + int_count_t int_count; + int_header_t[MAX_INT_HEADERS] int_headers; +} + +error { IPHeaderWithoutOptions } + +//------------------------------------------------------------------------------ +// INGRESS PIPELINE +//------------------------------------------------------------------------------ + +parser ParserImpl(packet_in packet, + out parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + state start { + + packet.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType){ + TYPE_IPV4: parse_ipv4; + default: accept; + } + } + + state parse_ipv4 { + packet.extract(hdr.ipv4); + //Check if ihl is bigger than 5. Packets without ip options set ihl to 5. + verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions); + transition select(hdr.ipv4.ihl) { + 5 : accept; + default : parse_ipv4_option; + } + } + + state parse_ipv4_option { + packet.extract(hdr.ipv4_option); + transition select(hdr.ipv4_option.option){ + + IPV4_OPTION_INT: parse_int; + default: accept; + + } + } + + state parse_int { + packet.extract(hdr.int_count); + local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches; + transition select(local_metadata.parser_metadata.num_headers_remaining){ + 0: accept; + default: parse_int_headers; + } + } + + state parse_int_headers { + packet.extract(hdr.int_headers.next); + local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ; + transition select(local_metadata.parser_metadata.num_headers_remaining){ + 0: accept; + default: parse_int_headers; + } + } +} + +control VerifyChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t meta) +{ + apply { /* EMPTY */ } +} + + +control IngressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + action drop() { + mark_to_drop(standard_metadata); + } + + action set_egress_port(port_num_t port) { + standard_metadata.egress_spec = port; + } + + // --- l2_exact_table ------------------ + + table l2_exact_table { + key = { + standard_metadata.ingress_port: exact; + } + actions = { + set_egress_port; + @defaultonly drop; + } + const default_action = drop; + } + + apply { + l2_exact_table.apply(); + } +} + +//------------------------------------------------------------------------------ +// EGRESS PIPELINE +//------------------------------------------------------------------------------ + +control EgressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + + action add_int_header(switch_id_t swid){ + //increase int stack counter by one + hdr.int_count.num_switches = hdr.int_count.num_switches + 1; + hdr.int_headers.push_front(1); + // This was not needed in older specs. Now by default pushed + // invalid elements are + hdr.int_headers[0].setValid(); + hdr.int_headers[0].switch_id = (bit<13>)swid; + hdr.int_headers[0].queue_depth = (bit<13>)standard_metadata.deq_qdepth; + hdr.int_headers[0].output_port = (bit<6>)standard_metadata.egress_port; + + //update ip header length + hdr.ipv4.ihl = hdr.ipv4.ihl + 1; + hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4; + hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4; + } + + table int_table { + key = { + standard_metadata.ingress_port: exact; + } + actions = { + add_int_header; + NoAction; + } + default_action = NoAction; + } + + apply { + if (hdr.int_count.isValid()){ + int_table.apply(); + } + } +} + + +control ComputeChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t local_metadata) +{ + apply { + update_checksum( + hdr.ipv4.isValid(), + { hdr.ipv4.version, + hdr.ipv4.ihl, + hdr.ipv4.dscp, + hdr.ipv4.ecn, + hdr.ipv4.totalLen, + hdr.ipv4.identification, + hdr.ipv4.flags, + hdr.ipv4.fragOffset, + hdr.ipv4.ttl, + hdr.ipv4.protocol, + hdr.ipv4.srcAddr, + hdr.ipv4.dstAddr }, + hdr.ipv4.hdrChecksum, + HashAlgorithm.csum16); + } +} + +control DeparserImpl(packet_out packet, in parsed_headers_t hdr) { + apply { + + //parsed headers have to be added again into the packet. + packet.emit(hdr.ethernet); + packet.emit(hdr.ipv4); + packet.emit(hdr.ipv4_option); + packet.emit(hdr.int_count); + packet.emit(hdr.int_headers); + + } +} + +V1Switch( + ParserImpl(), + VerifyChecksumImpl(), + IngressPipeImpl(), + EgressPipeImpl(), + ComputeChecksumImpl(), + DeparserImpl() +) main; diff --git a/src/tests/hackfest3/int/solution/timestamp/receive2.py b/src/tests/hackfest3/int/solution/timestamp/receive2.py new file mode 100644 index 0000000000000000000000000000000000000000..0c749f9a48316e7826df409ff8852d40af0fb89e --- /dev/null +++ b/src/tests/hackfest3/int/solution/timestamp/receive2.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import struct + +from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr +from scapy.all import Packet, IPOption +from scapy.all import PacketListField, ShortField, IntField, LongField, BitField, FieldListField, FieldLenField +from scapy.all import IP, UDP, Raw +from scapy.layers.inet import _IPOption_HDR + + +def get_if(): + ifs=get_if_list() + iface=None + for i in get_if_list(): + if "eth0" in i: + iface=i + break + if not iface: + print("Cannot find eth0 interface") + exit(1) + return iface + + +class SwitchTrace(Packet): + fields_desc = [ BitField("timestamp", 0, 32)] + def extract_padding(self, p): + return "", p + + +class IPOption_INT(IPOption): + name = "INT" + option = 31 + fields_desc = [ _IPOption_HDR, + FieldLenField("length", None, fmt="B", + length_of="int_headers", + adjust=lambda pkt,l:l*2+4), + ShortField("count", 0), + PacketListField("int_headers", + [], + SwitchTrace, + count_from=lambda pkt:(pkt.count*1)) ] + + +def handle_pkt(pkt): + print("got a packet") + pkt.show2() + sys.stdout.flush() + + +def main(): + iface = 'server-eth0' + print("sniffing on %s" % iface) + sys.stdout.flush() + sniff(filter="udp and port 4321", iface = iface, + prn = lambda x: handle_pkt(x)) + + +if __name__ == '__main__': + main() diff --git a/src/tests/hackfest3/int/solution/timestamp/timestamp_int.p4 b/src/tests/hackfest3/int/solution/timestamp/timestamp_int.p4 new file mode 100644 index 0000000000000000000000000000000000000000..5a70ad3401d3e74afddad491e8560f76ae18af0f --- /dev/null +++ b/src/tests/hackfest3/int/solution/timestamp/timestamp_int.p4 @@ -0,0 +1,276 @@ +/* + * Copyright 2019-present Open Networking Foundation + * + * 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. + */ + + +#include <core.p4> +#include <v1model.p4> + +typedef bit<9> port_num_t; +typedef bit<48> mac_addr_t; + +//------------------------------------------------------------------------------ +// HEADER DEFINITIONS +//------------------------------------------------------------------------------ + +#define MAX_INT_HEADERS 9 + +const bit<16> TYPE_IPV4 = 0x800; +const bit<5> IPV4_OPTION_INT = 31; + +typedef bit<9> egressSpec_t; +typedef bit<48> macAddr_t; +typedef bit<32> ip4Addr_t; + +typedef bit<13> switch_id_t; +typedef bit<32> queue_depth_t; + +header ethernet_t { + macAddr_t dstAddr; + macAddr_t srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<6> dscp; + bit<2> ecn; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + ip4Addr_t srcAddr; + ip4Addr_t dstAddr; +} + +header ipv4_option_t { + bit<1> copyFlag; + bit<2> optClass; + bit<5> option; + bit<8> optionLength; +} + +header int_count_t { + bit<16> num_switches; +} + +header int_header_t { + queue_depth_t timestamp; +} + + +struct parser_metadata_t { + bit<16> num_headers_remaining; +} + +struct local_metadata_t { + parser_metadata_t parser_metadata; +} + +struct parsed_headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + ipv4_option_t ipv4_option; + int_count_t int_count; + int_header_t[MAX_INT_HEADERS] int_headers; +} + +error { IPHeaderWithoutOptions } + +//------------------------------------------------------------------------------ +// INGRESS PIPELINE +//------------------------------------------------------------------------------ + +parser ParserImpl(packet_in packet, + out parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + state start { + + packet.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType){ + TYPE_IPV4: parse_ipv4; + default: accept; + } + } + + state parse_ipv4 { + packet.extract(hdr.ipv4); + //Check if ihl is bigger than 5. Packets without ip options set ihl to 5. + verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions); + transition select(hdr.ipv4.ihl) { + 5 : accept; + default : parse_ipv4_option; + } + } + + state parse_ipv4_option { + packet.extract(hdr.ipv4_option); + transition select(hdr.ipv4_option.option){ + + IPV4_OPTION_INT: parse_int; + default: accept; + + } + } + + state parse_int { + packet.extract(hdr.int_count); + local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches; + transition select(local_metadata.parser_metadata.num_headers_remaining){ + 0: accept; + default: parse_int_headers; + } + } + + state parse_int_headers { + packet.extract(hdr.int_headers.next); + local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ; + transition select(local_metadata.parser_metadata.num_headers_remaining){ + 0: accept; + default: parse_int_headers; + } + } +} + +control VerifyChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t meta) +{ + apply { /* EMPTY */ } +} + + +control IngressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + action drop() { + mark_to_drop(standard_metadata); + } + + action set_egress_port(port_num_t port) { + standard_metadata.egress_spec = port; + } + + // --- l2_exact_table ------------------ + + table l2_exact_table { + key = { + standard_metadata.ingress_port: exact; + } + actions = { + set_egress_port; + @defaultonly drop; + } + const default_action = drop; + } + + apply { + l2_exact_table.apply(); + } +} + +//------------------------------------------------------------------------------ +// EGRESS PIPELINE +//------------------------------------------------------------------------------ + +control EgressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + + action add_int_header(switch_id_t swid){ + //increase int stack counter by one + hdr.int_count.num_switches = hdr.int_count.num_switches + 1; + hdr.int_headers.push_front(1); + // This was not needed in older specs. Now by default pushed + // invalid elements are + hdr.int_headers[0].setValid(); + hdr.int_headers[0].timestamp = (bit<32>)standard_metadata.ingress_global_timestamp; + + //update ip header length + hdr.ipv4.ihl = hdr.ipv4.ihl + 1; + hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4; + hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4; + } + + table int_table { + key = { + standard_metadata.ingress_port: exact; + } + actions = { + add_int_header; + NoAction; + } + default_action = NoAction; + } + + apply { + if (hdr.int_count.isValid()){ + int_table.apply(); + } + } +} + + +control ComputeChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t local_metadata) +{ + apply { + update_checksum( + hdr.ipv4.isValid(), + { hdr.ipv4.version, + hdr.ipv4.ihl, + hdr.ipv4.dscp, + hdr.ipv4.ecn, + hdr.ipv4.totalLen, + hdr.ipv4.identification, + hdr.ipv4.flags, + hdr.ipv4.fragOffset, + hdr.ipv4.ttl, + hdr.ipv4.protocol, + hdr.ipv4.srcAddr, + hdr.ipv4.dstAddr }, + hdr.ipv4.hdrChecksum, + HashAlgorithm.csum16); + } +} + +control DeparserImpl(packet_out packet, in parsed_headers_t hdr) { + apply { + + //parsed headers have to be added again into the packet. + packet.emit(hdr.ethernet); + packet.emit(hdr.ipv4); + packet.emit(hdr.ipv4_option); + packet.emit(hdr.int_count); + packet.emit(hdr.int_headers); + + } +} + +V1Switch( + ParserImpl(), + VerifyChecksumImpl(), + IngressPipeImpl(), + EgressPipeImpl(), + ComputeChecksumImpl(), + DeparserImpl() +) main; diff --git a/src/tests/hackfest3/new-probe/agent.py b/src/tests/hackfest3/new-probe/agent.py index 25a7aa45de5074609832d459fd9a81fb16a393df..3a89f0f1eb69168e188bdcc0881cf3fe97442d2c 100644 --- a/src/tests/hackfest3/new-probe/agent.py +++ b/src/tests/hackfest3/new-probe/agent.py @@ -44,14 +44,15 @@ monitoring_client = MonitoringClient(get_setting('MONITORINGSERVICE_SERVICE_HOST context_client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) ### Locks and common variables -enabled_lock = threading.Lock() +# Lock for kpi_id kpi_id_lock = threading.Lock() kpi_id = KpiId() +# Lock to know if we have registered a KPI or not +enabled_lock = threading.Lock() enabled = False ### Define the path to the Unix socket -socket_path = "/home/nuc8/tfs-develop/ngsdn-tutorial/tmp/sock" -#socket_path = "./tmp/sock" +socket_path = "/home/teraflow/ngsdn-tutorial/tmp/sock" if os.path.exists(socket_path): os.remove(socket_path) @@ -59,34 +60,19 @@ def thread_context_func(): global kpi_id global enabled while True: - # Listen to ContextService/GetServiceEvents stream - events = context_client.GetServiceEvents(Empty()) - for event in events: - event_service = event.service_id - event_service_uuid = event_service.service_uuid.uuid - event_type = event.event.event_type - if event_type == 1: - print(f"stream: New CREATE event:\n{event_service}") - kpi_descriptor = KpiDescriptor( - kpi_id = None, - kpi_id_list = [], - device_id = None, - endpoint_id = None, - kpi_description = f"Loss Ratio for service {event_service_uuid}", - service_id = event_service, - kpi_sample_type = KpiSampleType.KPISAMPLETYPE_UNKNOWN - ) - response = monitoring_client.SetKpi(kpi_descriptor) - print(response) - with kpi_id_lock: - kpi_id = response - print(kpi_id) - with enabled_lock: - enabled = True - elif event_type == 3: - print(f"stream: New REMOVE event:\n{event_service}") - with enabled_lock: - enabled = False +########################################################## +################## YOUR INPUT HERE ####################### +########################################################## + # Listen for Context Service Events + # Differentiate based on event type + # if event_type == service created: + # Create KpiDescriptor + # Register Kpi and keep kpi_id + # if event_type == service removed: + # stop sending values +########################################################## +##################### UNTIL HERE ######################### +########################################################## def thread_kpi_func(): global kpi_id @@ -94,50 +80,34 @@ def thread_kpi_func(): try: # Create socket object server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - # Bind the socket to the socket path server_socket.bind(socket_path) - # Listen for incoming connections server_socket.listen(1) - while True: print("Awaiting for new connection!") - # Accept incoming connection connection, client_address = server_socket.accept() - # Read data from the connection data = connection.recv(1024) - if data: with enabled_lock: if enabled: +########################################################## +################## YOUR INPUT HERE ####################### +########################################################## + # if we have registered a KPI + #store value to data data = data.decode() print(f"Received: {data}") with kpi_id_lock: - - now = time.time() - - new_timestamp = Timestamp() - new_timestamp.timestamp = now - - new_value = KpiValue() - new_value.floatVal = float(data) - - kpi = Kpi ( - kpi_id = kpi_id, - timestamp = new_timestamp, - kpi_value = new_value - ) - print(kpi) - response = monitoring_client.IncludeKpi(kpi) - print(f"response: {response}") - + # create Kpi + # send Kpi to Monitoring +########################################################## +##################### UNTIL HERE ######################### +########################################################## # Close the connection connection.close() - - except Exception as e: print(f"Error: {str(e)}") diff --git a/src/tests/hackfest3/new-probe/connect_to_mininet.sh b/src/tests/hackfest3/new-probe/connect_to_mininet.sh new file mode 100755 index 0000000000000000000000000000000000000000..a82d3767fc2669e7627bee0b5ca60e5626c920f2 --- /dev/null +++ b/src/tests/hackfest3/new-probe/connect_to_mininet.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker exec -it $CONTAINER /bin/bash diff --git a/src/tests/hackfest3/new-probe/copy.sh b/src/tests/hackfest3/new-probe/copy.sh new file mode 100755 index 0000000000000000000000000000000000000000..a01bc3235ddb62b2daaf8e6f3c1b09e8a28fac9f --- /dev/null +++ b/src/tests/hackfest3/new-probe/copy.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# get container id +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker cp ping2.py $CONTAINER:/root diff --git a/src/tests/hackfest3/new-probe/ping2.py b/src/tests/hackfest3/new-probe/ping2.py index d7c79717ff38cb99a8fdedad0af5334f7bc0e058..a58c68c91bf50dfe0bea6fc81b4709d006a21351 100644 --- a/src/tests/hackfest3/new-probe/ping2.py +++ b/src/tests/hackfest3/new-probe/ping2.py @@ -1,52 +1,53 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import socket, re, time, subprocess, sys +# Path of the socket inside mininet container socket_path = "/tmp/sock" -#socket_path = "./tmp/sock" def main(): hostname = sys.argv[1] - count = 1 - wait = 5 - total_pings = 0 - successful_pings = 0 try: while True: start_time = time.time() try: - # Run the ping command and capture the output - result = subprocess.check_output(["ping", "-W", str(wait), "-c", str(count), hostname], universal_newlines=True) - - response_time = float(re.findall(r"time=([0-9.]+) ms", result)[0]) - + # Run the ping command once and capture the output + response_time = 0 except subprocess.CalledProcessError as e: - # If ping fails return negative response_time + # If ping fails (even if it does not reach destination) + # This part is executed response_time = -1 - # Calculate new loss_ratio - if response_time != -1: - successful_pings += 1 - total_pings += 1 - moving_loss_ratio = round(((total_pings - successful_pings) / float(total_pings) * 100), 2) - - print("Total pings: {}".format(total_pings)) - print("Successful pings: {}".format(successful_pings)) - - print("Packet loss: {}%".format(moving_loss_ratio)) print("Latency: {} ms".format(response_time)) - data = str(moving_loss_ratio) - + # Uncomment the following when ready to write to socket + #data = str(response_time) + # # Write results in socket - try: - client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - client_socket.connect(socket_path) - client_socket.send(data.encode()) - client_socket.close() - except Exception as e: - print(e) - + #try: + # client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + # client_socket.connect(socket_path) + # client_socket.send(data.encode()) + # client_socket.close() + #except Exception as e: + # print(e) + + # The following is to make sure that we ping at least + # every 6 seconds regardless of how much time ping took. # Calculate the time taken by ping execution_time = time.time() - start_time # Wait the rest of the time diff --git a/src/tests/hackfest3/new-probe/solution/agent.py b/src/tests/hackfest3/new-probe/solution/agent.py new file mode 100644 index 0000000000000000000000000000000000000000..058caa7fb8b56e13ed8d4d532515c71f1d3934cd --- /dev/null +++ b/src/tests/hackfest3/new-probe/solution/agent.py @@ -0,0 +1,165 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#import copy, logging, pytest +#from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events +#from common.tools.object_factory.Context import json_context_id +#from common.tools.object_factory.Device import json_device_id +#from common.tools.object_factory.Service import json_service_id +#from common.tools.object_factory.Link import json_link_id +#from common.tools.object_factory.Topology import json_topology_id +#from context.client.EventsCollector import EventsCollector +#from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology, Service, ServiceId +#from monitoring.client.MonitoringClient import MonitoringClient +#from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId, DeviceOperationalStatusEnum + +import os, threading, time, socket +from common.Settings import get_setting +from common.proto.context_pb2 import Empty, Timestamp +from common.proto.monitoring_pb2 import KpiDescriptor, Kpi, KpiId, KpiValue +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from monitoring.client.MonitoringClient import MonitoringClient +from context.client.ContextClient import ContextClient + +# ----- If you want to use .env file +#from dotenv import load_dotenv +#load_dotenv() +#def get_setting(key): +# return os.getenv(key) + + +#### gRPC Clients +monitoring_client = MonitoringClient(get_setting('MONITORINGSERVICE_SERVICE_HOST'), get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC')) +context_client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + +### Locks and common variables +enabled_lock = threading.Lock() +kpi_id_lock = threading.Lock() +kpi_id = KpiId() +enabled = False + +### Define the path to the Unix socket +socket_path = "/home/teraflow/ngsdn-tutorial/tmp/sock" +#socket_path = "./tmp/sock" +if os.path.exists(socket_path): + os.remove(socket_path) + +def thread_context_func(): + global kpi_id + global enabled + while True: + # Listen to ContextService/GetServiceEvents stream + events = context_client.GetServiceEvents(Empty()) + for event in events: + event_service = event.service_id + event_service_uuid = event_service.service_uuid.uuid + event_type = event.event.event_type + if event_type == 1: + print(f"stream: New CREATE event:\n{event_service}") + kpi_descriptor = KpiDescriptor( + kpi_id = None, + kpi_id_list = [], + device_id = None, + endpoint_id = None, + kpi_description = f"Loss Ratio for service {event_service_uuid}", + service_id = event_service, + kpi_sample_type = KpiSampleType.KPISAMPLETYPE_UNKNOWN + ) + response = monitoring_client.SetKpi(kpi_descriptor) + print(response) + with kpi_id_lock: + kpi_id = response + print(kpi_id) + with enabled_lock: + enabled = True + elif event_type == 3: + print(f"stream: New REMOVE event:\n{event_service}") + with enabled_lock: + enabled = False + +def thread_kpi_func(): + global kpi_id + global enabled + try: + # Create socket object + server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + + # Bind the socket to the socket path + server_socket.bind(socket_path) + + # Listen for incoming connections + server_socket.listen(1) + + while True: + print("Awaiting for new connection!") + + # Accept incoming connection + connection, client_address = server_socket.accept() + + # Read data from the connection + data = connection.recv(1024) + + if data: + with enabled_lock: + if enabled: + data = data.decode() + print(f"Received: {data}") + with kpi_id_lock: + + now = time.time() + + new_timestamp = Timestamp() + new_timestamp.timestamp = now + + new_value = KpiValue() + new_value.floatVal = float(data) + + kpi = Kpi ( + kpi_id = kpi_id, + timestamp = new_timestamp, + kpi_value = new_value + ) + print(kpi) + response = monitoring_client.IncludeKpi(kpi) + print(f"response: {response}") + + # Close the connection + connection.close() + + + except Exception as e: + print(f"Error: {str(e)}") + + +def main(): + + # Start Thread that listens to context events + thread_context = threading.Thread(target=thread_context_func) + thread_context.daemon = True + thread_context.start() + + # Start Thread that listens to socket + thread_kpi = threading.Thread(target=thread_kpi_func) + thread_kpi.daemon = True + thread_kpi.start() + + try: + while True: + time.sleep(1) + except KeyboardInterrupt: + os.remove(socket_path) + print("Script terminated.") + +if __name__ == "__main__": + main() diff --git a/src/tests/hackfest3/new-probe/solution/connect_to_mininet.sh b/src/tests/hackfest3/new-probe/solution/connect_to_mininet.sh new file mode 100755 index 0000000000000000000000000000000000000000..a82d3767fc2669e7627bee0b5ca60e5626c920f2 --- /dev/null +++ b/src/tests/hackfest3/new-probe/solution/connect_to_mininet.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker exec -it $CONTAINER /bin/bash diff --git a/src/tests/hackfest3/new-probe/solution/copy.sh b/src/tests/hackfest3/new-probe/solution/copy.sh new file mode 100755 index 0000000000000000000000000000000000000000..a01bc3235ddb62b2daaf8e6f3c1b09e8a28fac9f --- /dev/null +++ b/src/tests/hackfest3/new-probe/solution/copy.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# get container id +CONTAINER=`docker ps | grep mininet | cut -f1 -d" "` +docker cp ping2.py $CONTAINER:/root diff --git a/src/tests/hackfest3/new-probe/solution/ping2.py b/src/tests/hackfest3/new-probe/solution/ping2.py new file mode 100644 index 0000000000000000000000000000000000000000..7f3a97c83bd0734e60874f90873e58bfad4e5ae7 --- /dev/null +++ b/src/tests/hackfest3/new-probe/solution/ping2.py @@ -0,0 +1,75 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import socket, re, time, subprocess, sys + +socket_path = "/tmp/sock" +#socket_path = "./tmp/sock" + +def main(): + hostname = sys.argv[1] + count = 1 + wait = 5 + + total_pings = 0 + successful_pings = 0 + try: + while True: + start_time = time.time() + + try: + # Run the ping command and capture the output + result = subprocess.check_output(["ping", "-W", str(wait), "-c", str(count), hostname], universal_newlines=True) + + response_time = float(re.findall(r"time=([0-9.]+) ms", result)[0]) + + except subprocess.CalledProcessError as e: + # If ping fails return negative response_time + response_time = -1 + + # Calculate new loss_ratio + if response_time != -1: + successful_pings += 1 + total_pings += 1 + moving_loss_ratio = round(((total_pings - successful_pings) / float(total_pings) * 100), 2) + + print("Total pings: {}".format(total_pings)) + print("Successful pings: {}".format(successful_pings)) + + print("Packet loss: {}%".format(moving_loss_ratio)) + print("Latency: {} ms".format(response_time)) + + data = str(response_time) + + # Write results in socket + try: + client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + client_socket.connect(socket_path) + client_socket.send(data.encode()) + client_socket.close() + except Exception as e: + print(e) + + # Calculate the time taken by ping + execution_time = time.time() - start_time + # Wait the rest of the time + wait_time = max(0, 6 - execution_time) + time.sleep(wait_time) + + except KeyboardInterrupt: + print("Script terminated.") + +if __name__ == "__main__": + main() + diff --git a/src/tests/hackfest3/p4/bmv2.json b/src/tests/hackfest3/p4/bmv2.json index d84c14a890c9d0906f1c5befabbfae3c97fdb1b3..f001eb52e90e875c4152f4d7820664402ac856c3 100644 --- a/src/tests/hackfest3/p4/bmv2.json +++ b/src/tests/hackfest3/p4/bmv2.json @@ -4,8 +4,7 @@ "name" : "scalars_0", "id" : 0, "fields" : [ - ["tmp", 1, false], - ["local_metadata_t._parser_metadata_num_headers_remaining0", 16, false], + ["local_metadata_t.is_multicast", 1, false], ["_padding_0", 7, false] ] }, @@ -42,54 +41,9 @@ "name" : "ethernet_t", "id" : 2, "fields" : [ - ["dstAddr", 48, false], - ["srcAddr", 48, false], - ["etherType", 16, false] - ] - }, - { - "name" : "ipv4_t", - "id" : 3, - "fields" : [ - ["version", 4, false], - ["ihl", 4, false], - ["dscp", 6, false], - ["ecn", 2, false], - ["totalLen", 16, false], - ["identification", 16, false], - ["flags", 3, false], - ["fragOffset", 13, false], - ["ttl", 8, false], - ["protocol", 8, false], - ["hdrChecksum", 16, false], - ["srcAddr", 32, false], - ["dstAddr", 32, false] - ] - }, - { - "name" : "ipv4_option_t", - "id" : 4, - "fields" : [ - ["copyFlag", 1, false], - ["optClass", 2, false], - ["option", 5, false], - ["optionLength", 8, false] - ] - }, - { - "name" : "int_count_t", - "id" : 5, - "fields" : [ - ["num_switches", 16, false] - ] - }, - { - "name" : "int_header_t", - "id" : 6, - "fields" : [ - ["switch_id", 13, false], - ["queue_depth", 13, false], - ["output_port", 6, false] + ["dst_addr", 48, false], + ["src_addr", 48, false], + ["ether_type", 16, false] ] } ], @@ -114,101 +68,9 @@ "header_type" : "ethernet_t", "metadata" : false, "pi_omit" : true - }, - { - "name" : "ipv4", - "id" : 3, - "header_type" : "ipv4_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "ipv4_option", - "id" : 4, - "header_type" : "ipv4_option_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_count", - "id" : 5, - "header_type" : "int_count_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[0]", - "id" : 6, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[1]", - "id" : 7, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[2]", - "id" : 8, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[3]", - "id" : 9, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[4]", - "id" : 10, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[5]", - "id" : 11, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[6]", - "id" : 12, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[7]", - "id" : 13, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - }, - { - "name" : "int_headers[8]", - "id" : 14, - "header_type" : "int_header_t", - "metadata" : false, - "pi_omit" : true - } - ], - "header_stacks" : [ - { - "name" : "int_headers", - "id" : 0, - "header_type" : "int_header_t", - "size" : 9, - "header_ids" : [6, 7, 8, 9, 10, 11, 12, 13, 14] } ], + "header_stacks" : [], "header_union_types" : [], "header_unions" : [], "header_union_stacks" : [], @@ -220,8 +82,7 @@ ["StackOutOfBounds", 4], ["HeaderTooShort", 5], ["ParserTimeout", 6], - ["ParserInvalidArgument", 7], - ["IPHeaderWithoutOptions", 8] + ["ParserInvalidArgument", 7] ], "enums" : [], "parsers" : [ @@ -245,262 +106,13 @@ } ], "transitions" : [ - { - "type" : "hexstr", - "value" : "0x0800", - "mask" : null, - "next_state" : "parse_ipv4" - }, { "value" : "default", "mask" : null, "next_state" : null } ], - "transition_key" : [ - { - "type" : "field", - "value" : ["ethernet", "etherType"] - } - ] - }, - { - "name" : "parse_ipv4", - "id" : 1, - "parser_ops" : [ - { - "parameters" : [ - { - "type" : "regular", - "value" : "ipv4" - } - ], - "op" : "extract" - }, - { - "parameters" : [ - { - "type" : "field", - "value" : ["scalars", "tmp"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "b2d", - "left" : null, - "right" : { - "type" : "expression", - "value" : { - "op" : ">=", - "left" : { - "type" : "field", - "value" : ["ipv4", "ihl"] - }, - "right" : { - "type" : "hexstr", - "value" : "0x05" - } - } - } - } - } - } - ], - "op" : "set" - }, - { - "parameters" : [ - { - "type" : "expression", - "value" : { - "op" : "d2b", - "left" : null, - "right" : { - "type" : "field", - "value" : ["scalars", "tmp"] - } - } - }, - { - "type" : "hexstr", - "value" : "0x8" - } - ], - "op" : "verify" - } - ], - "transitions" : [ - { - "type" : "hexstr", - "value" : "0x05", - "mask" : null, - "next_state" : null - }, - { - "value" : "default", - "mask" : null, - "next_state" : "parse_ipv4_option" - } - ], - "transition_key" : [ - { - "type" : "field", - "value" : ["ipv4", "ihl"] - } - ] - }, - { - "name" : "parse_ipv4_option", - "id" : 2, - "parser_ops" : [ - { - "parameters" : [ - { - "type" : "regular", - "value" : "ipv4_option" - } - ], - "op" : "extract" - } - ], - "transitions" : [ - { - "type" : "hexstr", - "value" : "0x1f", - "mask" : null, - "next_state" : "parse_int" - }, - { - "value" : "default", - "mask" : null, - "next_state" : null - } - ], - "transition_key" : [ - { - "type" : "field", - "value" : ["ipv4_option", "option"] - } - ] - }, - { - "name" : "parse_int", - "id" : 3, - "parser_ops" : [ - { - "parameters" : [ - { - "type" : "regular", - "value" : "int_count" - } - ], - "op" : "extract" - }, - { - "parameters" : [ - { - "type" : "field", - "value" : ["scalars", "local_metadata_t._parser_metadata_num_headers_remaining0"] - }, - { - "type" : "field", - "value" : ["int_count", "num_switches"] - } - ], - "op" : "set" - } - ], - "transitions" : [ - { - "type" : "hexstr", - "value" : "0x0000", - "mask" : null, - "next_state" : null - }, - { - "value" : "default", - "mask" : null, - "next_state" : "parse_int_headers" - } - ], - "transition_key" : [ - { - "type" : "field", - "value" : ["int_count", "num_switches"] - } - ] - }, - { - "name" : "parse_int_headers", - "id" : 4, - "parser_ops" : [ - { - "parameters" : [ - { - "type" : "stack", - "value" : "int_headers" - } - ], - "op" : "extract" - }, - { - "parameters" : [ - { - "type" : "field", - "value" : ["scalars", "local_metadata_t._parser_metadata_num_headers_remaining0"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "&", - "left" : { - "type" : "expression", - "value" : { - "op" : "+", - "left" : { - "type" : "field", - "value" : ["scalars", "local_metadata_t._parser_metadata_num_headers_remaining0"] - }, - "right" : { - "type" : "hexstr", - "value" : "0xffff" - } - } - }, - "right" : { - "type" : "hexstr", - "value" : "0xffff" - } - } - } - } - ], - "op" : "set" - } - ], - "transitions" : [ - { - "type" : "hexstr", - "value" : "0x0000", - "mask" : null, - "next_state" : null - }, - { - "value" : "default", - "mask" : null, - "next_state" : "parse_int_headers" - } - ], - "transition_key" : [ - { - "type" : "field", - "value" : ["scalars", "local_metadata_t._parser_metadata_num_headers_remaining0"] - } - ] + "transition_key" : [] } ] } @@ -512,79 +124,17 @@ "id" : 0, "source_info" : { "filename" : "p4src/main.p4", - "line" : 258, + "line" : 130, "column" : 8, "source_fragment" : "DeparserImpl" }, - "order" : ["ethernet", "ipv4", "ipv4_option", "int_count", "int_headers[0]", "int_headers[1]", "int_headers[2]", "int_headers[3]", "int_headers[4]", "int_headers[5]", "int_headers[6]", "int_headers[7]", "int_headers[8]"] + "order" : ["ethernet"] } ], "meter_arrays" : [], "counter_arrays" : [], "register_arrays" : [], - "calculations" : [ - { - "name" : "calc", - "id" : 0, - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 239, - "column" : 8, - "source_fragment" : "update_checksum( ..." - }, - "algo" : "csum16", - "input" : [ - { - "type" : "field", - "value" : ["ipv4", "version"] - }, - { - "type" : "field", - "value" : ["ipv4", "ihl"] - }, - { - "type" : "field", - "value" : ["ipv4", "dscp"] - }, - { - "type" : "field", - "value" : ["ipv4", "ecn"] - }, - { - "type" : "field", - "value" : ["ipv4", "totalLen"] - }, - { - "type" : "field", - "value" : ["ipv4", "identification"] - }, - { - "type" : "field", - "value" : ["ipv4", "flags"] - }, - { - "type" : "field", - "value" : ["ipv4", "fragOffset"] - }, - { - "type" : "field", - "value" : ["ipv4", "ttl"] - }, - { - "type" : "field", - "value" : ["ipv4", "protocol"] - }, - { - "type" : "field", - "value" : ["ipv4", "srcAddr"] - }, - { - "type" : "field", - "value" : ["ipv4", "dstAddr"] - } - ] - } - ], + "calculations" : [], "learn_lists" : [], "actions" : [ { @@ -602,7 +152,7 @@ ], "source_info" : { "filename" : "p4src/main.p4", - "line" : 168, + "line" : 77, "column" : 8, "source_fragment" : "mark_to_drop(standard_metadata)" } @@ -633,7 +183,7 @@ ], "source_info" : { "filename" : "p4src/main.p4", - "line" : 172, + "line" : 81, "column" : 8, "source_fragment" : "standard_metadata.egress_spec = port" } @@ -641,18 +191,12 @@ ] }, { - "name" : "NoAction", + "name" : "IngressPipeImpl.set_multicast_group", "id" : 2, - "runtime_data" : [], - "primitives" : [] - }, - { - "name" : "EgressPipeImpl.add_int_header", - "id" : 3, "runtime_data" : [ { - "name" : "swid", - "bitwidth" : 13 + "name" : "gid", + "bitwidth" : 16 } ], "primitives" : [ @@ -661,83 +205,7 @@ "parameters" : [ { "type" : "field", - "value" : ["int_count", "num_switches"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "&", - "left" : { - "type" : "expression", - "value" : { - "op" : "+", - "left" : { - "type" : "field", - "value" : ["int_count", "num_switches"] - }, - "right" : { - "type" : "hexstr", - "value" : "0x0001" - } - } - }, - "right" : { - "type" : "hexstr", - "value" : "0xffff" - } - } - } - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 204, - "column" : 8, - "source_fragment" : "hdr.int_count.num_switches = hdr.int_count.num_switches + 1" - } - }, - { - "op" : "push", - "parameters" : [ - { - "type" : "header_stack", - "value" : "int_headers" - }, - { - "type" : "hexstr", - "value" : "0x1" - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 205, - "column" : 8, - "source_fragment" : "hdr.int_headers.push_front(1)" - } - }, - { - "op" : "add_header", - "parameters" : [ - { - "type" : "header", - "value" : "int_headers[0]" - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 208, - "column" : 8, - "source_fragment" : "hdr.int_headers[0].setValid()" - } - }, - { - "op" : "assign", - "parameters" : [ - { - "type" : "field", - "value" : ["int_headers[0]", "switch_id"] + "value" : ["standard_metadata", "mcast_grp"] }, { "type" : "runtime_data", @@ -746,9 +214,9 @@ ], "source_info" : { "filename" : "p4src/main.p4", - "line" : 209, + "line" : 89, "column" : 8, - "source_fragment" : "hdr.int_headers[0].switch_id = (bit<13>)swid" + "source_fragment" : "standard_metadata.mcast_grp = gid" } }, { @@ -756,21 +224,18 @@ "parameters" : [ { "type" : "field", - "value" : ["int_headers[0]", "queue_depth"] + "value" : ["scalars", "local_metadata_t.is_multicast"] }, { "type" : "expression", "value" : { "type" : "expression", "value" : { - "op" : "&", - "left" : { - "type" : "field", - "value" : ["standard_metadata", "deq_qdepth"] - }, + "op" : "b2d", + "left" : null, "right" : { - "type" : "hexstr", - "value" : "0x1fff" + "type" : "bool", + "value" : true } } } @@ -778,167 +243,9 @@ ], "source_info" : { "filename" : "p4src/main.p4", - "line" : 210, + "line" : 90, "column" : 8, - "source_fragment" : "hdr.int_headers[0].queue_depth = (bit<13>)standard_metadata.deq_qdepth" - } - }, - { - "op" : "assign", - "parameters" : [ - { - "type" : "field", - "value" : ["int_headers[0]", "output_port"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "&", - "left" : { - "type" : "field", - "value" : ["standard_metadata", "egress_port"] - }, - "right" : { - "type" : "hexstr", - "value" : "0x3f" - } - } - } - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 211, - "column" : 8, - "source_fragment" : "hdr.int_headers[0].output_port = (bit<6>)standard_metadata.egress_port" - } - }, - { - "op" : "assign", - "parameters" : [ - { - "type" : "field", - "value" : ["ipv4", "ihl"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "&", - "left" : { - "type" : "expression", - "value" : { - "op" : "+", - "left" : { - "type" : "field", - "value" : ["ipv4", "ihl"] - }, - "right" : { - "type" : "hexstr", - "value" : "0x01" - } - } - }, - "right" : { - "type" : "hexstr", - "value" : "0x0f" - } - } - } - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 214, - "column" : 8, - "source_fragment" : "hdr.ipv4.ihl = hdr.ipv4.ihl + 1" - } - }, - { - "op" : "assign", - "parameters" : [ - { - "type" : "field", - "value" : ["ipv4", "totalLen"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "&", - "left" : { - "type" : "expression", - "value" : { - "op" : "+", - "left" : { - "type" : "field", - "value" : ["ipv4", "totalLen"] - }, - "right" : { - "type" : "hexstr", - "value" : "0x0004" - } - } - }, - "right" : { - "type" : "hexstr", - "value" : "0xffff" - } - } - } - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 215, - "column" : 8, - "source_fragment" : "hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4" - } - }, - { - "op" : "assign", - "parameters" : [ - { - "type" : "field", - "value" : ["ipv4_option", "optionLength"] - }, - { - "type" : "expression", - "value" : { - "type" : "expression", - "value" : { - "op" : "&", - "left" : { - "type" : "expression", - "value" : { - "op" : "+", - "left" : { - "type" : "field", - "value" : ["ipv4_option", "optionLength"] - }, - "right" : { - "type" : "hexstr", - "value" : "0x04" - } - } - }, - "right" : { - "type" : "hexstr", - "value" : "0xff" - } - } - } - } - ], - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 216, - "column" : 8, - "source_fragment" : "hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4" + "source_fragment" : "local_metadata.is_multicast = true" } } ] @@ -950,7 +257,7 @@ "id" : 0, "source_info" : { "filename" : "p4src/main.p4", - "line" : 163, + "line" : 71, "column" : 8, "source_fragment" : "IngressPipeImpl" }, @@ -961,7 +268,7 @@ "id" : 0, "source_info" : { "filename" : "p4src/main.p4", - "line" : 177, + "line" : 95, "column" : 10, "source_fragment" : "l2_exact_table" }, @@ -979,11 +286,12 @@ "with_counters" : false, "support_timeout" : false, "direct_meters" : null, - "action_ids" : [1, 0], - "actions" : ["IngressPipeImpl.set_egress_port", "IngressPipeImpl.drop"], + "action_ids" : [1, 2, 0], + "actions" : ["IngressPipeImpl.set_egress_port", "IngressPipeImpl.set_multicast_group", "IngressPipeImpl.drop"], "base_default_next" : null, "next_tables" : { "IngressPipeImpl.set_egress_port" : null, + "IngressPipeImpl.set_multicast_group" : null, "IngressPipeImpl.drop" : null }, "default_entry" : { @@ -1002,99 +310,17 @@ "id" : 1, "source_info" : { "filename" : "p4src/main.p4", - "line" : 197, + "line" : 116, "column" : 8, "source_fragment" : "EgressPipeImpl" }, - "init_table" : "node_5", - "tables" : [ - { - "name" : "EgressPipeImpl.int_table", - "id" : 1, - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 219, - "column" : 10, - "source_fragment" : "int_table" - }, - "key" : [], - "match_type" : "exact", - "type" : "simple", - "max_size" : 1024, - "with_counters" : false, - "support_timeout" : false, - "direct_meters" : null, - "action_ids" : [3, 2], - "actions" : ["EgressPipeImpl.add_int_header", "NoAction"], - "base_default_next" : null, - "next_tables" : { - "EgressPipeImpl.add_int_header" : null, - "NoAction" : null - }, - "default_entry" : { - "action_id" : 2, - "action_const" : false, - "action_data" : [], - "action_entry_const" : false - } - } - ], + "init_table" : null, + "tables" : [], "action_profiles" : [], - "conditionals" : [ - { - "name" : "node_5", - "id" : 0, - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 228, - "column" : 12, - "source_fragment" : "hdr.int_count.isValid()" - }, - "expression" : { - "type" : "expression", - "value" : { - "op" : "d2b", - "left" : null, - "right" : { - "type" : "field", - "value" : ["int_count", "$valid$"] - } - } - }, - "false_next" : null, - "true_next" : "EgressPipeImpl.int_table" - } - ] - } - ], - "checksums" : [ - { - "name" : "cksum", - "id" : 0, - "source_info" : { - "filename" : "p4src/main.p4", - "line" : 239, - "column" : 8, - "source_fragment" : "update_checksum( ..." - }, - "target" : ["ipv4", "hdrChecksum"], - "type" : "generic", - "calculation" : "calc", - "verify" : false, - "update" : true, - "if_cond" : { - "type" : "expression", - "value" : { - "op" : "d2b", - "left" : null, - "right" : { - "type" : "field", - "value" : ["ipv4", "$valid$"] - } - } - } + "conditionals" : [] } ], + "checksums" : [], "force_arith" : [], "extern_instances" : [], "field_aliases" : [ diff --git a/src/tests/hackfest3/p4/main.p4 b/src/tests/hackfest3/p4/main.p4 index 68d93fe947f090bc4e0ae1d09b315337a2e9aa0e..843eb0d580e362e74b25c768b1b01e750138637a 100644 --- a/src/tests/hackfest3/p4/main.p4 +++ b/src/tests/hackfest3/p4/main.p4 @@ -20,136 +20,47 @@ typedef bit<9> port_num_t; typedef bit<48> mac_addr_t; +typedef bit<16> mcast_group_id_t; //------------------------------------------------------------------------------ // HEADER DEFINITIONS //------------------------------------------------------------------------------ -#define MAX_INT_HEADERS 9 - -const bit<16> TYPE_IPV4 = 0x800; -const bit<5> IPV4_OPTION_INT = 31; - -typedef bit<9> egressSpec_t; -typedef bit<48> macAddr_t; -typedef bit<32> ip4Addr_t; - -typedef bit<13> switch_id_t; -typedef bit<32> queue_depth_t; - header ethernet_t { - macAddr_t dstAddr; - macAddr_t srcAddr; - bit<16> etherType; -} - -header ipv4_t { - bit<4> version; - bit<4> ihl; - bit<6> dscp; - bit<2> ecn; - bit<16> totalLen; - bit<16> identification; - bit<3> flags; - bit<13> fragOffset; - bit<8> ttl; - bit<8> protocol; - bit<16> hdrChecksum; - ip4Addr_t srcAddr; - ip4Addr_t dstAddr; -} - -header ipv4_option_t { - bit<1> copyFlag; - bit<2> optClass; - bit<5> option; - bit<8> optionLength; + mac_addr_t dst_addr; + mac_addr_t src_addr; + bit<16> ether_type; } -header int_count_t { - bit<16> num_switches; -} - -header int_header_t { - queue_depth_t queue_depth; -} - - -struct parser_metadata_t { - bit<16> num_headers_remaining; +struct parsed_headers_t { + ethernet_t ethernet; } struct local_metadata_t { - parser_metadata_t parser_metadata; -} - -struct parsed_headers_t { - ethernet_t ethernet; - ipv4_t ipv4; - ipv4_option_t ipv4_option; - int_count_t int_count; - int_header_t[MAX_INT_HEADERS] int_headers; + bool is_multicast; } -error { IPHeaderWithoutOptions } //------------------------------------------------------------------------------ // INGRESS PIPELINE //------------------------------------------------------------------------------ -parser ParserImpl(packet_in packet, - out parsed_headers_t hdr, - inout local_metadata_t local_metadata, - inout standard_metadata_t standard_metadata) { - +parser ParserImpl (packet_in packet, + out parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) +{ state start { - - packet.extract(hdr.ethernet); - transition select(hdr.ethernet.etherType){ - TYPE_IPV4: parse_ipv4; - default: accept; - } + transition parse_ethernet; } - state parse_ipv4 { - packet.extract(hdr.ipv4); - //Check if ihl is bigger than 5. Packets without ip options set ihl to 5. - verify(hdr.ipv4.ihl >= 5, error.IPHeaderWithoutOptions); - transition select(hdr.ipv4.ihl) { - 5 : accept; - default : parse_ipv4_option; - } - } - - state parse_ipv4_option { - packet.extract(hdr.ipv4_option); - transition select(hdr.ipv4_option.option){ - - IPV4_OPTION_INT: parse_int; - default: accept; - - } - } - - state parse_int { - packet.extract(hdr.int_count); - local_metadata.parser_metadata.num_headers_remaining = hdr.int_count.num_switches; - transition select(local_metadata.parser_metadata.num_headers_remaining){ - 0: accept; - default: parse_int_headers; - } - } - - state parse_int_headers { - packet.extract(hdr.int_headers.next); - local_metadata.parser_metadata.num_headers_remaining = local_metadata.parser_metadata.num_headers_remaining -1 ; - transition select(local_metadata.parser_metadata.num_headers_remaining){ - 0: accept; - default: parse_int_headers; - } + state parse_ethernet { + packet.extract(hdr.ethernet); + transition accept; } } + control VerifyChecksumImpl(inout parsed_headers_t hdr, inout local_metadata_t meta) { @@ -161,6 +72,7 @@ control IngressPipeImpl (inout parsed_headers_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { + // Drop action shared by many tables. action drop() { mark_to_drop(standard_metadata); } @@ -169,6 +81,15 @@ control IngressPipeImpl (inout parsed_headers_t hdr, standard_metadata.egress_spec = port; } + action set_multicast_group(mcast_group_id_t gid) { + // gid will be used by the Packet Replication Engine (PRE) in the + // Traffic Manager--located right after the ingress pipeline, to + // replicate a packet to multiple egress ports, specified by the control + // plane by means of P4Runtime MulticastGroupEntry messages. + standard_metadata.mcast_grp = gid; + local_metadata.is_multicast = true; + } + // --- l2_exact_table ------------------ table l2_exact_table { @@ -177,6 +98,7 @@ control IngressPipeImpl (inout parsed_headers_t hdr, } actions = { set_egress_port; + set_multicast_group; @defaultonly drop; } const default_action = drop; @@ -194,78 +116,24 @@ control IngressPipeImpl (inout parsed_headers_t hdr, control EgressPipeImpl (inout parsed_headers_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { - - - action add_int_header(switch_id_t swid){ - //increase int stack counter by one - hdr.int_count.num_switches = hdr.int_count.num_switches + 1; - hdr.int_headers.push_front(1); - // This was not needed in older specs. Now by default pushed - // invalid elements are - hdr.int_headers[0].setValid(); - hdr.int_headers[0].queue_depth = (bit<32>)standard_metadata.ingress_global_timestamp; - - //update ip header length - hdr.ipv4.ihl = hdr.ipv4.ihl + 1; - hdr.ipv4.totalLen = hdr.ipv4.totalLen + 4; - hdr.ipv4_option.optionLength = hdr.ipv4_option.optionLength + 4; - } - - table int_table { - key = { - standard_metadata.ingress_port: exact; - } - actions = { - add_int_header; - NoAction; - } - default_action = NoAction; - } - - apply { - if (hdr.int_count.isValid()){ - int_table.apply(); - } - } + apply { /* EMPTY */ } } control ComputeChecksumImpl(inout parsed_headers_t hdr, inout local_metadata_t local_metadata) { - apply { - update_checksum( - hdr.ipv4.isValid(), - { hdr.ipv4.version, - hdr.ipv4.ihl, - hdr.ipv4.dscp, - hdr.ipv4.ecn, - hdr.ipv4.totalLen, - hdr.ipv4.identification, - hdr.ipv4.flags, - hdr.ipv4.fragOffset, - hdr.ipv4.ttl, - hdr.ipv4.protocol, - hdr.ipv4.srcAddr, - hdr.ipv4.dstAddr }, - hdr.ipv4.hdrChecksum, - HashAlgorithm.csum16); - } + apply { /* EMPTY */ } } + control DeparserImpl(packet_out packet, in parsed_headers_t hdr) { apply { - - //parsed headers have to be added again into the packet. packet.emit(hdr.ethernet); - packet.emit(hdr.ipv4); - packet.emit(hdr.ipv4_option); - packet.emit(hdr.int_count); - packet.emit(hdr.int_headers); - } } + V1Switch( ParserImpl(), VerifyChecksumImpl(), diff --git a/src/tests/hackfest3/p4/orig/bmv2.json b/src/tests/hackfest3/p4/orig/bmv2.json new file mode 100644 index 0000000000000000000000000000000000000000..f001eb52e90e875c4152f4d7820664402ac856c3 --- /dev/null +++ b/src/tests/hackfest3/p4/orig/bmv2.json @@ -0,0 +1,381 @@ +{ + "header_types" : [ + { + "name" : "scalars_0", + "id" : 0, + "fields" : [ + ["local_metadata_t.is_multicast", 1, false], + ["_padding_0", 7, false] + ] + }, + { + "name" : "standard_metadata", + "id" : 1, + "fields" : [ + ["ingress_port", 9, false], + ["egress_spec", 9, false], + ["egress_port", 9, false], + ["clone_spec", 32, false], + ["instance_type", 32, false], + ["drop", 1, false], + ["recirculate_port", 16, false], + ["packet_length", 32, false], + ["enq_timestamp", 32, false], + ["enq_qdepth", 19, false], + ["deq_timedelta", 32, false], + ["deq_qdepth", 19, false], + ["ingress_global_timestamp", 48, false], + ["egress_global_timestamp", 48, false], + ["lf_field_list", 32, false], + ["mcast_grp", 16, false], + ["resubmit_flag", 32, false], + ["egress_rid", 16, false], + ["recirculate_flag", 32, false], + ["checksum_error", 1, false], + ["parser_error", 32, false], + ["priority", 3, false], + ["_padding", 2, false] + ] + }, + { + "name" : "ethernet_t", + "id" : 2, + "fields" : [ + ["dst_addr", 48, false], + ["src_addr", 48, false], + ["ether_type", 16, false] + ] + } + ], + "headers" : [ + { + "name" : "scalars", + "id" : 0, + "header_type" : "scalars_0", + "metadata" : true, + "pi_omit" : true + }, + { + "name" : "standard_metadata", + "id" : 1, + "header_type" : "standard_metadata", + "metadata" : true, + "pi_omit" : true + }, + { + "name" : "ethernet", + "id" : 2, + "header_type" : "ethernet_t", + "metadata" : false, + "pi_omit" : true + } + ], + "header_stacks" : [], + "header_union_types" : [], + "header_unions" : [], + "header_union_stacks" : [], + "field_lists" : [], + "errors" : [ + ["NoError", 1], + ["PacketTooShort", 2], + ["NoMatch", 3], + ["StackOutOfBounds", 4], + ["HeaderTooShort", 5], + ["ParserTimeout", 6], + ["ParserInvalidArgument", 7] + ], + "enums" : [], + "parsers" : [ + { + "name" : "parser", + "id" : 0, + "init_state" : "start", + "parse_states" : [ + { + "name" : "start", + "id" : 0, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "ethernet" + } + ], + "op" : "extract" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [] + } + ] + } + ], + "parse_vsets" : [], + "deparsers" : [ + { + "name" : "deparser", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 130, + "column" : 8, + "source_fragment" : "DeparserImpl" + }, + "order" : ["ethernet"] + } + ], + "meter_arrays" : [], + "counter_arrays" : [], + "register_arrays" : [], + "calculations" : [], + "learn_lists" : [], + "actions" : [ + { + "name" : "IngressPipeImpl.drop", + "id" : 0, + "runtime_data" : [], + "primitives" : [ + { + "op" : "mark_to_drop", + "parameters" : [ + { + "type" : "header", + "value" : "standard_metadata" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 77, + "column" : 8, + "source_fragment" : "mark_to_drop(standard_metadata)" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_egress_port", + "id" : 1, + "runtime_data" : [ + { + "name" : "port", + "bitwidth" : 9 + } + ], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["standard_metadata", "egress_spec"] + }, + { + "type" : "runtime_data", + "value" : 0 + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 81, + "column" : 8, + "source_fragment" : "standard_metadata.egress_spec = port" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_multicast_group", + "id" : 2, + "runtime_data" : [ + { + "name" : "gid", + "bitwidth" : 16 + } + ], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["standard_metadata", "mcast_grp"] + }, + { + "type" : "runtime_data", + "value" : 0 + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 89, + "column" : 8, + "source_fragment" : "standard_metadata.mcast_grp = gid" + } + }, + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.is_multicast"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "b2d", + "left" : null, + "right" : { + "type" : "bool", + "value" : true + } + } + } + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 90, + "column" : 8, + "source_fragment" : "local_metadata.is_multicast = true" + } + } + ] + } + ], + "pipelines" : [ + { + "name" : "ingress", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 71, + "column" : 8, + "source_fragment" : "IngressPipeImpl" + }, + "init_table" : "IngressPipeImpl.l2_exact_table", + "tables" : [ + { + "name" : "IngressPipeImpl.l2_exact_table", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 95, + "column" : 10, + "source_fragment" : "l2_exact_table" + }, + "key" : [ + { + "match_type" : "exact", + "name" : "standard_metadata.ingress_port", + "target" : ["standard_metadata", "ingress_port"], + "mask" : null + } + ], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [1, 2, 0], + "actions" : ["IngressPipeImpl.set_egress_port", "IngressPipeImpl.set_multicast_group", "IngressPipeImpl.drop"], + "base_default_next" : null, + "next_tables" : { + "IngressPipeImpl.set_egress_port" : null, + "IngressPipeImpl.set_multicast_group" : null, + "IngressPipeImpl.drop" : null + }, + "default_entry" : { + "action_id" : 0, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + } + ], + "action_profiles" : [], + "conditionals" : [] + }, + { + "name" : "egress", + "id" : 1, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 116, + "column" : 8, + "source_fragment" : "EgressPipeImpl" + }, + "init_table" : null, + "tables" : [], + "action_profiles" : [], + "conditionals" : [] + } + ], + "checksums" : [], + "force_arith" : [], + "extern_instances" : [], + "field_aliases" : [ + [ + "queueing_metadata.enq_timestamp", + ["standard_metadata", "enq_timestamp"] + ], + [ + "queueing_metadata.enq_qdepth", + ["standard_metadata", "enq_qdepth"] + ], + [ + "queueing_metadata.deq_timedelta", + ["standard_metadata", "deq_timedelta"] + ], + [ + "queueing_metadata.deq_qdepth", + ["standard_metadata", "deq_qdepth"] + ], + [ + "intrinsic_metadata.ingress_global_timestamp", + ["standard_metadata", "ingress_global_timestamp"] + ], + [ + "intrinsic_metadata.egress_global_timestamp", + ["standard_metadata", "egress_global_timestamp"] + ], + [ + "intrinsic_metadata.lf_field_list", + ["standard_metadata", "lf_field_list"] + ], + [ + "intrinsic_metadata.mcast_grp", + ["standard_metadata", "mcast_grp"] + ], + [ + "intrinsic_metadata.resubmit_flag", + ["standard_metadata", "resubmit_flag"] + ], + [ + "intrinsic_metadata.egress_rid", + ["standard_metadata", "egress_rid"] + ], + [ + "intrinsic_metadata.recirculate_flag", + ["standard_metadata", "recirculate_flag"] + ], + [ + "intrinsic_metadata.priority", + ["standard_metadata", "priority"] + ] + ], + "program" : "p4src/main.p4", + "__meta__" : { + "version" : [2, 18], + "compiler" : "https://github.com/p4lang/p4c" + } +} \ No newline at end of file diff --git a/src/tests/hackfest3/p4/orig/main.p4 b/src/tests/hackfest3/p4/orig/main.p4 new file mode 100644 index 0000000000000000000000000000000000000000..843eb0d580e362e74b25c768b1b01e750138637a --- /dev/null +++ b/src/tests/hackfest3/p4/orig/main.p4 @@ -0,0 +1,144 @@ +/* + * Copyright 2019-present Open Networking Foundation + * + * 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. + */ + + +#include <core.p4> +#include <v1model.p4> + +typedef bit<9> port_num_t; +typedef bit<48> mac_addr_t; +typedef bit<16> mcast_group_id_t; + +//------------------------------------------------------------------------------ +// HEADER DEFINITIONS +//------------------------------------------------------------------------------ + +header ethernet_t { + mac_addr_t dst_addr; + mac_addr_t src_addr; + bit<16> ether_type; +} + +struct parsed_headers_t { + ethernet_t ethernet; +} + +struct local_metadata_t { + bool is_multicast; +} + + +//------------------------------------------------------------------------------ +// INGRESS PIPELINE +//------------------------------------------------------------------------------ + +parser ParserImpl (packet_in packet, + out parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) +{ + state start { + transition parse_ethernet; + } + + state parse_ethernet { + packet.extract(hdr.ethernet); + transition accept; + } +} + + +control VerifyChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t meta) +{ + apply { /* EMPTY */ } +} + + +control IngressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + + // Drop action shared by many tables. + action drop() { + mark_to_drop(standard_metadata); + } + + action set_egress_port(port_num_t port) { + standard_metadata.egress_spec = port; + } + + action set_multicast_group(mcast_group_id_t gid) { + // gid will be used by the Packet Replication Engine (PRE) in the + // Traffic Manager--located right after the ingress pipeline, to + // replicate a packet to multiple egress ports, specified by the control + // plane by means of P4Runtime MulticastGroupEntry messages. + standard_metadata.mcast_grp = gid; + local_metadata.is_multicast = true; + } + + // --- l2_exact_table ------------------ + + table l2_exact_table { + key = { + standard_metadata.ingress_port: exact; + } + actions = { + set_egress_port; + set_multicast_group; + @defaultonly drop; + } + const default_action = drop; + } + + apply { + l2_exact_table.apply(); + } +} + +//------------------------------------------------------------------------------ +// EGRESS PIPELINE +//------------------------------------------------------------------------------ + +control EgressPipeImpl (inout parsed_headers_t hdr, + inout local_metadata_t local_metadata, + inout standard_metadata_t standard_metadata) { + apply { /* EMPTY */ } +} + + +control ComputeChecksumImpl(inout parsed_headers_t hdr, + inout local_metadata_t local_metadata) +{ + apply { /* EMPTY */ } +} + + +control DeparserImpl(packet_out packet, in parsed_headers_t hdr) { + apply { + packet.emit(hdr.ethernet); + } +} + + +V1Switch( + ParserImpl(), + VerifyChecksumImpl(), + IngressPipeImpl(), + EgressPipeImpl(), + ComputeChecksumImpl(), + DeparserImpl() +) main; diff --git a/src/tests/hackfest3/p4/orig/p4info.txt b/src/tests/hackfest3/p4/orig/p4info.txt new file mode 100644 index 0000000000000000000000000000000000000000..0b58e740864b72e6ca87582431cd7bd57894d0dd --- /dev/null +++ b/src/tests/hackfest3/p4/orig/p4info.txt @@ -0,0 +1,62 @@ +pkg_info { + arch: "v1model" +} +tables { + preamble { + id: 33605373 + name: "IngressPipeImpl.l2_exact_table" + alias: "l2_exact_table" + } + match_fields { + id: 1 + name: "standard_metadata.ingress_port" + bitwidth: 9 + match_type: EXACT + } + action_refs { + id: 16812802 + } + action_refs { + id: 16841371 + } + action_refs { + id: 16796182 + annotations: "@defaultonly" + scope: DEFAULT_ONLY + } + const_default_action_id: 16796182 + size: 1024 +} +actions { + preamble { + id: 16796182 + name: "IngressPipeImpl.drop" + alias: "drop" + } +} +actions { + preamble { + id: 16812802 + name: "IngressPipeImpl.set_egress_port" + alias: "set_egress_port" + } + params { + id: 1 + name: "port" + bitwidth: 9 + } +} +actions { + preamble { + id: 16841371 + name: "IngressPipeImpl.set_multicast_group" + alias: "set_multicast_group" + } + params { + id: 1 + name: "gid" + bitwidth: 16 + } +} +type_info { +} diff --git a/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent new file mode 100755 index 0000000000000000000000000000000000000000..b7cef11a433c6bf2eeb94638fa90d93f25acd3c8 Binary files /dev/null and b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent differ diff --git a/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping new file mode 100755 index 0000000000000000000000000000000000000000..6e943d292dd6653e857bf5eea3258d38ad246026 Binary files /dev/null and b/src/tests/hackfest3/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping differ diff --git a/src/tests/oeccpsc22/deploy_specs_dom1.sh b/src/tests/oeccpsc22/deploy_specs_dom1.sh index 7db9159e00e3044ddeb571b03cf3e05de33a8150..fc82b2c929e5477d0a8de9487c6fe4775ac2a1c6 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom1.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom1.sh @@ -20,7 +20,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui interdomain load_generator" +#export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice compute webui interdomain load_generator" export TFS_COMPONENTS="context device pathcomp service slice interdomain webui" # Set the tag you want to use for your images. diff --git a/src/tests/oeccpsc22/deploy_specs_dom2.sh b/src/tests/oeccpsc22/deploy_specs_dom2.sh index 3e23c56feb3247a1b1bcef1a82feeac049654cb6..9d9ba834175a34d8db5d13e795bd0a8a358c9e1f 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom2.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom2.sh @@ -20,7 +20,7 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui interdomain load_generator" +#export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice compute webui interdomain load_generator" export TFS_COMPONENTS="context device pathcomp service slice interdomain webui" # Set the tag you want to use for your images. diff --git a/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh b/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh index 53b6e76a8bb32310945b29c57946435d98a0b8d3..32582a78a3748457d8b6b6b98d2828ec5ae1eeb6 100755 --- a/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh +++ b/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh @@ -67,7 +67,7 @@ for COMPONENT in $COMPONENTS; do echo " Building Docker image..." BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" - if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then + if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG" else docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG" diff --git a/src/tests/ofc22/deploy_specs.sh b/src/tests/ofc22/deploy_specs.sh index 0c1f57387ee66ed9809695d14a9a8dad7ccda4c5..65aa0b13c3cc6766be17b350be335b6c058775b9 100755 --- a/src/tests/ofc22/deploy_specs.sh +++ b/src/tests/ofc22/deploy_specs.sh @@ -26,9 +26,9 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui" # Uncomment to activate Monitoring export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" -export TFS_COMPONENTS="${TFS_COMPONENTS} automation" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" +export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/ofc23/deploy_specs_child.sh b/src/tests/ofc23/deploy_specs_child.sh index 94c0d4de00c56c8b9b435eb734e112c4f34ab25e..63a1a20d2788dd54d6469dbffa289359dc8c866d 100755 --- a/src/tests/ofc23/deploy_specs_child.sh +++ b/src/tests/ofc23/deploy_specs_child.sh @@ -25,8 +25,8 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui load_ # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/ofc23/deploy_specs_parent.sh b/src/tests/ofc23/deploy_specs_parent.sh index 6bd4dc33b324fb7a301c13695901c28d2375d2d7..fb76b687aace0222b6867a07f2b572e2c831ae4a 100755 --- a/src/tests/ofc23/deploy_specs_parent.sh +++ b/src/tests/ofc23/deploy_specs_parent.sh @@ -25,8 +25,8 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui load_ # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/ofc23/deploy_specs_sligrp.sh b/src/tests/ofc23/deploy_specs_sligrp.sh index 0422c7b103f0fd07cfa9e3b0ea69dcb9a4f7cd05..a16bc7e56949e480e490e8b84e1e62f4c148a5fd 100755 --- a/src/tests/ofc23/deploy_specs_sligrp.sh +++ b/src/tests/ofc23/deploy_specs_sligrp.sh @@ -25,8 +25,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui load_generato # Uncomment to activate Monitoring export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/p4/deploy_specs.sh b/src/tests/p4/deploy_specs.sh index b988123d5564684bd1bfcb776bab7f187fc628ca..6bd8d07c839ce235cc3cba8fcd29be93214a730f 100755 --- a/src/tests/p4/deploy_specs.sh +++ b/src/tests/p4/deploy_specs.sh @@ -16,7 +16,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation service compute monitoring webui" +export TFS_COMPONENTS="context device ztp service compute monitoring webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/src/tests/scenario2/deploy_specs_dom1.sh b/src/tests/scenario2/deploy_specs_dom1.sh index 7dd777fbee12537729e8408fe671074a1e9b19f1..1180c1af1deb0d2bd79c1749941c79233a1ae5bd 100755 --- a/src/tests/scenario2/deploy_specs_dom1.sh +++ b/src/tests/scenario2/deploy_specs_dom1.sh @@ -26,8 +26,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/scenario2/deploy_specs_dom2.sh b/src/tests/scenario2/deploy_specs_dom2.sh index bb6ce2f0c390d3253696e62bf23aa85b0d16782e..37420409053c50cc44647f3d58d1c15bc1ce28ec 100755 --- a/src/tests/scenario2/deploy_specs_dom2.sh +++ b/src/tests/scenario2/deploy_specs_dom2.sh @@ -26,8 +26,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/scenario2/deploy_specs_dom3.sh b/src/tests/scenario2/deploy_specs_dom3.sh index 797d55894a143308935664f2c879260dfd2760ec..4b31ed9a3e7b85facf787f72e200bd8ec831576d 100755 --- a/src/tests/scenario2/deploy_specs_dom3.sh +++ b/src/tests/scenario2/deploy_specs_dom3.sh @@ -26,8 +26,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/scenario2/deploy_specs_dom4.sh b/src/tests/scenario2/deploy_specs_dom4.sh index d2fe2abfa981d498558d263ca053093e017225d2..e281802af208b9066cb0ae4381ebc499f609ec61 100755 --- a/src/tests/scenario2/deploy_specs_dom4.sh +++ b/src/tests/scenario2/deploy_specs_dom4.sh @@ -26,8 +26,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py b/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py index cfe21603de85862e83d7dd8b9fb4eebefd99b702..cb1d8318da37725b5adf66b5dc06e454c48f4e53 100644 --- a/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py +++ b/src/tests/scenario2/old_tests/tests/test_functional_bootstrap.py @@ -117,7 +117,7 @@ def test_devices_bootstraping( assert response.device_uuid.uuid == device_uuid #expected_events.extend([ - # # Device creation, update for automation to start the device + # # Device creation, update for ztp to start the device # ('DeviceEvent', EVENT_CREATE, json_device_id(device_uuid)), # #('DeviceEvent', EVENT_UPDATE, json_device_id(device_uuid)), #]) @@ -216,4 +216,4 @@ def test_scenario_alarms_created(monitoring_client: MonitoringClient, alarm_desc monitoring_client.SetKpiAlarm(new_alarm_descriptor) response: AlarmList = monitoring_client.GetAlarms(Empty()) - assert len(response.alarm_descriptor) == 16 \ No newline at end of file + assert len(response.alarm_descriptor) == 16 diff --git a/src/tests/scenario3/l3/deploy_specs.sh b/src/tests/scenario3/l3/deploy_specs.sh index 8c8264fca75d471c3bbbf0cb523c7a17bcffa5a0..6f594fca4168c3c0e3590b40e65a90606e9f08f9 100644 --- a/src/tests/scenario3/l3/deploy_specs.sh +++ b/src/tests/scenario3/l3/deploy_specs.sh @@ -26,8 +26,8 @@ export TFS_COMPONENTS="context device pathcomp service slice webui" # Uncomment to activate Monitoring export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate Automation and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy" +# Uncomment to activate ZTP and Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/scenario3/optical/deploy_specs.sh b/src/tests/scenario3/optical/deploy_specs.sh index 73c9112254c3e95eea4155abd7afd26ee358e368..dca0a08bba2bd903469448c44f636dfeb1eea5e8 100644 --- a/src/tests/scenario3/optical/deploy_specs.sh +++ b/src/tests/scenario3/optical/deploy_specs.sh @@ -17,7 +17,7 @@ # ----- TeraFlowSDN ------------------------------------------------------------ # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator" +export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice compute webui load_generator" # addition for the optical cybersecurity component export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" diff --git a/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh b/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh index fb0629dc4ce600f7bea058a7bcfbbd261ac157cb..ea39e8147d33d8b6f60a9b26c4f510df9fec5fe8 100755 --- a/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh +++ b/src/tests/tools/mock_mw_sdn_ctrl/scenario/microwave_deploy.sh @@ -17,7 +17,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. # Supported components are: -# context device automation policy service compute monitoring webui +# context device ztp policy service compute monitoring webui # interdomain slice pathcomp dlt # dbscanserving opticalattackmitigator opticalattackdetector # l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector diff --git a/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile b/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile index ad214b97c091bf82a8bfe5c0ce4183d0bae2766e..70fc81e5408d49ae332132612d0f86c1d5901e38 100644 --- a/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile +++ b/src/tests/tools/mock_mw_sdn_ctrl/ssl_not_working/Dockerfile @@ -22,7 +22,7 @@ RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --upgrade setuptools wheel RUN python3 -m pip install --upgrade pip-tools -# Create component sub-folder, and copy content +# Create component sub-folders, and copy content RUN mkdir -p /var/teraflow/mock_mw_sdn_ctrl WORKDIR /var/teraflow/mock_mw_sdn_ctrl COPY . . diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile index 2a1510954dbd2a9b0817f94145baaa22ac9d3a3f..ab0b2c4418dab4004792d4d8932d635cb42f734b 100644 --- a/src/webui/Dockerfile +++ b/src/webui/Dockerfile @@ -18,7 +18,7 @@ FROM python:3.9-slim # Install dependencies # RUN apt-get --yes --quiet --quiet update && \ -# apt-get --yes --quiet --quiet install wget g++ && \ +# apt-get --yes --quiet --quiet install wget g++ git && \ # rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur diff --git a/src/webui/service/device/forms.py b/src/webui/service/device/forms.py index e884e96a511ab90625bda257075c80adce4406cd..bcd5804d32927763344d08371320fdde5f2fcab7 100644 --- a/src/webui/service/device/forms.py +++ b/src/webui/service/device/forms.py @@ -27,7 +27,7 @@ class AddDeviceForm(FlaskForm): device_drivers_transport_api = BooleanField('TRANSPORT_API') device_drivers_p4 = BooleanField('P4') device_drivers_ietf_network_topology = BooleanField('IETF_NETWORK_TOPOLOGY') - device_drivers_onf_tr_352 = BooleanField('ONF_TR_352') + device_drivers_onf_tr_532 = BooleanField('ONF_TR_532') device_drivers_xr = BooleanField('XR') device_drivers_ietf_l2vpn = BooleanField('IETF L2VPN') device_drivers_gnmi_openconfig = BooleanField('GNMI OPENCONFIG') diff --git a/src/webui/service/device/routes.py b/src/webui/service/device/routes.py index 4590c7f01a24e801ecc775ad0b22cf0dcdea3452..ce15c7abaa527191e87dcaeee5b91599014c1e72 100644 --- a/src/webui/service/device/routes.py +++ b/src/webui/service/device/routes.py @@ -116,8 +116,8 @@ def add(): device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_P4) if form.device_drivers_ietf_network_topology.data: device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY) - if form.device_drivers_onf_tr_352.data: - device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352) + if form.device_drivers_onf_tr_532.data: + device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532) if form.device_drivers_xr.data: device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_XR) if form.device_drivers_ietf_l2vpn.data: @@ -149,6 +149,16 @@ def detail(device_uuid: str): return render_template( 'device/detail.html', device=device_obj, dde=DeviceDriverEnum, dose=DeviceOperationalStatusEnum) + +@device.route('inventory/<path:device_uuid>', methods=['GET', 'POST']) +def inventory(device_uuid: str): + context_client.connect() + device_obj = get_device(context_client, device_uuid, rw_copy=False) + if device_obj is None: + flash('Device({:s}) not found'.format(str(device_uuid)), 'danger') + device_obj = Device() + context_client.close() + return render_template('device/inventory.html', device=device_obj) @device.get('<path:device_uuid>/delete') def delete(device_uuid): diff --git a/src/webui/service/templates/device/add.html b/src/webui/service/templates/device/add.html index c9165667dd8c089e91400f652177b4ca4ec98010..c115657aa08828849172345ca50caaeb4150fe0f 100644 --- a/src/webui/service/templates/device/add.html +++ b/src/webui/service/templates/device/add.html @@ -87,7 +87,7 @@ <br /> {{ form.device_drivers_p4 }} {{ form.device_drivers_p4.label(class="col-sm-3 col-form-label") }} {{ form.device_drivers_ietf_network_topology }} {{form.device_drivers_ietf_network_topology.label(class="col-sm-3 col-form-label") }} - {{ form.device_drivers_onf_tr_352 }} {{ form.device_drivers_onf_tr_352.label(class="col-sm-3 col-form-label") }} + {{ form.device_drivers_onf_tr_532 }} {{ form.device_drivers_onf_tr_532.label(class="col-sm-3 col-form-label") }} <br /> {{ form.device_drivers_xr }} {{ form.device_drivers_xr.label(class="col-sm-3 col-form-label") }} {{ form.device_drivers_ietf_l2vpn }} {{ form.device_drivers_ietf_l2vpn.label(class="col-sm-3 col-form-label") }} diff --git a/src/webui/service/templates/device/detail.html b/src/webui/service/templates/device/detail.html index c35ae163d3f8344f1ebb49241cc15a4afa3401d5..a9c069ac3a526af46392ffd2f23205a7604dbb7d 100644 --- a/src/webui/service/templates/device/detail.html +++ b/src/webui/service/templates/device/detail.html @@ -87,7 +87,6 @@ </table> </div> </div> -</div> <b>Configurations:</b> diff --git a/src/webui/service/templates/device/home.html b/src/webui/service/templates/device/home.html index 53434196f85c3a8c79fe9b861204e9bd8c6a5d8f..e356fd4fbeccc6e735d9723b8b1ca3e5fcf865ec 100644 --- a/src/webui/service/templates/device/home.html +++ b/src/webui/service/templates/device/home.html @@ -50,6 +50,7 @@ <th scope="col">Status</th> <th scope="col">Config Rules</th> <th scope="col"></th> + <th scope="col"></th> </tr> </thead> <tbody> @@ -74,6 +75,14 @@ </svg> </a> </td> + <td> + <a href="{{ url_for('device.inventory', 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-pci-card" viewBox="0 0 16 16"> + <path d="M0 1.5A.5.5 0 0 1 .5 1h1a.5.5 0 0 1 .5.5V4h13.5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5H2v2.5a.5.5 0 0 1-1 0V2H.5a.5.5 0 0 1-.5-.5Z"/> + <path d="M3 12.5h3.5v1a.5.5 0 0 1-.5.5H3.5a.5.5 0 0 1-.5-.5v-1Zm4 0h4v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1Z"/> + </svg> + </a> + </td> </tr> {% endfor %} {% else %} diff --git a/src/webui/service/templates/device/inventory.html b/src/webui/service/templates/device/inventory.html new file mode 100644 index 0000000000000000000000000000000000000000..17c14785a89658b59e07373bc7d939e234937631 --- /dev/null +++ b/src/webui/service/templates/device/inventory.html @@ -0,0 +1,151 @@ +<!-- + Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +{% extends 'base.html' %} + +{% block content %} +<style> + ul, + #myUL { + list-style-type: none; + } + + #myUL { + margin: 0; + padding: 0; + } + + .caret { + cursor: pointer; + -webkit-user-select: none; + /* Safari 3.1+ */ + -moz-user-select: none; + /* Firefox 2+ */ + -ms-user-select: none; + /* IE 10+ */ + user-select: none; + } + + .caret::before { + content: "\25B6"; + color: black; + display: inline-block; + margin-right: 6px; + } + + .caret-down::before { + -ms-transform: rotate(90deg); + /* IE 9 */ + -webkit-transform: rotate(90deg); + /* Safari */ + transform: rotate(90deg); + } + + .nested { + display: none; + } + + .active { + display: block; + } +</style> + +<h1>Device {{ device.name }} ({{ 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='{{ url_for('device.home') }}'"> + <i class="bi bi-box-arrow-in-left"></i> + Back to device list + </button> + </div> +</div> + +<br> +<div class="row mb-3"> + <div class="col-sm-3"> + <ul id="myUL"> + <li><span class="caret"></span>Components</span> + <ul class="nested"> + {% for item in (device.components|sort(true, attribute='name')) %} + {% if item.parent |length < 1 or item.type=='CHASSIS' %} + <li><span class="caret"></span>{{item.name}}</span> + <ul class="nested"> + {% for comp in (device.components|sort(true, attribute='name')) %} + {% if item.name == comp.parent %} + <li>{{comp.name}}</li> + {% endif %} + {% endfor %} + </ul> + </li> + {% endif %} + {% endfor %} + </ul> + </li> + </ul> + + <script> + var toggler = document.getElementsByClassName("caret"); + var i; + + for (i = 0; i < toggler.length; i++) { + toggler[i].addEventListener("click", function() { + this.parentElement.querySelector(".nested").classList.toggle("active"); + this.classList.toggle("caret-down"); + }); + } + </script> + + </div> + {% if device.components|length > 1 %} + <div class="col-sm-8"> + <table class="table table-striped table-hover"> + <thead> + <tr> + <th scope="col">Component UUID</th> + <th scope="col">Name</th> + <th scope="col">Type</th> + <th scope="col">Parent</th> + <th scope="col">Attributes</th> + </tr> + </thead> + <tbody> + {% for component in (device.components|sort(true, attribute='name')) %} + <tr> + <td> + {{ component.component_uuid.uuid }} + </td> + <td> + {{ component.name }} + </td> + <td> + {{ component.type }} + </td> + <td> + {{ component.parent }} + </td> + <td> + {{ component.attributes }} + </td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + {% endif %} +</div> + +{% endblock %} diff --git a/src/automation/.dockerignore b/src/ztp/.dockerignore similarity index 100% rename from src/automation/.dockerignore rename to src/ztp/.dockerignore diff --git a/src/automation/.env.example b/src/ztp/.env.example similarity index 100% rename from src/automation/.env.example rename to src/ztp/.env.example diff --git a/src/automation/.gitignore b/src/ztp/.gitignore similarity index 100% rename from src/automation/.gitignore rename to src/ztp/.gitignore diff --git a/src/automation/.gitlab-ci.yml b/src/ztp/.gitlab-ci.yml similarity index 90% rename from src/automation/.gitlab-ci.yml rename to src/ztp/.gitlab-ci.yml index 0dc6284a4086253e64138343a989055581eccdda..a40a14f495b46da55f47d1bbb851fc62e261b32c 100644 --- a/src/automation/.gitlab-ci.yml +++ b/src/ztp/.gitlab-ci.yml @@ -13,12 +13,12 @@ # limitations under the License. variables: - IMAGE_NAME: 'automation' + IMAGE_NAME: 'ztp' REPORTS_PATH: "src/${IMAGE_NAME}/reports" BUILD_ENV: build.env # Package application needed to run tests & build the image on next stage -build automation: +build ztp: stage: build script: - export IMAGE_TAG=$(grep -m1 '<version>' ./src/$IMAGE_NAME/pom.xml | grep -oP '(?<=>).*(?=<)') @@ -39,12 +39,12 @@ build automation: - .gitlab-ci.yml # Run tests, build & push the image -unit_test automation: +unit_test ztp: variables: REPORTS_CONTAINER: "${IMAGE_NAME}-reports" stage: unit_test needs: - - build automation + - build ztp before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker rm ${REPORTS_CONTAINER} || true @@ -79,18 +79,18 @@ unit_test automation: - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -## Deployment of automation service in Kubernetes Cluster -#deploy automation: +## Deployment of ztp service in Kubernetes Cluster +#deploy ztp: # stage: deploy # needs: -# - build automation -# - unit_test automation +# - build ztp +# - unit_test ztp # script: # - kubectl version # - kubectl get all -# - kubectl delete --ignore-not-found=true -f "manifests/automationservice.yaml" -# - kubectl apply -f "manifests/automationservice.yaml" -# - kubectl delete pods --selector app=automationservice +# - kubectl delete --ignore-not-found=true -f "manifests/ztpservice.yaml" +# - kubectl apply -f "manifests/ztpservice.yaml" +# - kubectl delete pods --selector app=ztpservice # - kubectl get all # rules: # - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' diff --git a/src/automation/.java-version b/src/ztp/.java-version similarity index 100% rename from src/automation/.java-version rename to src/ztp/.java-version diff --git a/src/automation/.mvn/wrapper/MavenWrapperDownloader.java b/src/ztp/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from src/automation/.mvn/wrapper/MavenWrapperDownloader.java rename to src/ztp/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/src/automation/.mvn/wrapper/maven-wrapper.jar b/src/ztp/.mvn/wrapper/maven-wrapper.jar similarity index 100% rename from src/automation/.mvn/wrapper/maven-wrapper.jar rename to src/ztp/.mvn/wrapper/maven-wrapper.jar diff --git a/src/automation/.mvn/wrapper/maven-wrapper.properties b/src/ztp/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from src/automation/.mvn/wrapper/maven-wrapper.properties rename to src/ztp/.mvn/wrapper/maven-wrapper.properties diff --git a/src/automation/Dockerfile b/src/ztp/Dockerfile similarity index 100% rename from src/automation/Dockerfile rename to src/ztp/Dockerfile diff --git a/src/automation/README.md b/src/ztp/README.md similarity index 69% rename from src/automation/README.md rename to src/ztp/README.md index e98d2b8ab62563f43cf2c1011e91fb2a1d08d378..54454464e40ed86101d84b8d69e38287d17b07de 100644 --- a/src/automation/README.md +++ b/src/ztp/README.md @@ -1,25 +1,25 @@ -# TeraFlowSDN Automation service +# TeraFlowSDN Ztp service -This repository hosts the TeraFlowSDN Automation service, also known as Zero-Touch Provisioning (ZTP) service. +This repository hosts the TeraFlowSDN Ztp service, also known as Zero-Touch Provisioning (ZTP) service. Follow the instructions below to build, test, and run this service on your local environment. -## TeraFlowSDN Automation service architecture +## TeraFlowSDN Ztp service architecture -The TeraFlowSDN Automation architecture consists of six (6) interfaces listed below: +The TeraFlowSDN Ztp architecture consists of six (6) interfaces listed below: Interfaces | |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 1. The `AutomationGateway` interface that implements all the RPC functions that are described in `automation.proto` file. | +| 1. The `ZtpGateway` interface that implements all the RPC functions that are described in `ztp.proto` file. | | 2. The `ContextGateway` interface that communicates with a `Context` Service gRPC client to invoke key RPC functions described in `context.proto` file. | | 3. The `DeviceGateway` interface that communicates with a `Device` Service gRPC client to invoke key RPC functions described in `device.proto` file. | -| 4. The `AutomationService` interface that implements the `addDevice()`, `updateDevice()`, and `deleteDevice()` methods by communicating with a `Context` gRPC client and a `Device` gRPC client through the use of `ContextService` interface and `DeviceService` interface respectively. | +| 4. The `ZtpService` interface that implements the `addDevice()`, `updateDevice()`, and `deleteDevice()` methods by communicating with a `Context` gRPC client and a `Device` gRPC client through the use of `ContextService` interface and `DeviceService` interface respectively. | | 5. The `ContextService` interface that implements the `getDevice()` and `getDeviceEvents()` methods by communicating with a `Context` gRPC client through the use of `ContextGateway` interface. | | 6. The `DeviceService` interface that implements the `getInitialConfiguration()`, `configureDevice()`, and `deleteDevice()` methods by communicating with a `Device` gRPC client through the use of `DeviceGateway` interface. | ## Prerequisites -The Automation service is currently tested against Ubuntu 20.04 and Java 11. +The Ztp service is currently tested against Ubuntu 20.04 and Java 11. To quickly install Java 11 on a Debian-based Linux distro do: @@ -64,7 +64,7 @@ To create the K8s manifest file under `target/kubernetes/kubernetes.yml` to be u To deploy the application in a K8s cluster run ```bash -kubectl apply -f "manifests/automationservice.yaml" +kubectl apply -f "manifests/ztpservice.yaml" ``` ## Maintainers diff --git a/src/automation/mvnw b/src/ztp/mvnw similarity index 100% rename from src/automation/mvnw rename to src/ztp/mvnw diff --git a/src/automation/mvnw.cmd b/src/ztp/mvnw.cmd similarity index 100% rename from src/automation/mvnw.cmd rename to src/ztp/mvnw.cmd diff --git a/src/automation/pom.xml b/src/ztp/pom.xml similarity index 98% rename from src/automation/pom.xml rename to src/ztp/pom.xml index 7dfc3dac438fa5df740381be0ef595a5734d7699..aeadbc57240032edcaf40960fcd8df3b5a48d2b5 100644 --- a/src/automation/pom.xml +++ b/src/ztp/pom.xml @@ -20,10 +20,10 @@ <modelVersion>4.0.0</modelVersion> <groupId>eu.teraflow</groupId> - <artifactId>automation</artifactId> + <artifactId>ztp</artifactId> <version>0.2.0</version> - <name>TeraFlow Automation Component</name> - <description>TeraFlow Automation Component</description> + <name>TeraFlow ZTP Component</name> + <description>TeraFlow ZTP Component</description> <properties> <java.version>11</java.version> @@ -297,7 +297,7 @@ <version>${jacoco.version}</version> <configuration> <excludes> - <exclude>automation/*</exclude> + <exclude>ztp/*</exclude> <exclude>context/*</exclude> <exclude>device/*</exclude> <exclude>monitoring/*</exclude> diff --git a/src/automation/src/main/docker/Dockerfile.multistage.jvm b/src/ztp/src/main/docker/Dockerfile.multistage.jvm similarity index 100% rename from src/automation/src/main/docker/Dockerfile.multistage.jvm rename to src/ztp/src/main/docker/Dockerfile.multistage.jvm diff --git a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java b/src/ztp/src/main/java/eu/teraflow/ztp/ContextSubscriber.java similarity index 79% rename from src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java rename to src/ztp/src/main/java/eu/teraflow/ztp/ContextSubscriber.java index 4813da7bfdeaf7c24b1892e2a4d596aa596c3674..0d2c63209eaed3b9c9c19b6bd3ba6f7e561914f1 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/ContextSubscriber.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; -import eu.teraflow.automation.context.ContextService; -import eu.teraflow.automation.context.model.Event; -import eu.teraflow.automation.context.model.EventTypeEnum; +import eu.teraflow.ztp.context.ContextService; +import eu.teraflow.ztp.context.model.Event; +import eu.teraflow.ztp.context.model.EventTypeEnum; import io.quarkus.runtime.StartupEvent; import java.time.Duration; import javax.enterprise.context.ApplicationScoped; @@ -32,17 +32,15 @@ public class ContextSubscriber { private static final Logger LOGGER = Logger.getLogger(ContextSubscriber.class); private final ContextService contextService; - private final AutomationService automationService; - private final AutomationConfiguration automationConfiguration; + private final ZtpService ztpService; + private final ZtpConfiguration ztpConfiguration; @Inject public ContextSubscriber( - ContextService contextService, - AutomationService automationService, - AutomationConfiguration automationConfiguration) { + ContextService contextService, ZtpService ztpService, ZtpConfiguration ztpConfiguration) { this.contextService = contextService; - this.automationService = automationService; - this.automationConfiguration = automationConfiguration; + this.ztpService = ztpService; + this.ztpConfiguration = ztpConfiguration; } public void listenForDeviceEvents() { @@ -71,16 +69,16 @@ public class ContextSubscriber { switch (eventType) { case CREATE: LOGGER.infof("Received %s for device [%s]", event, deviceId); - automationService.addDevice(deviceEvent.getDeviceId()); + ztpService.addDevice(deviceEvent.getDeviceId()); break; case REMOVE: LOGGER.infof("Received %s for device [%s]", event, deviceId); - automationService.deleteDevice(deviceEvent.getDeviceId()); + ztpService.deleteDevice(deviceEvent.getDeviceId()); break; case UPDATE: LOGGER.warnf( "Received %s for device [%s]. " - + "No automation action on an already updated device", + + "No ztp action on an already updated device", event, deviceId); break; case UNDEFINED: @@ -92,7 +90,7 @@ public class ContextSubscriber { void onStart(@Observes StartupEvent ev) { - if (automationConfiguration.shouldSubscribeToContextComponent()) { + if (ztpConfiguration.shouldSubscribeToContextComponent()) { LOGGER.info("Subscribing to Context service for device events..."); listenForDeviceEvents(); } else { diff --git a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java b/src/ztp/src/main/java/eu/teraflow/ztp/Serializer.java similarity index 91% rename from src/automation/src/main/java/eu/teraflow/automation/Serializer.java rename to src/ztp/src/main/java/eu/teraflow/ztp/Serializer.java index b0729aa55b25da030f9722330e22a0976a3d007f..e1196bb600382327295966cfe7bb4539f543b976 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/Serializer.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/Serializer.java @@ -14,11 +14,9 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import acl.Acl; -import automation.Automation; -import automation.Automation.ZtpDeviceState; import context.ContextOuterClass; import context.ContextOuterClass.ConfigRule_ACL; import context.ContextOuterClass.ConfigRule_Custom; @@ -27,43 +25,45 @@ import context.ContextOuterClass.DeviceId; import context.ContextOuterClass.DeviceOperationalStatusEnum; import context.ContextOuterClass.Location.LocationCase; import context.ContextOuterClass.Uuid; -import eu.teraflow.automation.acl.AclAction; -import eu.teraflow.automation.acl.AclEntry; -import eu.teraflow.automation.acl.AclForwardActionEnum; -import eu.teraflow.automation.acl.AclLogActionEnum; -import eu.teraflow.automation.acl.AclMatch; -import eu.teraflow.automation.acl.AclRuleSet; -import eu.teraflow.automation.acl.AclRuleTypeEnum; -import eu.teraflow.automation.context.model.ConfigActionEnum; -import eu.teraflow.automation.context.model.ConfigRule; -import eu.teraflow.automation.context.model.ConfigRuleAcl; -import eu.teraflow.automation.context.model.ConfigRuleCustom; -import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; -import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.DeviceDriverEnum; -import eu.teraflow.automation.context.model.DeviceEvent; -import eu.teraflow.automation.context.model.DeviceOperationalStatus; -import eu.teraflow.automation.context.model.Empty; -import eu.teraflow.automation.context.model.EndPoint; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.Event; -import eu.teraflow.automation.context.model.EventTypeEnum; -import eu.teraflow.automation.context.model.GpsPosition; -import eu.teraflow.automation.context.model.Location; -import eu.teraflow.automation.context.model.LocationTypeGpsPosition; -import eu.teraflow.automation.context.model.LocationTypeRegion; -import eu.teraflow.automation.context.model.TopologyId; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; -import eu.teraflow.automation.model.DeviceRole; -import eu.teraflow.automation.model.DeviceRoleConfig; -import eu.teraflow.automation.model.DeviceRoleId; -import eu.teraflow.automation.model.DeviceRoleType; -import eu.teraflow.automation.model.DeviceState; +import eu.teraflow.ztp.acl.AclAction; +import eu.teraflow.ztp.acl.AclEntry; +import eu.teraflow.ztp.acl.AclForwardActionEnum; +import eu.teraflow.ztp.acl.AclLogActionEnum; +import eu.teraflow.ztp.acl.AclMatch; +import eu.teraflow.ztp.acl.AclRuleSet; +import eu.teraflow.ztp.acl.AclRuleTypeEnum; +import eu.teraflow.ztp.context.model.ConfigActionEnum; +import eu.teraflow.ztp.context.model.ConfigRule; +import eu.teraflow.ztp.context.model.ConfigRuleAcl; +import eu.teraflow.ztp.context.model.ConfigRuleCustom; +import eu.teraflow.ztp.context.model.ConfigRuleTypeAcl; +import eu.teraflow.ztp.context.model.ConfigRuleTypeCustom; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.DeviceDriverEnum; +import eu.teraflow.ztp.context.model.DeviceEvent; +import eu.teraflow.ztp.context.model.DeviceOperationalStatus; +import eu.teraflow.ztp.context.model.Empty; +import eu.teraflow.ztp.context.model.EndPoint; +import eu.teraflow.ztp.context.model.EndPointId; +import eu.teraflow.ztp.context.model.Event; +import eu.teraflow.ztp.context.model.EventTypeEnum; +import eu.teraflow.ztp.context.model.GpsPosition; +import eu.teraflow.ztp.context.model.Location; +import eu.teraflow.ztp.context.model.LocationTypeGpsPosition; +import eu.teraflow.ztp.context.model.LocationTypeRegion; +import eu.teraflow.ztp.context.model.TopologyId; +import eu.teraflow.ztp.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.ztp.model.DeviceRole; +import eu.teraflow.ztp.model.DeviceRoleConfig; +import eu.teraflow.ztp.model.DeviceRoleId; +import eu.teraflow.ztp.model.DeviceRoleType; +import eu.teraflow.ztp.model.DeviceState; import java.util.stream.Collectors; import javax.inject.Singleton; import kpi_sample_types.KpiSampleTypes; +import ztp.Ztp; +import ztp.Ztp.ZtpDeviceState; @Singleton public class Serializer { @@ -81,8 +81,8 @@ public class Serializer { return deviceId.getDeviceUuid().getUuid(); } - public Automation.DeviceRoleId serialize(DeviceRoleId deviceRoleId) { - final var builder = Automation.DeviceRoleId.newBuilder(); + public Ztp.DeviceRoleId serialize(DeviceRoleId deviceRoleId) { + final var builder = Ztp.DeviceRoleId.newBuilder(); final var deviceRoleDevRoleId = deviceRoleId.getId(); final var deviceRoleDeviceId = deviceRoleId.getDeviceId(); @@ -98,29 +98,29 @@ public class Serializer { return builder.build(); } - public DeviceRoleId deserialize(Automation.DeviceRoleId deviceRoleId) { + public DeviceRoleId deserialize(Ztp.DeviceRoleId deviceRoleId) { final var devRoleId = deserialize(deviceRoleId.getDevRoleId()); final var devId = deserialize(deviceRoleId.getDevId()); return new DeviceRoleId(devRoleId, devId); } - public Automation.DeviceRoleType serialize(DeviceRoleType deviceRoleType) { + public Ztp.DeviceRoleType serialize(DeviceRoleType deviceRoleType) { switch (deviceRoleType) { case NONE: - return Automation.DeviceRoleType.NONE; + return Ztp.DeviceRoleType.NONE; case DEV_OPS: - return Automation.DeviceRoleType.DEV_OPS; + return Ztp.DeviceRoleType.DEV_OPS; case DEV_CONF: - return Automation.DeviceRoleType.DEV_CONF; + return Ztp.DeviceRoleType.DEV_CONF; case PIPELINE_CONF: - return Automation.DeviceRoleType.PIPELINE_CONF; + return Ztp.DeviceRoleType.PIPELINE_CONF; default: - return Automation.DeviceRoleType.UNRECOGNIZED; + return Ztp.DeviceRoleType.UNRECOGNIZED; } } - public DeviceRoleType deserialize(Automation.DeviceRoleType serializedDeviceRoleType) { + public DeviceRoleType deserialize(Ztp.DeviceRoleType serializedDeviceRoleType) { switch (serializedDeviceRoleType) { case DEV_OPS: return DeviceRoleType.DEV_OPS; @@ -135,7 +135,7 @@ public class Serializer { } } - public Automation.ZtpDeviceState serialize(DeviceState deviceState) { + public Ztp.ZtpDeviceState serialize(DeviceState deviceState) { switch (deviceState) { case CREATED: return ZtpDeviceState.ZTP_DEV_STATE_CREATED; @@ -150,7 +150,7 @@ public class Serializer { } } - public DeviceState deserialize(Automation.ZtpDeviceState serializedDeviceState) { + public DeviceState deserialize(Ztp.ZtpDeviceState serializedDeviceState) { switch (serializedDeviceState) { case ZTP_DEV_STATE_CREATED: return DeviceState.CREATED; @@ -165,8 +165,8 @@ public class Serializer { } } - public Automation.DeviceRole serialize(DeviceRole deviceRole) { - final var builder = Automation.DeviceRole.newBuilder(); + public Ztp.DeviceRole serialize(DeviceRole deviceRole) { + final var builder = Ztp.DeviceRole.newBuilder(); final var serializedDeviceRoleId = serialize(deviceRole.getDeviceRoleId()); final var serializedDeviceRoleType = serialize(deviceRole.getType()); @@ -176,15 +176,15 @@ public class Serializer { return builder.build(); } - public DeviceRole deserialize(Automation.DeviceRole deviceRole) { + public DeviceRole deserialize(Ztp.DeviceRole deviceRole) { final var deviceRoleId = deserialize(deviceRole.getDevRoleId()); final var deviceRoleType = deserialize(deviceRole.getDevRoleType()); return new DeviceRole(deviceRoleId, deviceRoleType); } - public Automation.DeviceRoleConfig serialize(DeviceRoleConfig deviceRoleConfig) { - final var builder = Automation.DeviceRoleConfig.newBuilder(); + public Ztp.DeviceRoleConfig serialize(DeviceRoleConfig deviceRoleConfig) { + final var builder = Ztp.DeviceRoleConfig.newBuilder(); final var serializedDeviceRole = serialize(deviceRoleConfig.getDeviceRole()); final var serializedDeviceConfig = serialize(deviceRoleConfig.getDeviceConfig()); @@ -194,7 +194,7 @@ public class Serializer { return builder.build(); } - public DeviceRoleConfig deserialize(Automation.DeviceRoleConfig deviceRoleConfig) { + public DeviceRoleConfig deserialize(Ztp.DeviceRoleConfig deviceRoleConfig) { final var deviceRole = deserialize(deviceRoleConfig.getDevRole()); final var deviceConfig = deserialize(deviceRoleConfig.getDevConfig()); @@ -849,8 +849,8 @@ public class Serializer { return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4; case IETF_NETWORK_TOPOLOGY: return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; - case ONF_TR_352: - return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352; + case ONF_TR_532: + return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532; case XR: return ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR; case IETF_L2VPN: @@ -872,8 +872,8 @@ public class Serializer { return DeviceDriverEnum.P4; case DEVICEDRIVER_IETF_NETWORK_TOPOLOGY: return DeviceDriverEnum.IETF_NETWORK_TOPOLOGY; - case DEVICEDRIVER_ONF_TR_352: - return DeviceDriverEnum.ONF_TR_352; + case DEVICEDRIVER_ONF_TR_532: + return DeviceDriverEnum.ONF_TR_532; case DEVICEDRIVER_XR: return DeviceDriverEnum.XR; case DEVICEDRIVER_IETF_L2VPN: diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java b/src/ztp/src/main/java/eu/teraflow/ztp/SimpleLivenessCheck.java similarity index 90% rename from src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java rename to src/ztp/src/main/java/eu/teraflow/ztp/SimpleLivenessCheck.java index 7b7a3b0753dc8591fd44d800495ec80f822a4f93..b5d40e903e585664ea9fe975a82afb6236db33a5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/SimpleLivenessCheck.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/SimpleLivenessCheck.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.health.HealthCheck; @@ -27,6 +27,6 @@ public class SimpleLivenessCheck implements HealthCheck { @Override public HealthCheckResponse call() { - return HealthCheckResponse.up("Automation Service is live"); + return HealthCheckResponse.up("Ztp Service is live"); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java b/src/ztp/src/main/java/eu/teraflow/ztp/SimpleReadinessCheck.java similarity index 90% rename from src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java rename to src/ztp/src/main/java/eu/teraflow/ztp/SimpleReadinessCheck.java index c9fd4855b7a2e9f5853b7cd9fbea5d896560723e..d98b3370d99c72d0ad259efc3f6d69d4ebe9f9fa 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/SimpleReadinessCheck.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import javax.enterprise.context.ApplicationScoped; import org.eclipse.microprofile.health.HealthCheck; @@ -28,6 +28,6 @@ public class SimpleReadinessCheck implements HealthCheck { @Override public HealthCheckResponse call() { - return HealthCheckResponse.up("Automation Service is ready"); + return HealthCheckResponse.up("Ztp Service is ready"); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpConfiguration.java similarity index 86% rename from src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java rename to src/ztp/src/main/java/eu/teraflow/ztp/ZtpConfiguration.java index 071e8f152da60017d7fb5563ed5e498156a49c37..4e0ab96fa016ea26640949f7c14e5f420e289c03 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationConfiguration.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpConfiguration.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import io.smallrye.config.ConfigMapping; -@ConfigMapping(prefix = "automation") -public interface AutomationConfiguration { +@ConfigMapping(prefix = "ztp") +public interface ZtpConfiguration { boolean shouldSubscribeToContextComponent(); } diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpGateway.java similarity index 82% rename from src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java rename to src/ztp/src/main/java/eu/teraflow/ztp/ZtpGateway.java index 53803f51657d96475db8828f123cdefbb443f0ab..69b3f5550906b46acadb1de363760c843708e7ba 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGateway.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpGateway.java @@ -14,8 +14,8 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; -import automation.AutomationService; +import ztp.ZtpService; -public interface AutomationGateway extends AutomationService {} +public interface ZtpGateway extends ZtpService {} diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpGatewayImpl.java similarity index 53% rename from src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/ZtpGatewayImpl.java index 217c76671cbb8524c7f0c0218e83fedc5e52bdb0..bc56048178cb5b301415a233af24d6d40be70605 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationGatewayImpl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpGatewayImpl.java @@ -14,102 +14,100 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; -import automation.Automation; -import automation.Automation.DeviceRoleConfig; -import automation.Automation.DeviceRoleState; import context.ContextOuterClass; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.model.DeviceRoleId; -import eu.teraflow.automation.model.DeviceState; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.model.DeviceRoleId; +import eu.teraflow.ztp.model.DeviceState; import io.quarkus.grpc.GrpcService; import io.smallrye.mutiny.Uni; import javax.inject.Inject; import org.eclipse.microprofile.metrics.MetricUnits; import org.eclipse.microprofile.metrics.annotation.Counted; import org.eclipse.microprofile.metrics.annotation.Timed; +import ztp.Ztp; +import ztp.Ztp.DeviceRoleConfig; +import ztp.Ztp.DeviceRoleState; @GrpcService -public class AutomationGatewayImpl implements AutomationGateway { +public class ZtpGatewayImpl implements ZtpGateway { - private final AutomationService automationService; + private final ZtpService ztpService; private final Serializer serializer; @Inject - public AutomationGatewayImpl(AutomationService automationService, Serializer serializer) { - this.automationService = automationService; + public ZtpGatewayImpl(ZtpService ztpService, Serializer serializer) { + this.ztpService = ztpService; this.serializer = serializer; } @Override - @Counted(name = "automation_ztpGetDeviceRole_counter") - @Timed(name = "automation_ztpGetDeviceRole_histogram", unit = MetricUnits.MILLISECONDS) - public Uni<Automation.DeviceRole> ztpGetDeviceRole(Automation.DeviceRoleId request) { - return Uni.createFrom() - .item(() -> Automation.DeviceRole.newBuilder().setDevRoleId(request).build()); + @Counted(name = "ztp_ztpGetDeviceRole_counter") + @Timed(name = "ztp_ztpGetDeviceRole_histogram", unit = MetricUnits.MILLISECONDS) + public Uni<Ztp.DeviceRole> ztpGetDeviceRole(Ztp.DeviceRoleId request) { + return Uni.createFrom().item(() -> Ztp.DeviceRole.newBuilder().setDevRoleId(request).build()); } @Override - @Counted(name = "automation_ztpGetDeviceRolesByDeviceId_counter") - @Timed(name = "automation_ztpGetDeviceRolesByDeviceId_histogram", unit = MetricUnits.MILLISECONDS) - public Uni<Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId( - ContextOuterClass.DeviceId request) { - return Uni.createFrom().item(() -> Automation.DeviceRoleList.newBuilder().build()); + @Counted(name = "ztp_ztpGetDeviceRolesByDeviceId_counter") + @Timed(name = "ztp_ztpGetDeviceRolesByDeviceId_histogram", unit = MetricUnits.MILLISECONDS) + public Uni<Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId(ContextOuterClass.DeviceId request) { + return Uni.createFrom().item(() -> Ztp.DeviceRoleList.newBuilder().build()); } @Override - @Counted(name = "automation_ztpAdd_counter") - @Timed(name = "automation_ztpAdd_histogram", unit = MetricUnits.MILLISECONDS) - public Uni<Automation.DeviceRoleState> ztpAdd(Automation.DeviceRole request) { + @Counted(name = "ztp_ztpAdd_counter") + @Timed(name = "ztp_ztpAdd_histogram", unit = MetricUnits.MILLISECONDS) + public Uni<Ztp.DeviceRoleState> ztpAdd(Ztp.DeviceRole request) { final var devRoleId = request.getDevRoleId().getDevRoleId().getUuid(); final var deviceId = serializer.deserialize(request.getDevRoleId().getDevId()); - return automationService + return ztpService .addDevice(deviceId) .onItem() .transform(device -> transformToDeviceRoleState(device, devRoleId, DeviceState.CREATED)); } @Override - @Counted(name = "automation_ztpUpdate_counter") - @Timed(name = "automation_ztpUpdate_histogram", unit = MetricUnits.MILLISECONDS) + @Counted(name = "ztp_ztpUpdate_counter") + @Timed(name = "ztp_ztpUpdate_histogram", unit = MetricUnits.MILLISECONDS) public Uni<DeviceRoleState> ztpUpdate(DeviceRoleConfig request) { final var devRoleId = request.getDevRole().getDevRoleId().getDevRoleId().getUuid(); final var deviceId = serializer.deserialize(request.getDevRole().getDevRoleId().getDevId()); final var deviceConfig = serializer.deserialize(request.getDevConfig()); - return automationService + return ztpService .updateDevice(deviceId, deviceConfig) .onItem() .transform(device -> transformToDeviceRoleState(device, devRoleId, DeviceState.UPDATED)); } @Override - @Counted(name = "automation_ztpDelete_counter") - @Timed(name = "automation_ztpDelete_histogram", unit = MetricUnits.MILLISECONDS) - public Uni<Automation.DeviceRoleState> ztpDelete(Automation.DeviceRole request) { + @Counted(name = "ztp_ztpDelete_counter") + @Timed(name = "ztp_ztpDelete_histogram", unit = MetricUnits.MILLISECONDS) + public Uni<Ztp.DeviceRoleState> ztpDelete(Ztp.DeviceRole request) { final var devRoleId = request.getDevRoleId().getDevRoleId().getUuid(); - return automationService + return ztpService .deleteDevice(devRoleId) .onItem() .transform(device -> transformToDeviceRoleState(device, devRoleId, DeviceState.DELETED)); } @Override - @Counted(name = "automation_ztpDeleteAll_counter") - @Timed(name = "automation_ztpDeleteAll_histogram", unit = MetricUnits.MILLISECONDS) - public Uni<Automation.DeviceDeletionResult> ztpDeleteAll(ContextOuterClass.Empty empty) { - return Uni.createFrom().item(() -> Automation.DeviceDeletionResult.newBuilder().build()); + @Counted(name = "ztp_ztpDeleteAll_counter") + @Timed(name = "ztp_ztpDeleteAll_histogram", unit = MetricUnits.MILLISECONDS) + public Uni<Ztp.DeviceDeletionResult> ztpDeleteAll(ContextOuterClass.Empty empty) { + return Uni.createFrom().item(() -> Ztp.DeviceDeletionResult.newBuilder().build()); } - private Automation.DeviceRoleState transformToDeviceRoleState( + private Ztp.DeviceRoleState transformToDeviceRoleState( Device device, String devRoleId, DeviceState deviceState) { final var deviceRoleId = new DeviceRoleId(devRoleId, device.getDeviceId()); final var serializeDeviceRoleId = serializer.serialize(deviceRoleId); final var serializedDeviceState = serializer.serialize(deviceState); - return Automation.DeviceRoleState.newBuilder() + return Ztp.DeviceRoleState.newBuilder() .setDevRoleId(serializeDeviceRoleId) .setDevRoleState(serializedDeviceState) .build(); diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpService.java similarity index 82% rename from src/automation/src/main/java/eu/teraflow/automation/AutomationService.java rename to src/ztp/src/main/java/eu/teraflow/ztp/ZtpService.java index 9e3874eb2f97e4e47bc0b4a061a40c394eeb1ed4..a86aec75e1700022cf59fca33f917a4efd842418 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationService.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpService.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; import io.smallrye.mutiny.Uni; -public interface AutomationService { +public interface ZtpService { Uni<Device> addDevice(String deviceId); diff --git a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpServiceImpl.java similarity index 92% rename from src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/ZtpServiceImpl.java index 017a101fb1a5b35b018a775d36f24480104f586f..f4bbfc3f79ecdc73b49795ecb9dbd3efe0458f88 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/AutomationServiceImpl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/ZtpServiceImpl.java @@ -14,27 +14,27 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; -import eu.teraflow.automation.context.ContextService; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.device.DeviceService; +import eu.teraflow.ztp.context.ContextService; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.device.DeviceService; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import org.jboss.logging.Logger; @ApplicationScoped -public class AutomationServiceImpl implements AutomationService { - private static final Logger LOGGER = Logger.getLogger(AutomationServiceImpl.class); +public class ZtpServiceImpl implements ZtpService { + private static final Logger LOGGER = Logger.getLogger(ZtpServiceImpl.class); // private static final String MESSAGE = "Retrieved %s"; private final DeviceService deviceService; private final ContextService contextService; @Inject - public AutomationServiceImpl(DeviceService deviceService, ContextService contextService) { + public ZtpServiceImpl(DeviceService deviceService, ContextService contextService) { this.deviceService = deviceService; this.contextService = contextService; } diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclAction.java similarity index 97% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclAction.java index 29109f15bbb288697b837f69d85cf5d365c83319..4f2b3c717490401392242a634d34862c540970d1 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclAction.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclAction.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; public class AclAction { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclEntry.java similarity index 97% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclEntry.java index 6cecdd553d811587e9126bf323ce8019b57fc071..78ff008c8964333932a09cd32b7c4788713f2e04 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclEntry.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclEntry.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; public class AclEntry { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclForwardActionEnum.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclForwardActionEnum.java index e136a52fe259d67df2a5f9ee2c70a4e15f9d6034..86afe71de10dd07cb27d317cc433e0d38bd02b67 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclForwardActionEnum.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclForwardActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; public enum AclForwardActionEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclLogActionEnum.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclLogActionEnum.java index 1baf1c4a94a8fd806f5b05548fa0cd9fe4eaf3c5..0c7223532dbeca92e23c0734737f50c7ccf65911 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclLogActionEnum.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclLogActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; public enum AclLogActionEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclMatch.java similarity index 98% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclMatch.java index fa9eecf9f46493587c7b5573cbaca71f2865da09..513bcaece0e715964c0c934118b9b251686cf99e 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclMatch.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclMatch.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; public class AclMatch { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclRuleSet.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclRuleSet.java index 9cf3a08f0d2fac9eb3033accbaa31ad14dc93598..2c5efbd383092ba4b2d3153052ad586d17ee2486 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleSet.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclRuleSet.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; -import eu.teraflow.automation.common.Util; +import eu.teraflow.ztp.common.Util; import java.util.List; public class AclRuleSet { diff --git a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclRuleTypeEnum.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java rename to src/ztp/src/main/java/eu/teraflow/ztp/acl/AclRuleTypeEnum.java index f573721470e00dcba844961d65e4c79f83be4ffc..5abf7ab9ac992b4b4ffe39160427a05eed0408f7 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/acl/AclRuleTypeEnum.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/acl/AclRuleTypeEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.acl; +package eu.teraflow.ztp.acl; public enum AclRuleTypeEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/common/Util.java b/src/ztp/src/main/java/eu/teraflow/ztp/common/Util.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/common/Util.java rename to src/ztp/src/main/java/eu/teraflow/ztp/common/Util.java index aca4654578b6644d4e0566768255dbcc64b819af..f5135113c2876956def02ac8a0d61e788d72f1f8 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/common/Util.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/common/Util.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.common; +package eu.teraflow.ztp.common; import java.util.List; import java.util.stream.Collectors; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextGateway.java similarity index 84% rename from src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/ContextGateway.java index 8171b2225a6703e43b752c7306c2cb837628c8fc..0d835ee7315fe031d684efaa2f8ce39be1a7f977 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGateway.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextGateway.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.automation.context; +package eu.teraflow.ztp.context; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceEvent; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextGatewayImpl.java similarity index 90% rename from src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/ContextGatewayImpl.java index 6868f9175cc966d1c476c3cb5ad4f2e31d3d6516..286242fe11d1302db184abc37671dc2fa8162ec8 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextGatewayImpl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextGatewayImpl.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package eu.teraflow.automation.context; +package eu.teraflow.ztp.context; import context.ContextOuterClass; import context.MutinyContextServiceGrpc.MutinyContextServiceStub; -import eu.teraflow.automation.Serializer; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.ztp.Serializer; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceEvent; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextService.java similarity index 84% rename from src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/ContextService.java index 8c3caf27a96c0efe875b5cb04839a7a6ef4f6ec1..d9942c16018bf91a72a4baa4d395beda01d3a3f8 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextService.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextService.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.automation.context; +package eu.teraflow.ztp.context; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceEvent; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextServiceImpl.java similarity index 89% rename from src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/ContextServiceImpl.java index 4ec973ac75f752174036dd65df712ec28c52306a..7a2bca7c3fe57b999a72c0831758d0f83c837bf3 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/ContextServiceImpl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/ContextServiceImpl.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.automation.context; +package eu.teraflow.ztp.context; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceEvent; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceEvent; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigActionEnum.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigActionEnum.java index 7ec48e8896374e3d8daa918da9b4646adb6f3e41..f85dc5a89cc71c0fcc9fe84e82f24a4e90113b60 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigActionEnum.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigActionEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public enum ConfigActionEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRule.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRule.java index 5825bd4983ce9a8bf02b5db7eaa416245c7f4052..a375101c1a53dbcfe6709b4647a5fbcee4198ca1 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRule.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRule.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class ConfigRule { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleAcl.java similarity index 92% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleAcl.java index 774427abdb230bd3c6a99250a99d986a21ce3cc3..1a8942cf913cfcc7355b35614c9a0ffd910ce886 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleAcl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleAcl.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; -import eu.teraflow.automation.acl.AclRuleSet; +import eu.teraflow.ztp.acl.AclRuleSet; public class ConfigRuleAcl { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleCustom.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleCustom.java index 316ebc74b72a83c93ab2c2fcf890b136043aa823..2cf6dd69fb9aad6b4e4c606d6205542bfbb90146 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleCustom.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleCustom.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class ConfigRuleCustom { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleType.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleType.java index 2554709251e70ba18ae4362e7aa44933510e587f..2e11fc6b1628cc728025002595cdeb0ba4d767f5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleType.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public interface ConfigRuleType<T> { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleTypeAcl.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleTypeAcl.java index f10d17bc8e54458023c1588c5015586308d3c55d..5405faa7348c72bb2798ebf0b1ee24ea696fbf24 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeAcl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleTypeAcl.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class ConfigRuleTypeAcl implements ConfigRuleType<ConfigRuleAcl> { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleTypeCustom.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleTypeCustom.java index 759bb92c7fdc3ca861be34e63f8ade5bc385584a..5cc4a17fb9a1377a88e330d49ab573bd35dfa4ea 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/ConfigRuleTypeCustom.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/ConfigRuleTypeCustom.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class ConfigRuleTypeCustom implements ConfigRuleType<ConfigRuleCustom> { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Device.java similarity index 97% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/Device.java index b3d1836e3c4f494900281ef8a4cb505fa7761dca..3bb1e7a3af1de99ccf113f02fab1df462c2c10a5 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Device.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Device.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; -import eu.teraflow.automation.common.Util; +import eu.teraflow.ztp.common.Util; import java.util.List; public class Device { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceConfig.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceConfig.java index 0341ab0720c3fe22257575b6151086b5c908c437..0775248428c5de66fecb0757fc944efce38597a9 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceConfig.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceConfig.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; import java.util.List; import java.util.stream.Collectors; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceDriverEnum.java similarity index 92% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceDriverEnum.java index 3a26937e79d0df2cfead305a10ccadf3c54eae89..fe623175a791517846d329de6c83571a3a043a26 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceDriverEnum.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceDriverEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public enum DeviceDriverEnum { UNDEFINED, @@ -22,7 +22,7 @@ public enum DeviceDriverEnum { TRANSPORT_API, P4, IETF_NETWORK_TOPOLOGY, - ONF_TR_352, + ONF_TR_532, XR, IETF_L2VPN } diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceEvent.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceEvent.java similarity index 97% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceEvent.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceEvent.java index 891d6916272608aae6bc78bd86a84703b34478fe..8ab56ec7c7dd5e079f000ab64003f12f6080f099 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceEvent.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceEvent.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; import java.util.Optional; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceOperationalStatus.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceOperationalStatus.java index 0a5afaf2455acf28fa5591feb6c23d5f3d33692c..b171d31e1d30c768c3ae4d3f7bf5160170784285 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/DeviceOperationalStatus.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/DeviceOperationalStatus.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public enum DeviceOperationalStatus { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Empty.java similarity index 94% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/Empty.java index e503665e4146d5966b75979b9b0133b41d65e421..adeaaaafc3e940f366b9ee84c08f931197ab5658 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Empty.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Empty.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class Empty { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/EndPoint.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/EndPoint.java index c91f1d9c56967ea3a7b31e66193c0d0dbb9541d3..51378048e2e7387542ae59b7cd1909dd8ec6e8a7 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPoint.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/EndPoint.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; -import eu.teraflow.automation.common.Util; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.ztp.common.Util; +import eu.teraflow.ztp.kpi_sample_types.model.KpiSampleType; import java.util.List; public class EndPoint { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/EndPointId.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/EndPointId.java index 516c8289246565a86e2a59fe80dbe4b1505c5463..ddda2eb439301f8d77533974a337851ad2186ce9 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EndPointId.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/EndPointId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class EndPointId { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Event.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/Event.java index 9e4ca9abc0b1062c951aa7170dd83bc046bc8514..045b8482bc45bf29460aedbbe1d9771afde8d948 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Event.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Event.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class Event { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/EventTypeEnum.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/EventTypeEnum.java index c20f9dfd59de812096a1b85e7dc908e5059eb246..b732a26cd7a6d3609f8e1d670c5e8b501e971f18 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/EventTypeEnum.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/EventTypeEnum.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public enum EventTypeEnum { UNDEFINED, diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/GpsPosition.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/GpsPosition.java index 38a111f89fc79e0d11f15eedf2a8ca5a0ba35e89..c0dc6e3e788d1a1df8336ca97fc068857fc56495 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/GpsPosition.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/GpsPosition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class GpsPosition { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Location.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/Location.java index a16715e13cbb2b70f3c729b03ec164f9f52142ce..fa937d91cae6796594028d313d85509c6df5cd09 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/Location.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/Location.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class Location { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationType.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationType.java index a50594a511005c67ee206f84f9c840324cb2bac6..e4338c42b7855223db39ad58a7f0e1076a3d4823 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationType.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public interface LocationType<T> { diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationTypeGpsPosition.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationTypeGpsPosition.java index e512444aa7b7a4575936e3a00a2a9c4a8a051f1a..f4d510e65e7cba97243df295755080f8d876e7ab 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeGpsPosition.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationTypeGpsPosition.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class LocationTypeGpsPosition implements LocationType<GpsPosition> { private final GpsPosition gpsPosition; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationTypeRegion.java similarity index 95% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationTypeRegion.java index 28b448ca3e8682f39a140e7d347e6dbe20f7db35..8691de64238c4c947335bfc834ef0a9ce194763e 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/LocationTypeRegion.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/LocationTypeRegion.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class LocationTypeRegion implements LocationType<String> { private final String region; diff --git a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/TopologyId.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java rename to src/ztp/src/main/java/eu/teraflow/ztp/context/model/TopologyId.java index 07e8daed7fce328b5ea31ab2f9f3cb17abbd9525..574c075d59bb801317aa67a9e22ccef05725a77a 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/context/model/TopologyId.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/context/model/TopologyId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.context.model; +package eu.teraflow.ztp.context.model; public class TopologyId { diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceGateway.java similarity index 81% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java rename to src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceGateway.java index c25c96c97ca5bb31b0125b9df3210a181a2ea0fb..7302abf48edd2588af41dce32ea0946f40acc070 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGateway.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceGateway.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package eu.teraflow.ztp.device; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.Empty; import io.smallrye.mutiny.Uni; public interface DeviceGateway { diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceGatewayImpl.java similarity index 89% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceGatewayImpl.java index 5e3d63f86477c11dbc6bbaa314172912b9b31da3..aea3368a0a242413bdd1791d181441076bc6474b 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceGatewayImpl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceGatewayImpl.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package eu.teraflow.ztp.device; import device.DeviceService; -import eu.teraflow.automation.Serializer; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; +import eu.teraflow.ztp.Serializer; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.Empty; import io.quarkus.grpc.GrpcClient; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceService.java similarity index 81% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java rename to src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceService.java index b41257d4a360f47f9a037a462726b31eba11f127..1f2e6d9ad8de852f9cb929df580cdc24ecbb538e 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceService.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceService.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package eu.teraflow.ztp.device; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.Empty; import io.smallrye.mutiny.Uni; public interface DeviceService { diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceServiceImpl.java similarity index 87% rename from src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java rename to src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceServiceImpl.java index 97b142427988d08ff56025e29b6e7ec6c17cd7b7..67446b8c20fb65cba6242547967d3adc714f96d0 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/DeviceServiceImpl.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/device/DeviceServiceImpl.java @@ -14,11 +14,11 @@ * limitations under the License. */ -package eu.teraflow.automation.device; +package eu.teraflow.ztp.device; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.Empty; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.Empty; import io.smallrye.mutiny.Uni; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; diff --git a/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java b/src/ztp/src/main/java/eu/teraflow/ztp/kpi_sample_types/model/KpiSampleType.java similarity index 93% rename from src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java rename to src/ztp/src/main/java/eu/teraflow/ztp/kpi_sample_types/model/KpiSampleType.java index 49c7e0559b4b34635c347002417a7f19e43d91b7..701fd9021c5d72c817b8a374742c268233037ffd 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/kpi_sample_types/model/KpiSampleType.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/kpi_sample_types/model/KpiSampleType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.kpi_sample_types.model; +package eu.teraflow.ztp.kpi_sample_types.model; public enum KpiSampleType { UNKNOWN, diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRole.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java rename to src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRole.java index 8398d5a27ca53d958e7c2fc5cfc4289bae5b79f9..061d500bee94dd77279f8bcf0bf5be1194900022 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRole.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRole.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.model; +package eu.teraflow.ztp.model; public class DeviceRole { diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleConfig.java b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleConfig.java similarity index 92% rename from src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleConfig.java rename to src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleConfig.java index 8b9e5e9f605e6078838cca77d50db7044c85f6d2..badcf05889a2338d602e8dddda1435aaface0b40 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleConfig.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleConfig.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package eu.teraflow.automation.model; +package eu.teraflow.ztp.model; -import eu.teraflow.automation.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.DeviceConfig; public class DeviceRoleConfig { diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleId.java similarity index 96% rename from src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java rename to src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleId.java index 6a57ae0aacb009e764019af38af1ea16edd8a09b..dd482fb05e0fe0f5f3770df15c4161c9dae4c70f 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleId.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleId.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.model; +package eu.teraflow.ztp.model; public class DeviceRoleId { diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleType.java similarity index 94% rename from src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java rename to src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleType.java index 2d9ba668444f96a970bc2055db39716d72e4e7e9..7db0cab714cf493c46288ad1056fc6c1db974df2 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceRoleType.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceRoleType.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.model; +package eu.teraflow.ztp.model; public enum DeviceRoleType { NONE, diff --git a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceState.java similarity index 94% rename from src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java rename to src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceState.java index 01e5a131b1db7fef88cb0aa215ee87560963d281..ee953862cf64707ba656d6cbe224fc83592367de 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/model/DeviceState.java +++ b/src/ztp/src/main/java/eu/teraflow/ztp/model/DeviceState.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation.model; +package eu.teraflow.ztp.model; public enum DeviceState { UNDEFINED, diff --git a/src/automation/src/main/proto/acl.proto b/src/ztp/src/main/proto/acl.proto similarity index 100% rename from src/automation/src/main/proto/acl.proto rename to src/ztp/src/main/proto/acl.proto diff --git a/src/automation/src/main/proto/context.proto b/src/ztp/src/main/proto/context.proto similarity index 100% rename from src/automation/src/main/proto/context.proto rename to src/ztp/src/main/proto/context.proto diff --git a/src/automation/src/main/proto/device.proto b/src/ztp/src/main/proto/device.proto similarity index 100% rename from src/automation/src/main/proto/device.proto rename to src/ztp/src/main/proto/device.proto diff --git a/src/automation/src/main/proto/kpi_sample_types.proto b/src/ztp/src/main/proto/kpi_sample_types.proto similarity index 100% rename from src/automation/src/main/proto/kpi_sample_types.proto rename to src/ztp/src/main/proto/kpi_sample_types.proto diff --git a/src/automation/src/main/proto/monitoring.proto b/src/ztp/src/main/proto/monitoring.proto similarity index 100% rename from src/automation/src/main/proto/monitoring.proto rename to src/ztp/src/main/proto/monitoring.proto diff --git a/src/ztp/src/main/proto/ztp.proto b/src/ztp/src/main/proto/ztp.proto new file mode 120000 index 0000000000000000000000000000000000000000..9183ce531e28ade191ea9a9659feb97bf8bc7bf5 --- /dev/null +++ b/src/ztp/src/main/proto/ztp.proto @@ -0,0 +1 @@ +../../../../../proto/ztp.proto \ No newline at end of file diff --git a/src/automation/src/main/resources/application.yml b/src/ztp/src/main/resources/application.yml similarity index 91% rename from src/automation/src/main/resources/application.yml rename to src/ztp/src/main/resources/application.yml index bf638039daf3460c2f4ef374a380b37d01de1f1c..c551759efb3645f9c307c20a8988fc8ee9a89e0a 100644 --- a/src/automation/src/main/resources/application.yml +++ b/src/ztp/src/main/resources/application.yml @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -automation: +ztp: should-subscribe-to-context-component: true quarkus: banner: - path: teraflow-automation-banner.txt + path: teraflow-ztp-banner.txt grpc: server: port: 5050 @@ -34,15 +34,15 @@ quarkus: container-image: group: tfs - name: controller/automation + name: controller/ztp registry: labs.etsi.org:5050 tag: 0.2.0 kubernetes: - name: automationservice + name: ztpservice image-pull-policy: Always labels: - app: automationservice + app: ztpservice add-version-to-label-selectors: false readiness-probe: initial-delay: 2s diff --git a/src/ztp/src/main/resources/teraflow-ztp-banner.txt b/src/ztp/src/main/resources/teraflow-ztp-banner.txt new file mode 100644 index 0000000000000000000000000000000000000000..5c0d4d634a15c63b4543e4ded95534675f738add --- /dev/null +++ b/src/ztp/src/main/resources/teraflow-ztp-banner.txt @@ -0,0 +1,8 @@ + _______ ______ _ _____________ _____ + |__ __| | ____| | |___ /__ __| __ \ + | | ___ _ __ __ _| |__ | | _____ __ / / | | | |__) | + | |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / / | | | ___/ + | | __/ | | (_| | | | | (_) \ V V / / /__ | | | | + |_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_____| |_| |_| + + \ No newline at end of file diff --git a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/ConfigRuleTypeTest.java similarity index 79% rename from src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/ConfigRuleTypeTest.java index 67d4b204499fd93324bba07895149dba890b77c1..435164a35350623ec50fea406585100c01f48bc6 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/ConfigRuleTypeTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/ConfigRuleTypeTest.java @@ -14,23 +14,23 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.assertj.core.api.Assertions.assertThat; -import eu.teraflow.automation.acl.AclAction; -import eu.teraflow.automation.acl.AclEntry; -import eu.teraflow.automation.acl.AclForwardActionEnum; -import eu.teraflow.automation.acl.AclLogActionEnum; -import eu.teraflow.automation.acl.AclMatch; -import eu.teraflow.automation.acl.AclRuleSet; -import eu.teraflow.automation.acl.AclRuleTypeEnum; -import eu.teraflow.automation.context.model.ConfigRuleAcl; -import eu.teraflow.automation.context.model.ConfigRuleCustom; -import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; -import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.TopologyId; +import eu.teraflow.ztp.acl.AclAction; +import eu.teraflow.ztp.acl.AclEntry; +import eu.teraflow.ztp.acl.AclForwardActionEnum; +import eu.teraflow.ztp.acl.AclLogActionEnum; +import eu.teraflow.ztp.acl.AclMatch; +import eu.teraflow.ztp.acl.AclRuleSet; +import eu.teraflow.ztp.acl.AclRuleTypeEnum; +import eu.teraflow.ztp.context.model.ConfigRuleAcl; +import eu.teraflow.ztp.context.model.ConfigRuleCustom; +import eu.teraflow.ztp.context.model.ConfigRuleTypeAcl; +import eu.teraflow.ztp.context.model.ConfigRuleTypeCustom; +import eu.teraflow.ztp.context.model.EndPointId; +import eu.teraflow.ztp.context.model.TopologyId; import io.quarkus.test.junit.QuarkusTest; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/ContextSubscriberTest.java similarity index 82% rename from src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/ContextSubscriberTest.java index eb5f63e25d0f83417bcd461ce3aa9313a7eb417f..9d3d6956c4b466456b8a148b7d3996d7ae1e5132 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/ContextSubscriberTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/ContextSubscriberTest.java @@ -14,17 +14,16 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import automation.Automation; import context.ContextOuterClass; -import eu.teraflow.automation.context.ContextGateway; -import eu.teraflow.automation.context.model.DeviceEvent; -import eu.teraflow.automation.context.model.Event; -import eu.teraflow.automation.context.model.EventTypeEnum; +import eu.teraflow.ztp.context.ContextGateway; +import eu.teraflow.ztp.context.model.DeviceEvent; +import eu.teraflow.ztp.context.model.Event; +import eu.teraflow.ztp.context.model.EventTypeEnum; import io.quarkus.runtime.StartupEvent; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.mockito.InjectMock; @@ -33,6 +32,7 @@ import java.util.UUID; import javax.inject.Inject; import org.junit.jupiter.api.Test; import org.mockito.Mockito; +import ztp.Ztp; @QuarkusTest class ContextSubscriberTest { @@ -46,9 +46,9 @@ class ContextSubscriberTest { @InjectMock ContextGateway contextGateway; - @InjectMock AutomationService automationService; + @InjectMock ZtpService ztpService; - @InjectMock AutomationConfiguration automationConfiguration; + @InjectMock ZtpConfiguration ztpConfiguration; @Test void shouldCallAddDeviceUponCreateEvent() { @@ -62,7 +62,7 @@ class ContextSubscriberTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -77,8 +77,8 @@ class ContextSubscriberTest { contextSubscriber.listenForDeviceEvents(); - verify(automationService, times(0)).deleteDevice(deviceId); - verify(automationService, times(1)).addDevice(deviceId); + verify(ztpService, times(0)).deleteDevice(deviceId); + verify(ztpService, times(1)).addDevice(deviceId); } @Test @@ -93,7 +93,7 @@ class ContextSubscriberTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -108,7 +108,7 @@ class ContextSubscriberTest { contextSubscriber.listenForDeviceEvents(); - // verify(automationService, times(0)).addDevice(deviceId); + // verify(ztpService, times(0)).addDevice(deviceId); } @Test @@ -123,7 +123,7 @@ class ContextSubscriberTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -138,8 +138,8 @@ class ContextSubscriberTest { contextSubscriber.listenForDeviceEvents(); - verify(automationService, times(0)).addDevice(deviceId); - verify(automationService, times(1)).deleteDevice(deviceId); + verify(ztpService, times(0)).addDevice(deviceId); + verify(ztpService, times(1)).deleteDevice(deviceId); } @Test @@ -154,7 +154,7 @@ class ContextSubscriberTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -168,7 +168,7 @@ class ContextSubscriberTest { contextSubscriber.listenForDeviceEvents(); - verify(automationService, times(0)).addDevice(deviceId); + verify(ztpService, times(0)).addDevice(deviceId); } @Test @@ -183,7 +183,7 @@ class ContextSubscriberTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -195,19 +195,19 @@ class ContextSubscriberTest { final var deviceEventsMulti = Multi.createFrom().item(deviceEvent); Mockito.when(contextGateway.getDeviceEvents()).thenReturn(deviceEventsMulti); - Mockito.when(automationConfiguration.shouldSubscribeToContextComponent()).thenReturn(true); + Mockito.when(ztpConfiguration.shouldSubscribeToContextComponent()).thenReturn(true); StartupEvent y = new StartupEvent(); contextSubscriber.onStart(y); verify(contextGateway, times(1)).getDeviceEvents(); - verify(automationService, times(1)).addDevice(deviceId); + verify(ztpService, times(1)).addDevice(deviceId); } @Test void shouldNotCallListenForDeviceEventsUponStart() { - final var automationConfiguration = Mockito.mock(AutomationConfiguration.class); - Mockito.when(automationConfiguration.shouldSubscribeToContextComponent()).thenReturn(false); + final var ztpConfiguration = Mockito.mock(ZtpConfiguration.class); + Mockito.when(ztpConfiguration.shouldSubscribeToContextComponent()).thenReturn(false); StartupEvent y = new StartupEvent(); contextSubscriber.onStart(y); diff --git a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/EndPointCreationTest.java similarity index 93% rename from src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/EndPointCreationTest.java index 7f3d749d1aae851bf2cb446e1309384242b031d7..cb935cd4a9f24245e801341102649c3a5ffba5d7 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/EndPointCreationTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/EndPointCreationTest.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import eu.teraflow.automation.context.model.EndPoint; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.Location; -import eu.teraflow.automation.context.model.LocationTypeRegion; -import eu.teraflow.automation.context.model.TopologyId; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.ztp.context.model.EndPoint; +import eu.teraflow.ztp.context.model.EndPointId; +import eu.teraflow.ztp.context.model.Location; +import eu.teraflow.ztp.context.model.LocationTypeRegion; +import eu.teraflow.ztp.context.model.TopologyId; +import eu.teraflow.ztp.kpi_sample_types.model.KpiSampleType; import io.quarkus.test.junit.QuarkusTest; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/LocationTypeTest.java similarity index 87% rename from src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/LocationTypeTest.java index 8cc2c06126f5cf0e92fd59680390719ff425f411..4f038a6adafacfc5a4b8beea8f83195501c86fb9 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/LocationTypeTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/LocationTypeTest.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.assertj.core.api.Assertions.assertThat; -import eu.teraflow.automation.context.model.GpsPosition; -import eu.teraflow.automation.context.model.LocationTypeGpsPosition; -import eu.teraflow.automation.context.model.LocationTypeRegion; +import eu.teraflow.ztp.context.model.GpsPosition; +import eu.teraflow.ztp.context.model.LocationTypeGpsPosition; +import eu.teraflow.ztp.context.model.LocationTypeRegion; import io.quarkus.test.junit.QuarkusTest; import org.junit.jupiter.api.Test; diff --git a/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java b/src/ztp/src/test/java/eu/teraflow/ztp/MockZtpConfiguration.java similarity index 85% rename from src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java rename to src/ztp/src/test/java/eu/teraflow/ztp/MockZtpConfiguration.java index 94110ebbcd8826b6fd73f451c799f3d8d79521f7..aa554cbc3b76e73fa1952fb95a3d9045692eb0d9 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/MockAutomationConfiguration.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/MockZtpConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import io.smallrye.config.SmallRyeConfig; import javax.enterprise.context.ApplicationScoped; @@ -22,13 +22,13 @@ import javax.inject.Inject; import javax.ws.rs.Produces; import org.eclipse.microprofile.config.Config; -public class MockAutomationConfiguration { +public class MockZtpConfiguration { @Inject Config config; @Produces @ApplicationScoped @io.quarkus.test.Mock - AutomationConfiguration automationConfiguration() { - return config.unwrap(SmallRyeConfig.class).getConfigMapping(AutomationConfiguration.class); + ZtpConfiguration ztpConfiguration() { + return config.unwrap(SmallRyeConfig.class).getConfigMapping(ZtpConfiguration.class); } } diff --git a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/SerializerTest.java similarity index 96% rename from src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/SerializerTest.java index d2257d1b34e4753aff620e9bbc15d941f99ae3ba..7d6bb54c3806641f83b45818a4ba132ff9195d73 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/SerializerTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/SerializerTest.java @@ -14,52 +14,50 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import acl.Acl; -import automation.Automation; -import automation.Automation.ZtpDeviceState; import context.ContextOuterClass; import context.ContextOuterClass.DeviceId; import context.ContextOuterClass.DeviceOperationalStatusEnum; import context.ContextOuterClass.Uuid; -import eu.teraflow.automation.acl.AclAction; -import eu.teraflow.automation.acl.AclEntry; -import eu.teraflow.automation.acl.AclForwardActionEnum; -import eu.teraflow.automation.acl.AclLogActionEnum; -import eu.teraflow.automation.acl.AclMatch; -import eu.teraflow.automation.acl.AclRuleSet; -import eu.teraflow.automation.acl.AclRuleTypeEnum; -import eu.teraflow.automation.context.model.ConfigActionEnum; -import eu.teraflow.automation.context.model.ConfigRule; -import eu.teraflow.automation.context.model.ConfigRuleAcl; -import eu.teraflow.automation.context.model.ConfigRuleCustom; -import eu.teraflow.automation.context.model.ConfigRuleTypeAcl; -import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.DeviceDriverEnum; -import eu.teraflow.automation.context.model.DeviceEvent; -import eu.teraflow.automation.context.model.DeviceOperationalStatus; -import eu.teraflow.automation.context.model.Empty; -import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.Event; -import eu.teraflow.automation.context.model.EventTypeEnum; -import eu.teraflow.automation.context.model.GpsPosition; -import eu.teraflow.automation.context.model.Location; -import eu.teraflow.automation.context.model.LocationTypeGpsPosition; -import eu.teraflow.automation.context.model.LocationTypeRegion; -import eu.teraflow.automation.context.model.TopologyId; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; -import eu.teraflow.automation.model.DeviceRole; -import eu.teraflow.automation.model.DeviceRoleConfig; -import eu.teraflow.automation.model.DeviceRoleId; -import eu.teraflow.automation.model.DeviceRoleType; -import eu.teraflow.automation.model.DeviceState; +import eu.teraflow.ztp.acl.AclAction; +import eu.teraflow.ztp.acl.AclEntry; +import eu.teraflow.ztp.acl.AclForwardActionEnum; +import eu.teraflow.ztp.acl.AclLogActionEnum; +import eu.teraflow.ztp.acl.AclMatch; +import eu.teraflow.ztp.acl.AclRuleSet; +import eu.teraflow.ztp.acl.AclRuleTypeEnum; +import eu.teraflow.ztp.context.model.ConfigActionEnum; +import eu.teraflow.ztp.context.model.ConfigRule; +import eu.teraflow.ztp.context.model.ConfigRuleAcl; +import eu.teraflow.ztp.context.model.ConfigRuleCustom; +import eu.teraflow.ztp.context.model.ConfigRuleTypeAcl; +import eu.teraflow.ztp.context.model.ConfigRuleTypeCustom; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.DeviceDriverEnum; +import eu.teraflow.ztp.context.model.DeviceEvent; +import eu.teraflow.ztp.context.model.DeviceOperationalStatus; +import eu.teraflow.ztp.context.model.Empty; +import eu.teraflow.ztp.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.ztp.context.model.EndPointId; +import eu.teraflow.ztp.context.model.Event; +import eu.teraflow.ztp.context.model.EventTypeEnum; +import eu.teraflow.ztp.context.model.GpsPosition; +import eu.teraflow.ztp.context.model.Location; +import eu.teraflow.ztp.context.model.LocationTypeGpsPosition; +import eu.teraflow.ztp.context.model.LocationTypeRegion; +import eu.teraflow.ztp.context.model.TopologyId; +import eu.teraflow.ztp.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.ztp.model.DeviceRole; +import eu.teraflow.ztp.model.DeviceRoleConfig; +import eu.teraflow.ztp.model.DeviceRoleId; +import eu.teraflow.ztp.model.DeviceRoleType; +import eu.teraflow.ztp.model.DeviceState; import io.quarkus.test.junit.QuarkusTest; import java.util.List; import java.util.stream.Collectors; @@ -70,6 +68,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import ztp.Ztp; +import ztp.Ztp.ZtpDeviceState; @QuarkusTest class SerializerTest { @@ -141,7 +141,7 @@ class SerializerTest { .build(); final var expectedDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(serializedDeviceRoleIdUuid) .setDevId(serializedDeviceRoleDeviceId) .build(); @@ -166,16 +166,16 @@ class SerializerTest { private static Stream<Arguments> provideDeviceRoleType() { return Stream.of( - Arguments.of(DeviceRoleType.DEV_OPS, Automation.DeviceRoleType.DEV_OPS), - Arguments.of(DeviceRoleType.DEV_CONF, Automation.DeviceRoleType.DEV_CONF), - Arguments.of(DeviceRoleType.NONE, Automation.DeviceRoleType.NONE), - Arguments.of(DeviceRoleType.PIPELINE_CONF, Automation.DeviceRoleType.PIPELINE_CONF)); + Arguments.of(DeviceRoleType.DEV_OPS, Ztp.DeviceRoleType.DEV_OPS), + Arguments.of(DeviceRoleType.DEV_CONF, Ztp.DeviceRoleType.DEV_CONF), + Arguments.of(DeviceRoleType.NONE, Ztp.DeviceRoleType.NONE), + Arguments.of(DeviceRoleType.PIPELINE_CONF, Ztp.DeviceRoleType.PIPELINE_CONF)); } @ParameterizedTest @MethodSource("provideDeviceRoleType") void shouldSerializeDeviceRoleType( - DeviceRoleType deviceRoleType, Automation.DeviceRoleType expectedSerializedType) { + DeviceRoleType deviceRoleType, Ztp.DeviceRoleType expectedSerializedType) { final var serializedType = serializer.serialize(deviceRoleType); assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber()); } @@ -183,8 +183,7 @@ class SerializerTest { @ParameterizedTest @MethodSource("provideDeviceRoleType") void shouldDeserializeDeviceRoleType( - DeviceRoleType expectedDeviceRoleType, - Automation.DeviceRoleType serializedDeviceRoleTypeType) { + DeviceRoleType expectedDeviceRoleType, Ztp.DeviceRoleType serializedDeviceRoleTypeType) { final var deviceRoleType = serializer.deserialize(serializedDeviceRoleTypeType); @@ -200,15 +199,15 @@ class SerializerTest { final var serializedDeviceRoleDeviceId = serializer.serializeDeviceId(expectedDeviceId); final var expectedDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(serializedDeviceRoleDevRoleIdUuid) .setDevId(serializedDeviceRoleDeviceId) .build(); - final var expectedDeviceRoleType = Automation.DeviceRoleType.PIPELINE_CONF; + final var expectedDeviceRoleType = Ztp.DeviceRoleType.PIPELINE_CONF; final var expectedDeviceRole = - Automation.DeviceRole.newBuilder() + Ztp.DeviceRole.newBuilder() .setDevRoleId(expectedDeviceRoleId) .setDevRoleType(expectedDeviceRoleType) .build(); @@ -236,7 +235,7 @@ class SerializerTest { final var serializedDeviceRoleType = serializer.serialize(expectedDeviceRoleType); final var serializedDeviceRole = - Automation.DeviceRole.newBuilder() + Ztp.DeviceRole.newBuilder() .setDevRoleId(serializedDeviceRoleId) .setDevRoleType(serializedDeviceRoleType) .build(); @@ -261,7 +260,7 @@ class SerializerTest { final var serializedDeviceConfig = serializer.serialize(deviceConfig); final var expectedDeviceRoleConfig = - Automation.DeviceRoleConfig.newBuilder() + Ztp.DeviceRoleConfig.newBuilder() .setDevRole(serializedDeviceRole) .setDevConfig(serializedDeviceConfig) .build(); @@ -291,7 +290,7 @@ class SerializerTest { final var expectedDeviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig); final var serializedDeviceRoleConfig = - Automation.DeviceRoleConfig.newBuilder() + Ztp.DeviceRoleConfig.newBuilder() .setDevRole(serializedDeviceRole) .setDevConfig(serializedDeviceConfig) .build(); @@ -1031,7 +1030,7 @@ class SerializerTest { final var aclRuleSet = new AclRuleSet( "aclRuleName", - eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4, + eu.teraflow.ztp.acl.AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); @@ -1117,7 +1116,7 @@ class SerializerTest { final var aclRuleSet = new AclRuleSet( "aclRuleName", - eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4, + eu.teraflow.ztp.acl.AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry)); @@ -1212,8 +1211,8 @@ class SerializerTest { DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY), Arguments.of( - DeviceDriverEnum.ONF_TR_352, - ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352), + DeviceDriverEnum.ONF_TR_532, + ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_532), Arguments.of(DeviceDriverEnum.XR, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR), Arguments.of( DeviceDriverEnum.IETF_L2VPN, diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/ZtpFunctionalServiceTest.java similarity index 91% rename from src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/ZtpFunctionalServiceTest.java index d7e3917fc84537ebd2256262e148e1762ef0c96c..83b9f6f7f332e50e7d01fe6317b2623beafe0100 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/AutomationFunctionalServiceTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/ZtpFunctionalServiceTest.java @@ -14,28 +14,27 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import automation.Automation; import context.ContextOuterClass; -import eu.teraflow.automation.context.ContextGateway; -import eu.teraflow.automation.context.model.ConfigActionEnum; -import eu.teraflow.automation.context.model.ConfigRule; -import eu.teraflow.automation.context.model.ConfigRuleCustom; -import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.DeviceDriverEnum; -import eu.teraflow.automation.context.model.DeviceOperationalStatus; -import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.Location; -import eu.teraflow.automation.context.model.LocationTypeRegion; -import eu.teraflow.automation.context.model.TopologyId; -import eu.teraflow.automation.device.DeviceGateway; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.ztp.context.ContextGateway; +import eu.teraflow.ztp.context.model.ConfigActionEnum; +import eu.teraflow.ztp.context.model.ConfigRule; +import eu.teraflow.ztp.context.model.ConfigRuleCustom; +import eu.teraflow.ztp.context.model.ConfigRuleTypeCustom; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.DeviceDriverEnum; +import eu.teraflow.ztp.context.model.DeviceOperationalStatus; +import eu.teraflow.ztp.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.ztp.context.model.EndPointId; +import eu.teraflow.ztp.context.model.Location; +import eu.teraflow.ztp.context.model.LocationTypeRegion; +import eu.teraflow.ztp.context.model.TopologyId; +import eu.teraflow.ztp.device.DeviceGateway; +import eu.teraflow.ztp.kpi_sample_types.model.KpiSampleType; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.mockito.InjectMock; import io.smallrye.mutiny.Uni; @@ -47,12 +46,13 @@ import org.assertj.core.api.Assertions; import org.jboss.logging.Logger; import org.junit.jupiter.api.Test; import org.mockito.Mockito; +import ztp.Ztp; @QuarkusTest -class AutomationFunctionalServiceTest { - private static final Logger LOGGER = Logger.getLogger(AutomationFunctionalServiceTest.class); +class ZtpFunctionalServiceTest { + private static final Logger LOGGER = Logger.getLogger(ZtpFunctionalServiceTest.class); - @Inject AutomationService automationService; + @Inject ZtpService ztpService; @InjectMock DeviceGateway deviceGateway; @InjectMock ContextGateway contextGateway; @@ -73,7 +73,7 @@ class AutomationFunctionalServiceTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -146,7 +146,7 @@ class AutomationFunctionalServiceTest { .thenReturn(expectedDeviceConfigUni); Mockito.when(deviceGateway.configureDevice(Mockito.any())).thenReturn(expectedDeviceId); - final var currentDevice = automationService.addDevice(deviceId); + final var currentDevice = ztpService.addDevice(deviceId); Assertions.assertThat(currentDevice).isNotNull(); currentDevice @@ -199,7 +199,7 @@ class AutomationFunctionalServiceTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -265,7 +265,7 @@ class AutomationFunctionalServiceTest { Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni); - final var currentDevice = automationService.addDevice(deviceId); + final var currentDevice = ztpService.addDevice(deviceId); Assertions.assertThat(currentDevice).isNotNull(); @@ -325,7 +325,7 @@ class AutomationFunctionalServiceTest { ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build(); final var outDeviceRoleId = - Automation.DeviceRoleId.newBuilder() + Ztp.DeviceRoleId.newBuilder() .setDevRoleId(uuidForDeviceRoleId) .setDevId(outDeviceId) .build(); @@ -379,7 +379,7 @@ class AutomationFunctionalServiceTest { Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni); - final var deletedDevice = automationService.deleteDevice(deviceId); + final var deletedDevice = ztpService.deleteDevice(deviceId); Assertions.assertThat(deletedDevice).isNotNull(); diff --git a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java b/src/ztp/src/test/java/eu/teraflow/ztp/ZtpServiceTest.java similarity index 89% rename from src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java rename to src/ztp/src/test/java/eu/teraflow/ztp/ZtpServiceTest.java index 7cdca9aed92baaeadfd01a499863d52912dde6c0..f4c38f1fc0eb214db3f6cea120fe783bb5c03c5f 100644 --- a/src/automation/src/test/java/eu/teraflow/automation/AutomationServiceTest.java +++ b/src/ztp/src/test/java/eu/teraflow/ztp/ZtpServiceTest.java @@ -14,33 +14,31 @@ * limitations under the License. */ -package eu.teraflow.automation; +package eu.teraflow.ztp; import static org.assertj.core.api.Assertions.assertThat; -import automation.Automation; -import automation.AutomationService; import context.ContextOuterClass; -import eu.teraflow.automation.context.ContextGateway; -import eu.teraflow.automation.context.model.ConfigActionEnum; -import eu.teraflow.automation.context.model.ConfigRule; -import eu.teraflow.automation.context.model.ConfigRuleCustom; -import eu.teraflow.automation.context.model.ConfigRuleTypeCustom; -import eu.teraflow.automation.context.model.Device; -import eu.teraflow.automation.context.model.DeviceConfig; -import eu.teraflow.automation.context.model.DeviceDriverEnum; -import eu.teraflow.automation.context.model.DeviceOperationalStatus; -import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder; -import eu.teraflow.automation.context.model.EndPointId; -import eu.teraflow.automation.context.model.Location; -import eu.teraflow.automation.context.model.LocationTypeRegion; -import eu.teraflow.automation.context.model.TopologyId; -import eu.teraflow.automation.device.DeviceGateway; -import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType; -import eu.teraflow.automation.model.DeviceRole; -import eu.teraflow.automation.model.DeviceRoleConfig; -import eu.teraflow.automation.model.DeviceRoleId; -import eu.teraflow.automation.model.DeviceRoleType; +import eu.teraflow.ztp.context.ContextGateway; +import eu.teraflow.ztp.context.model.ConfigActionEnum; +import eu.teraflow.ztp.context.model.ConfigRule; +import eu.teraflow.ztp.context.model.ConfigRuleCustom; +import eu.teraflow.ztp.context.model.ConfigRuleTypeCustom; +import eu.teraflow.ztp.context.model.Device; +import eu.teraflow.ztp.context.model.DeviceConfig; +import eu.teraflow.ztp.context.model.DeviceDriverEnum; +import eu.teraflow.ztp.context.model.DeviceOperationalStatus; +import eu.teraflow.ztp.context.model.EndPoint.EndPointBuilder; +import eu.teraflow.ztp.context.model.EndPointId; +import eu.teraflow.ztp.context.model.Location; +import eu.teraflow.ztp.context.model.LocationTypeRegion; +import eu.teraflow.ztp.context.model.TopologyId; +import eu.teraflow.ztp.device.DeviceGateway; +import eu.teraflow.ztp.kpi_sample_types.model.KpiSampleType; +import eu.teraflow.ztp.model.DeviceRole; +import eu.teraflow.ztp.model.DeviceRoleConfig; +import eu.teraflow.ztp.model.DeviceRoleId; +import eu.teraflow.ztp.model.DeviceRoleType; import io.quarkus.grpc.GrpcClient; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.mockito.InjectMock; @@ -54,19 +52,21 @@ import javax.inject.Inject; import org.jboss.logging.Logger; import org.junit.jupiter.api.Test; import org.mockito.Mockito; +import ztp.Ztp; +import ztp.ZtpService; @QuarkusTest -class AutomationServiceTest { - private static final Logger LOGGER = Logger.getLogger(AutomationServiceTest.class); +class ZtpServiceTest { + private static final Logger LOGGER = Logger.getLogger(ZtpServiceTest.class); - @GrpcClient AutomationService client; + @GrpcClient ZtpService client; private final Serializer serializer; @InjectMock DeviceGateway deviceGateway; @InjectMock ContextGateway contextGateway; @Inject - AutomationServiceTest(Serializer serializer) { + ZtpServiceTest(Serializer serializer) { this.serializer = serializer; } @@ -282,8 +282,8 @@ class AutomationServiceTest { final var UUID_VALUE = "0f14d0ab-9605-7862-a9e4-5ed26688389b"; final var uuid = serializer.serializeUuid(UUID_VALUE); - final var deviceRoleId = Automation.DeviceRoleId.newBuilder().setDevRoleId(uuid).build(); - final var deviceRole = Automation.DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build(); + final var deviceRoleId = Ztp.DeviceRoleId.newBuilder().setDevRoleId(uuid).build(); + final var deviceRole = Ztp.DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build(); final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b"; final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a"; final var DEVICE_NAME = "deviceNameA"; diff --git a/src/automation/target/generated-sources/grpc/acl/Acl.java b/src/ztp/target/generated-sources/grpc/acl/Acl.java similarity index 100% rename from src/automation/target/generated-sources/grpc/acl/Acl.java rename to src/ztp/target/generated-sources/grpc/acl/Acl.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java b/src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java similarity index 97% rename from src/automation/target/generated-sources/grpc/context/ContextOuterClass.java rename to src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java index a605e30de68ae66866a78d53863412937ceea890..85bc0d278365971bbf1bcb135d05fd8523392716 100644 --- a/src/automation/target/generated-sources/grpc/context/ContextOuterClass.java +++ b/src/ztp/target/generated-sources/grpc/context/ContextOuterClass.java @@ -170,9 +170,9 @@ public final class ContextOuterClass { */ DEVICEDRIVER_IETF_NETWORK_TOPOLOGY(4), /** - * <code>DEVICEDRIVER_ONF_TR_352 = 5;</code> + * <code>DEVICEDRIVER_ONF_TR_532 = 5;</code> */ - DEVICEDRIVER_ONF_TR_352(5), + DEVICEDRIVER_ONF_TR_532(5), /** * <code>DEVICEDRIVER_XR = 6;</code> */ @@ -213,9 +213,9 @@ public final class ContextOuterClass { */ public static final int DEVICEDRIVER_IETF_NETWORK_TOPOLOGY_VALUE = 4; /** - * <code>DEVICEDRIVER_ONF_TR_352 = 5;</code> + * <code>DEVICEDRIVER_ONF_TR_532 = 5;</code> */ - public static final int DEVICEDRIVER_ONF_TR_352_VALUE = 5; + public static final int DEVICEDRIVER_ONF_TR_532_VALUE = 5; /** * <code>DEVICEDRIVER_XR = 6;</code> */ @@ -259,7 +259,7 @@ public final class ContextOuterClass { case 2: return DEVICEDRIVER_TRANSPORT_API; case 3: return DEVICEDRIVER_P4; case 4: return DEVICEDRIVER_IETF_NETWORK_TOPOLOGY; - case 5: return DEVICEDRIVER_ONF_TR_352; + case 5: return DEVICEDRIVER_ONF_TR_532; case 6: return DEVICEDRIVER_XR; case 7: return DEVICEDRIVER_IETF_L2VPN; case 8: return DEVICEDRIVER_GNMI_OPENCONFIG; @@ -457,6 +457,10 @@ public final class ContextOuterClass { * <code>SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3;</code> */ SERVICETYPE_TAPI_CONNECTIVITY_SERVICE(3), + /** + * <code>SERVICETYPE_TE = 4;</code> + */ + SERVICETYPE_TE(4), UNRECOGNIZED(-1), ; @@ -476,6 +480,10 @@ public final class ContextOuterClass { * <code>SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3;</code> */ public static final int SERVICETYPE_TAPI_CONNECTIVITY_SERVICE_VALUE = 3; + /** + * <code>SERVICETYPE_TE = 4;</code> + */ + public static final int SERVICETYPE_TE_VALUE = 4; public final int getNumber() { @@ -506,6 +514,7 @@ public final class ContextOuterClass { case 1: return SERVICETYPE_L3NM; case 2: return SERVICETYPE_L2NM; case 3: return SERVICETYPE_TAPI_CONNECTIVITY_SERVICE; + case 4: return SERVICETYPE_TE; default: return null; } } @@ -15641,43 +15650,43 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ java.util.List<context.ContextOuterClass.Component> - getComponentList(); + getComponentsList(); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - context.ContextOuterClass.Component getComponent(int index); + context.ContextOuterClass.Component getComponents(int index); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - int getComponentCount(); + int getComponentsCount(); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ java.util.List<? extends context.ContextOuterClass.ComponentOrBuilder> - getComponentOrBuilderList(); + getComponentsOrBuilderList(); /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index); /** @@ -15725,7 +15734,7 @@ public final class ContextOuterClass { deviceOperationalStatus_ = 0; deviceDrivers_ = java.util.Collections.emptyList(); deviceEndpoints_ = java.util.Collections.emptyList(); - component_ = java.util.Collections.emptyList(); + components_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -15837,10 +15846,10 @@ public final class ContextOuterClass { } case 66: { if (!((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList<context.ContextOuterClass.Component>(); + components_ = new java.util.ArrayList<context.ContextOuterClass.Component>(); mutable_bitField0_ |= 0x00000004; } - component_.add( + components_.add( input.readMessage(context.ContextOuterClass.Component.parser(), extensionRegistry)); break; } @@ -15879,7 +15888,7 @@ public final class ContextOuterClass { deviceEndpoints_ = java.util.Collections.unmodifiableList(deviceEndpoints_); } if (((mutable_bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); @@ -16143,64 +16152,64 @@ public final class ContextOuterClass { return deviceEndpoints_.get(index); } - public static final int COMPONENT_FIELD_NUMBER = 8; - private java.util.List<context.ContextOuterClass.Component> component_; + public static final int COMPONENTS_FIELD_NUMBER = 8; + private java.util.List<context.ContextOuterClass.Component> components_; /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public java.util.List<context.ContextOuterClass.Component> getComponentList() { - return component_; + public java.util.List<context.ContextOuterClass.Component> getComponentsList() { + return components_; } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override public java.util.List<? extends context.ContextOuterClass.ComponentOrBuilder> - getComponentOrBuilderList() { - return component_; + getComponentsOrBuilderList() { + return components_; } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public int getComponentCount() { - return component_.size(); + public int getComponentsCount() { + return components_.size(); } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public context.ContextOuterClass.Component getComponent(int index) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + return components_.get(index); } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ @java.lang.Override - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - return component_.get(index); + return components_.get(index); } public static final int CONTROLLER_ID_FIELD_NUMBER = 9; @@ -16281,8 +16290,8 @@ public final class ContextOuterClass { for (int i = 0; i < deviceEndpoints_.size(); i++) { output.writeMessage(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { - output.writeMessage(8, component_.get(i)); + for (int i = 0; i < components_.size(); i++) { + output.writeMessage(8, components_.get(i)); } if (controllerId_ != null) { output.writeMessage(9, getControllerId()); @@ -16330,9 +16339,9 @@ public final class ContextOuterClass { size += com.google.protobuf.CodedOutputStream .computeMessageSize(7, deviceEndpoints_.get(i)); } - for (int i = 0; i < component_.size(); i++) { + for (int i = 0; i < components_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, component_.get(i)); + .computeMessageSize(8, components_.get(i)); } if (controllerId_ != null) { size += com.google.protobuf.CodedOutputStream @@ -16371,8 +16380,8 @@ public final class ContextOuterClass { if (!deviceDrivers_.equals(other.deviceDrivers_)) return false; if (!getDeviceEndpointsList() .equals(other.getDeviceEndpointsList())) return false; - if (!getComponentList() - .equals(other.getComponentList())) return false; + if (!getComponentsList() + .equals(other.getComponentsList())) return false; if (hasControllerId() != other.hasControllerId()) return false; if (hasControllerId()) { if (!getControllerId() @@ -16411,9 +16420,9 @@ public final class ContextOuterClass { hash = (37 * hash) + DEVICE_ENDPOINTS_FIELD_NUMBER; hash = (53 * hash) + getDeviceEndpointsList().hashCode(); } - if (getComponentCount() > 0) { - hash = (37 * hash) + COMPONENT_FIELD_NUMBER; - hash = (53 * hash) + getComponentList().hashCode(); + if (getComponentsCount() > 0) { + hash = (37 * hash) + COMPONENTS_FIELD_NUMBER; + hash = (53 * hash) + getComponentsList().hashCode(); } if (hasControllerId()) { hash = (37 * hash) + CONTROLLER_ID_FIELD_NUMBER; @@ -16548,7 +16557,7 @@ public final class ContextOuterClass { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getDeviceEndpointsFieldBuilder(); - getComponentFieldBuilder(); + getComponentsFieldBuilder(); } } @java.lang.Override @@ -16580,11 +16589,11 @@ public final class ContextOuterClass { } else { deviceEndpointsBuilder_.clear(); } - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } if (controllerIdBuilder_ == null) { controllerId_ = null; @@ -16646,14 +16655,14 @@ public final class ContextOuterClass { } else { result.deviceEndpoints_ = deviceEndpointsBuilder_.build(); } - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0)) { - component_ = java.util.Collections.unmodifiableList(component_); + components_ = java.util.Collections.unmodifiableList(components_); bitField0_ = (bitField0_ & ~0x00000004); } - result.component_ = component_; + result.components_ = components_; } else { - result.component_ = componentBuilder_.build(); + result.components_ = componentsBuilder_.build(); } if (controllerIdBuilder_ == null) { result.controllerId_ = controllerId_; @@ -16761,29 +16770,29 @@ public final class ContextOuterClass { } } } - if (componentBuilder_ == null) { - if (!other.component_.isEmpty()) { - if (component_.isEmpty()) { - component_ = other.component_; + if (componentsBuilder_ == null) { + if (!other.components_.isEmpty()) { + if (components_.isEmpty()) { + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); } else { - ensureComponentIsMutable(); - component_.addAll(other.component_); + ensureComponentsIsMutable(); + components_.addAll(other.components_); } onChanged(); } } else { - if (!other.component_.isEmpty()) { - if (componentBuilder_.isEmpty()) { - componentBuilder_.dispose(); - componentBuilder_ = null; - component_ = other.component_; + if (!other.components_.isEmpty()) { + if (componentsBuilder_.isEmpty()) { + componentsBuilder_.dispose(); + componentsBuilder_ = null; + components_ = other.components_; bitField0_ = (bitField0_ & ~0x00000004); - componentBuilder_ = + componentsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getComponentFieldBuilder() : null; + getComponentsFieldBuilder() : null; } else { - componentBuilder_.addAllMessages(other.component_); + componentsBuilder_.addAllMessages(other.components_); } } } @@ -17644,30 +17653,30 @@ public final class ContextOuterClass { return deviceEndpointsBuilder_; } - private java.util.List<context.ContextOuterClass.Component> component_ = + private java.util.List<context.ContextOuterClass.Component> components_ = java.util.Collections.emptyList(); - private void ensureComponentIsMutable() { + private void ensureComponentsIsMutable() { if (!((bitField0_ & 0x00000004) != 0)) { - component_ = new java.util.ArrayList<context.ContextOuterClass.Component>(component_); + components_ = new java.util.ArrayList<context.ContextOuterClass.Component>(components_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< - context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentBuilder_; + context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> componentsBuilder_; /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public java.util.List<context.ContextOuterClass.Component> getComponentList() { - if (componentBuilder_ == null) { - return java.util.Collections.unmodifiableList(component_); + public java.util.List<context.ContextOuterClass.Component> getComponentsList() { + if (componentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(components_); } else { - return componentBuilder_.getMessageList(); + return componentsBuilder_.getMessageList(); } } /** @@ -17675,13 +17684,13 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public int getComponentCount() { - if (componentBuilder_ == null) { - return component_.size(); + public int getComponentsCount() { + if (componentsBuilder_ == null) { + return components_.size(); } else { - return componentBuilder_.getCount(); + return componentsBuilder_.getCount(); } } /** @@ -17689,13 +17698,13 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component getComponent(int index) { - if (componentBuilder_ == null) { - return component_.get(index); + public context.ContextOuterClass.Component getComponents(int index) { + if (componentsBuilder_ == null) { + return components_.get(index); } else { - return componentBuilder_.getMessage(index); + return componentsBuilder_.getMessage(index); } } /** @@ -17703,19 +17712,19 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.set(index, value); + ensureComponentsIsMutable(); + components_.set(index, value); onChanged(); } else { - componentBuilder_.setMessage(index, value); + componentsBuilder_.setMessage(index, value); } return this; } @@ -17724,16 +17733,16 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder setComponent( + public Builder setComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.set(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.set(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.setMessage(index, builderForValue.build()); + componentsBuilder_.setMessage(index, builderForValue.build()); } return this; } @@ -17742,18 +17751,18 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent(context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + public Builder addComponents(context.ContextOuterClass.Component value) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(value); + ensureComponentsIsMutable(); + components_.add(value); onChanged(); } else { - componentBuilder_.addMessage(value); + componentsBuilder_.addMessage(value); } return this; } @@ -17762,19 +17771,19 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component value) { - if (componentBuilder_ == null) { + if (componentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - ensureComponentIsMutable(); - component_.add(index, value); + ensureComponentsIsMutable(); + components_.add(index, value); onChanged(); } else { - componentBuilder_.addMessage(index, value); + componentsBuilder_.addMessage(index, value); } return this; } @@ -17783,16 +17792,16 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent( + public Builder addComponents( context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(builderForValue.build()); + componentsBuilder_.addMessage(builderForValue.build()); } return this; } @@ -17801,16 +17810,16 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addComponent( + public Builder addComponents( int index, context.ContextOuterClass.Component.Builder builderForValue) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.add(index, builderForValue.build()); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.add(index, builderForValue.build()); onChanged(); } else { - componentBuilder_.addMessage(index, builderForValue.build()); + componentsBuilder_.addMessage(index, builderForValue.build()); } return this; } @@ -17819,17 +17828,17 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder addAllComponent( + public Builder addAllComponents( java.lang.Iterable<? extends context.ContextOuterClass.Component> values) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, component_); + values, components_); onChanged(); } else { - componentBuilder_.addAllMessages(values); + componentsBuilder_.addAllMessages(values); } return this; } @@ -17838,15 +17847,15 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder clearComponent() { - if (componentBuilder_ == null) { - component_ = java.util.Collections.emptyList(); + public Builder clearComponents() { + if (componentsBuilder_ == null) { + components_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { - componentBuilder_.clear(); + componentsBuilder_.clear(); } return this; } @@ -17855,15 +17864,15 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public Builder removeComponent(int index) { - if (componentBuilder_ == null) { - ensureComponentIsMutable(); - component_.remove(index); + public Builder removeComponents(int index) { + if (componentsBuilder_ == null) { + ensureComponentsIsMutable(); + components_.remove(index); onChanged(); } else { - componentBuilder_.remove(index); + componentsBuilder_.remove(index); } return this; } @@ -17872,24 +17881,24 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component.Builder getComponentBuilder( + public context.ContextOuterClass.Component.Builder getComponentsBuilder( int index) { - return getComponentFieldBuilder().getBuilder(index); + return getComponentsFieldBuilder().getBuilder(index); } /** * <pre> * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.ComponentOrBuilder getComponentOrBuilder( + public context.ContextOuterClass.ComponentOrBuilder getComponentsOrBuilder( int index) { - if (componentBuilder_ == null) { - return component_.get(index); } else { - return componentBuilder_.getMessageOrBuilder(index); + if (componentsBuilder_ == null) { + return components_.get(index); } else { + return componentsBuilder_.getMessageOrBuilder(index); } } /** @@ -17897,14 +17906,14 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ public java.util.List<? extends context.ContextOuterClass.ComponentOrBuilder> - getComponentOrBuilderList() { - if (componentBuilder_ != null) { - return componentBuilder_.getMessageOrBuilderList(); + getComponentsOrBuilderList() { + if (componentsBuilder_ != null) { + return componentsBuilder_.getMessageOrBuilderList(); } else { - return java.util.Collections.unmodifiableList(component_); + return java.util.Collections.unmodifiableList(components_); } } /** @@ -17912,10 +17921,10 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component.Builder addComponentBuilder() { - return getComponentFieldBuilder().addBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder() { + return getComponentsFieldBuilder().addBuilder( context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17923,11 +17932,11 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ - public context.ContextOuterClass.Component.Builder addComponentBuilder( + public context.ContextOuterClass.Component.Builder addComponentsBuilder( int index) { - return getComponentFieldBuilder().addBuilder( + return getComponentsFieldBuilder().addBuilder( index, context.ContextOuterClass.Component.getDefaultInstance()); } /** @@ -17935,25 +17944,25 @@ public final class ContextOuterClass { * Used for inventory * </pre> * - * <code>repeated .context.Component component = 8;</code> + * <code>repeated .context.Component components = 8;</code> */ public java.util.List<context.ContextOuterClass.Component.Builder> - getComponentBuilderList() { - return getComponentFieldBuilder().getBuilderList(); + getComponentsBuilderList() { + return getComponentsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder> - getComponentFieldBuilder() { - if (componentBuilder_ == null) { - componentBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + getComponentsFieldBuilder() { + if (componentsBuilder_ == null) { + componentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< context.ContextOuterClass.Component, context.ContextOuterClass.Component.Builder, context.ContextOuterClass.ComponentOrBuilder>( - component_, + components_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); - component_ = null; + components_ = null; } - return componentBuilder_; + return componentsBuilder_; } private context.ContextOuterClass.DeviceId controllerId_; @@ -18168,31 +18177,115 @@ public final class ContextOuterClass { com.google.protobuf.MessageOrBuilder { /** - * <code>repeated string comp_string = 1;</code> - * @return A list containing the compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return Whether the componentUuid field is set. */ - java.util.List<java.lang.String> - getCompStringList(); + boolean hasComponentUuid(); /** - * <code>repeated string comp_string = 1;</code> - * @return The count of compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return The componentUuid. */ - int getCompStringCount(); + context.ContextOuterClass.Uuid getComponentUuid(); /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the element to return. - * @return The compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> */ - java.lang.String getCompString(int index); + context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder(); + /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * <code>string name = 2;</code> + * @return The name. + */ + java.lang.String getName(); + /** + * <code>string name = 2;</code> + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * <code>string type = 3;</code> + * @return The type. + */ + java.lang.String getType(); + /** + * <code>string type = 3;</code> + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + int getAttributesCount(); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + boolean containsAttributes( + java.lang.String key); + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map<java.lang.String, java.lang.String> + getAttributes(); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + java.util.Map<java.lang.String, java.lang.String> + getAttributesMap(); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + java.lang.String getAttributesOrThrow( + java.lang.String key); + + /** + * <code>string parent = 5;</code> + * @return The parent. + */ + java.lang.String getParent(); + /** + * <code>string parent = 5;</code> + * @return The bytes for parent. */ com.google.protobuf.ByteString - getCompStringBytes(int index); + getParentBytes(); } /** + * <pre> + *Defined previously to this section - Tested OK + * </pre> + * * Protobuf type {@code context.Component} */ public static final class Component extends @@ -18205,7 +18298,9 @@ public final class ContextOuterClass { super(builder); } private Component() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; + name_ = ""; + type_ = ""; + parent_ = ""; } @java.lang.Override @@ -18240,12 +18335,47 @@ public final class ContextOuterClass { done = true; break; case 10: { + context.ContextOuterClass.Uuid.Builder subBuilder = null; + if (componentUuid_ != null) { + subBuilder = componentUuid_.toBuilder(); + } + componentUuid_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(componentUuid_); + componentUuid_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 34: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(); + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000001; } - compString_.add(s); + com.google.protobuf.MapEntry<java.lang.String, java.lang.String> + attributes__ = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put( + attributes__.getKey(), attributes__.getValue()); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; break; } default: { @@ -18263,9 +18393,6 @@ public final class ContextOuterClass { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -18275,6 +18402,18 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18283,39 +18422,241 @@ public final class ContextOuterClass { context.ContextOuterClass.Component.class, context.ContextOuterClass.Component.Builder.class); } - public static final int COMP_STRING_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList compString_; + public static final int COMPONENT_UUID_FIELD_NUMBER = 1; + private context.ContextOuterClass.Uuid componentUuid_; /** - * <code>repeated string comp_string = 1;</code> - * @return A list containing the compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return Whether the componentUuid field is set. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_; + @java.lang.Override + public boolean hasComponentUuid() { + return componentUuid_ != null; } /** - * <code>repeated string comp_string = 1;</code> - * @return The count of compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return The componentUuid. */ - public int getCompStringCount() { - return compString_.size(); + @java.lang.Override + public context.ContextOuterClass.Uuid getComponentUuid() { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the element to return. - * @return The compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> + */ + @java.lang.Override + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + return getComponentUuid(); + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + * <code>string name = 2;</code> + * @return The name. */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * <code>string name = 2;</code> + * @return The bytes for name. */ + @java.lang.Override public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object type_; + /** + * <code>string type = 3;</code> + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * <code>string type = 3;</code> + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .<java.lang.String, java.lang.String>newDefaultInstance( + context.ContextOuterClass.internal_static_context_Component_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField<java.lang.String, java.lang.String> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map<java.lang.String, java.lang.String> getAttributes() { + return getAttributesMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int PARENT_FIELD_NUMBER = 5; + private volatile java.lang.Object parent_; + /** + * <code>string parent = 5;</code> + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * <code>string parent = 5;</code> + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } private byte memoizedIsInitialized = -1; @@ -18332,8 +18673,23 @@ public final class ContextOuterClass { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < compString_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, compString_.getRaw(i)); + if (componentUuid_ != null) { + output.writeMessage(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAttributes(), + AttributesDefaultEntryHolder.defaultEntry, + 4); + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); } unknownFields.writeTo(output); } @@ -18344,13 +18700,28 @@ public final class ContextOuterClass { if (size != -1) return size; size = 0; - { - int dataSize = 0; - for (int i = 0; i < compString_.size(); i++) { - dataSize += computeStringSizeNoTag(compString_.getRaw(i)); - } - size += dataSize; - size += 1 * getCompStringList().size(); + if (componentUuid_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getComponentUuid()); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + for (java.util.Map.Entry<java.lang.String, java.lang.String> entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry<java.lang.String, java.lang.String> + attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attributes__); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -18367,8 +18738,19 @@ public final class ContextOuterClass { } context.ContextOuterClass.Component other = (context.ContextOuterClass.Component) obj; - if (!getCompStringList() - .equals(other.getCompStringList())) return false; + if (hasComponentUuid() != other.hasComponentUuid()) return false; + if (hasComponentUuid()) { + if (!getComponentUuid() + .equals(other.getComponentUuid())) return false; + } + if (!getName() + .equals(other.getName())) return false; + if (!getType() + .equals(other.getType())) return false; + if (!internalGetAttributes().equals( + other.internalGetAttributes())) return false; + if (!getParent() + .equals(other.getParent())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18380,10 +18762,20 @@ public final class ContextOuterClass { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (getCompStringCount() > 0) { - hash = (37 * hash) + COMP_STRING_FIELD_NUMBER; - hash = (53 * hash) + getCompStringList().hashCode(); + if (hasComponentUuid()) { + hash = (37 * hash) + COMPONENT_UUID_FIELD_NUMBER; + hash = (53 * hash) + getComponentUuid().hashCode(); } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -18480,6 +18872,10 @@ public final class ContextOuterClass { return builder; } /** + * <pre> + *Defined previously to this section - Tested OK + * </pre> + * * Protobuf type {@code context.Component} */ public static final class Builder extends @@ -18491,6 +18887,28 @@ public final class ContextOuterClass { return context.ContextOuterClass.internal_static_context_Component_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -18517,8 +18935,19 @@ public final class ContextOuterClass { @java.lang.Override public Builder clear() { super.clear(); - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + name_ = ""; + + type_ = ""; + + internalGetMutableAttributes().clear(); + parent_ = ""; + return this; } @@ -18546,11 +18975,16 @@ public final class ContextOuterClass { public context.ContextOuterClass.Component buildPartial() { context.ContextOuterClass.Component result = new context.ContextOuterClass.Component(this); int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - compString_ = compString_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (componentUuidBuilder_ == null) { + result.componentUuid_ = componentUuid_; + } else { + result.componentUuid_ = componentUuidBuilder_.build(); } - result.compString_ = compString_; + result.name_ = name_; + result.type_ = type_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.parent_ = parent_; onBuilt(); return result; } @@ -18599,14 +19033,21 @@ public final class ContextOuterClass { public Builder mergeFrom(context.ContextOuterClass.Component other) { if (other == context.ContextOuterClass.Component.getDefaultInstance()) return this; - if (!other.compString_.isEmpty()) { - if (compString_.isEmpty()) { - compString_ = other.compString_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCompStringIsMutable(); - compString_.addAll(other.compString_); - } + if (other.hasComponentUuid()) { + mergeComponentUuid(other.getComponentUuid()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; onChanged(); } this.mergeUnknownFields(other.unknownFields); @@ -18639,112 +19080,505 @@ public final class ContextOuterClass { } private int bitField0_; - private com.google.protobuf.LazyStringList compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureCompStringIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - compString_ = new com.google.protobuf.LazyStringArrayList(compString_); - bitField0_ |= 0x00000001; - } + private context.ContextOuterClass.Uuid componentUuid_; + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> componentUuidBuilder_; + /** + * <code>.context.Uuid component_uuid = 1;</code> + * @return Whether the componentUuid field is set. + */ + public boolean hasComponentUuid() { + return componentUuidBuilder_ != null || componentUuid_ != null; } /** - * <code>repeated string comp_string = 1;</code> - * @return A list containing the compString. + * <code>.context.Uuid component_uuid = 1;</code> + * @return The componentUuid. */ - public com.google.protobuf.ProtocolStringList - getCompStringList() { - return compString_.getUnmodifiableView(); + public context.ContextOuterClass.Uuid getComponentUuid() { + if (componentUuidBuilder_ == null) { + return componentUuid_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } else { + return componentUuidBuilder_.getMessage(); + } } /** - * <code>repeated string comp_string = 1;</code> - * @return The count of compString. + * <code>.context.Uuid component_uuid = 1;</code> */ - public int getCompStringCount() { - return compString_.size(); + public Builder setComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + componentUuid_ = value; + onChanged(); + } else { + componentUuidBuilder_.setMessage(value); + } + + return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the element to return. - * @return The compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> */ - public java.lang.String getCompString(int index) { - return compString_.get(index); + public Builder setComponentUuid( + context.ContextOuterClass.Uuid.Builder builderForValue) { + if (componentUuidBuilder_ == null) { + componentUuid_ = builderForValue.build(); + onChanged(); + } else { + componentUuidBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index of the value to return. - * @return The bytes of the compString at the given index. + * <code>.context.Uuid component_uuid = 1;</code> + */ + public Builder mergeComponentUuid(context.ContextOuterClass.Uuid value) { + if (componentUuidBuilder_ == null) { + if (componentUuid_ != null) { + componentUuid_ = + context.ContextOuterClass.Uuid.newBuilder(componentUuid_).mergeFrom(value).buildPartial(); + } else { + componentUuid_ = value; + } + onChanged(); + } else { + componentUuidBuilder_.mergeFrom(value); + } + + return this; + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + public Builder clearComponentUuid() { + if (componentUuidBuilder_ == null) { + componentUuid_ = null; + onChanged(); + } else { + componentUuid_ = null; + componentUuidBuilder_ = null; + } + + return this; + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + public context.ContextOuterClass.Uuid.Builder getComponentUuidBuilder() { + + onChanged(); + return getComponentUuidFieldBuilder().getBuilder(); + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + public context.ContextOuterClass.UuidOrBuilder getComponentUuidOrBuilder() { + if (componentUuidBuilder_ != null) { + return componentUuidBuilder_.getMessageOrBuilder(); + } else { + return componentUuid_ == null ? + context.ContextOuterClass.Uuid.getDefaultInstance() : componentUuid_; + } + } + /** + * <code>.context.Uuid component_uuid = 1;</code> + */ + private com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> + getComponentUuidFieldBuilder() { + if (componentUuidBuilder_ == null) { + componentUuidBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>( + getComponentUuid(), + getParentForChildren(), + isClean()); + componentUuid_ = null; + } + return componentUuidBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * <code>string name = 2;</code> + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string name = 2;</code> + * @return The bytes for name. */ public com.google.protobuf.ByteString - getCompStringBytes(int index) { - return compString_.getByteString(index); + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } /** - * <code>repeated string comp_string = 1;</code> - * @param index The index to set the value at. - * @param value The compString to set. + * <code>string name = 2;</code> + * @param value The name to set. * @return This builder for chaining. */ - public Builder setCompString( - int index, java.lang.String value) { + public Builder setName( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.set(index, value); + + name_ = value; onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param value The compString to add. + * <code>string name = 2;</code> * @return This builder for chaining. */ - public Builder addCompString( + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * <code>string name = 2;</code> + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * <code>string type = 3;</code> + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string type = 3;</code> + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string type = 3;</code> + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( java.lang.String value) { if (value == null) { throw new NullPointerException(); } - ensureCompStringIsMutable(); - compString_.add(value); + + type_ = value; onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param values The compString to add. + * <code>string type = 3;</code> * @return This builder for chaining. */ - public Builder addAllCompString( - java.lang.Iterable<java.lang.String> values) { - ensureCompStringIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, compString_); + public Builder clearType() { + + type_ = getDefaultInstance().getType(); onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> + * <code>string type = 3;</code> + * @param value The bytes for type to set. * @return This builder for chaining. */ - public Builder clearCompString() { - compString_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> attributes_; + private com.google.protobuf.MapField<java.lang.String, java.lang.String> + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField<java.lang.String, java.lang.String> + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + @java.lang.Override + public boolean containsAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map<java.lang.String, java.lang.String> getAttributes() { + return getAttributesMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + @java.lang.Override + + public java.lang.String getAttributesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map<java.lang.String, java.lang.String> map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap() + .clear(); + return this; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + public Builder removeAttributes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map<java.lang.String, java.lang.String> + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + public Builder putAttributes( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAttributes().getMutableMap() + .put(key, value); + return this; + } + /** + * <pre> + * dict[attr.name => json.dumps(attr.value)] + * </pre> + * + * <code>map<string, string> attributes = 4;</code> + */ + + public Builder putAllAttributes( + java.util.Map<java.lang.String, java.lang.String> values) { + internalGetMutableAttributes().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * <code>string parent = 5;</code> + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string parent = 5;</code> + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string parent = 5;</code> + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * <code>string parent = 5;</code> + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /** - * <code>repeated string comp_string = 1;</code> - * @param value The bytes of the compString to add. + * <code>string parent = 5;</code> + * @param value The bytes for parent to set. * @return This builder for chaining. */ - public Builder addCompStringBytes( + public Builder setParentBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - ensureCompStringIsMutable(); - compString_.add(value); + + parent_ = value; onChanged(); return this; } @@ -73697,6 +74531,11 @@ public final class ContextOuterClass { private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_context_Component_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_context_Component_AttributesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_context_Component_AttributesEntry_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_context_DeviceConfig_descriptor; private static final @@ -74034,290 +74873,294 @@ public final class ContextOuterClass { "vent\022\035\n\005event\030\001 \001(\0132\016.context.Event\022(\n\013t" + "opology_id\030\002 \001(\0132\023.context.TopologyId\".\n" + "\010DeviceId\022\"\n\013device_uuid\030\001 \001(\0132\r.context" + - ".Uuid\"\371\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + + ".Uuid\"\372\002\n\006Device\022$\n\tdevice_id\030\001 \001(\0132\021.co" + "ntext.DeviceId\022\014\n\004name\030\002 \001(\t\022\023\n\013device_t" + "ype\030\003 \001(\t\022,\n\rdevice_config\030\004 \001(\0132\025.conte" + "xt.DeviceConfig\022G\n\031device_operational_st" + "atus\030\005 \001(\0162$.context.DeviceOperationalSt" + "atusEnum\0221\n\016device_drivers\030\006 \003(\0162\031.conte" + "xt.DeviceDriverEnum\022+\n\020device_endpoints\030" + - "\007 \003(\0132\021.context.EndPoint\022%\n\tcomponent\030\010 " + - "\003(\0132\022.context.Component\022(\n\rcontroller_id" + - "\030\t \001(\0132\021.context.DeviceId\" \n\tComponent\022\023" + - "\n\013comp_string\030\001 \003(\t\"9\n\014DeviceConfig\022)\n\014c" + - "onfig_rules\030\001 \003(\0132\023.context.ConfigRule\"5" + - "\n\014DeviceIdList\022%\n\ndevice_ids\030\001 \003(\0132\021.con" + - "text.DeviceId\".\n\nDeviceList\022 \n\007devices\030\001" + - " \003(\0132\017.context.Device\"\216\001\n\014DeviceFilter\022)" + - "\n\ndevice_ids\030\001 \001(\0132\025.context.DeviceIdLis" + - "t\022\031\n\021include_endpoints\030\002 \001(\010\022\034\n\024include_" + - "config_rules\030\003 \001(\010\022\032\n\022include_components" + - "\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005event\030\001 \001(\0132\016." + - "context.Event\022$\n\tdevice_id\030\002 \001(\0132\021.conte" + - "xt.DeviceId\022,\n\rdevice_config\030\003 \001(\0132\025.con" + - "text.DeviceConfig\"*\n\006LinkId\022 \n\tlink_uuid" + - "\030\001 \001(\0132\r.context.Uuid\"f\n\004Link\022 \n\007link_id" + - "\030\001 \001(\0132\017.context.LinkId\022\014\n\004name\030\002 \001(\t\022.\n" + - "\021link_endpoint_ids\030\003 \003(\0132\023.context.EndPo" + - "intId\"/\n\nLinkIdList\022!\n\010link_ids\030\001 \003(\0132\017." + - "context.LinkId\"(\n\010LinkList\022\034\n\005links\030\001 \003(" + - "\0132\r.context.Link\"L\n\tLinkEvent\022\035\n\005event\030\001" + - " \001(\0132\016.context.Event\022 \n\007link_id\030\002 \001(\0132\017." + - "context.LinkId\"X\n\tServiceId\022&\n\ncontext_i" + - "d\030\001 \001(\0132\022.context.ContextId\022#\n\014service_u" + - "uid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007Service\022&\n\n" + - "service_id\030\001 \001(\0132\022.context.ServiceId\022\014\n\004" + - "name\030\002 \001(\t\022.\n\014service_type\030\003 \001(\0162\030.conte" + - "xt.ServiceTypeEnum\0221\n\024service_endpoint_i" + - "ds\030\004 \003(\0132\023.context.EndPointId\0220\n\023service" + - "_constraints\030\005 \003(\0132\023.context.Constraint\022" + - ".\n\016service_status\030\006 \001(\0132\026.context.Servic" + - "eStatus\022.\n\016service_config\030\007 \001(\0132\026.contex" + - "t.ServiceConfig\022%\n\ttimestamp\030\010 \001(\0132\022.con" + - "text.Timestamp\"C\n\rServiceStatus\0222\n\016servi" + - "ce_status\030\001 \001(\0162\032.context.ServiceStatusE" + - "num\":\n\rServiceConfig\022)\n\014config_rules\030\001 \003" + - "(\0132\023.context.ConfigRule\"8\n\rServiceIdList" + - "\022\'\n\013service_ids\030\001 \003(\0132\022.context.ServiceI" + - "d\"1\n\013ServiceList\022\"\n\010services\030\001 \003(\0132\020.con" + - "text.Service\"\225\001\n\rServiceFilter\022+\n\013servic" + - "e_ids\030\001 \001(\0132\026.context.ServiceIdList\022\034\n\024i" + - "nclude_endpoint_ids\030\002 \001(\010\022\033\n\023include_con" + - "straints\030\003 \001(\010\022\034\n\024include_config_rules\030\004" + - " \001(\010\"U\n\014ServiceEvent\022\035\n\005event\030\001 \001(\0132\016.co" + - "ntext.Event\022&\n\nservice_id\030\002 \001(\0132\022.contex" + - "t.ServiceId\"T\n\007SliceId\022&\n\ncontext_id\030\001 \001" + - "(\0132\022.context.ContextId\022!\n\nslice_uuid\030\002 \001" + - "(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"\n\010slice_id\030" + - "\001 \001(\0132\020.context.SliceId\022\014\n\004name\030\002 \001(\t\022/\n" + - "\022slice_endpoint_ids\030\003 \003(\0132\023.context.EndP" + - "ointId\022.\n\021slice_constraints\030\004 \003(\0132\023.cont" + - "ext.Constraint\022-\n\021slice_service_ids\030\005 \003(" + - "\0132\022.context.ServiceId\022,\n\022slice_subslice_" + - "ids\030\006 \003(\0132\020.context.SliceId\022*\n\014slice_sta" + - "tus\030\007 \001(\0132\024.context.SliceStatus\022*\n\014slice" + - "_config\030\010 \001(\0132\024.context.SliceConfig\022(\n\013s" + - "lice_owner\030\t \001(\0132\023.context.SliceOwner\022%\n" + - "\ttimestamp\030\n \001(\0132\022.context.Timestamp\"E\n\n" + - "SliceOwner\022!\n\nowner_uuid\030\001 \001(\0132\r.context" + - ".Uuid\022\024\n\014owner_string\030\002 \001(\t\"=\n\013SliceStat" + - "us\022.\n\014slice_status\030\001 \001(\0162\030.context.Slice" + - "StatusEnum\"8\n\013SliceConfig\022)\n\014config_rule" + - "s\030\001 \003(\0132\023.context.ConfigRule\"2\n\013SliceIdL" + - "ist\022#\n\tslice_ids\030\001 \003(\0132\020.context.SliceId" + - "\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\0132\016.context." + - "Slice\"\312\001\n\013SliceFilter\022\'\n\tslice_ids\030\001 \001(\013" + - "2\024.context.SliceIdList\022\034\n\024include_endpoi" + - "nt_ids\030\002 \001(\010\022\033\n\023include_constraints\030\003 \001(" + - "\010\022\033\n\023include_service_ids\030\004 \001(\010\022\034\n\024includ" + - "e_subslice_ids\030\005 \001(\010\022\034\n\024include_config_r" + - "ules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005event\030\001 \001(\0132" + - "\016.context.Event\022\"\n\010slice_id\030\002 \001(\0132\020.cont" + - "ext.SliceId\"6\n\014ConnectionId\022&\n\017connectio" + - "n_uuid\030\001 \001(\0132\r.context.Uuid\"2\n\025Connectio" + - "nSettings_L0\022\031\n\021lsp_symbolic_name\030\001 \001(\t\"" + - "\236\001\n\025ConnectionSettings_L2\022\027\n\017src_mac_add" + - "ress\030\001 \001(\t\022\027\n\017dst_mac_address\030\002 \001(\t\022\022\n\ne" + - "ther_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 \001(\r\022\022\n\nmpls" + - "_label\030\005 \001(\r\022\032\n\022mpls_traffic_class\030\006 \001(\r" + - "\"t\n\025ConnectionSettings_L3\022\026\n\016src_ip_addr" + - "ess\030\001 \001(\t\022\026\n\016dst_ip_address\030\002 \001(\t\022\014\n\004dsc" + - "p\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003ttl\030\005 \001(\r\"[" + - "\n\025ConnectionSettings_L4\022\020\n\010src_port\030\001 \001(" + - "\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_flags\030\003 \001(\r\022\013" + - "\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSettings\022*\n\002l0" + - "\030\001 \001(\0132\036.context.ConnectionSettings_L0\022*" + - "\n\002l2\030\002 \001(\0132\036.context.ConnectionSettings_" + - "L2\022*\n\002l3\030\003 \001(\0132\036.context.ConnectionSetti" + - "ngs_L3\022*\n\002l4\030\004 \001(\0132\036.context.ConnectionS" + - "ettings_L4\"\363\001\n\nConnection\022,\n\rconnection_" + - "id\030\001 \001(\0132\025.context.ConnectionId\022&\n\nservi" + - "ce_id\030\002 \001(\0132\022.context.ServiceId\0223\n\026path_" + - "hops_endpoint_ids\030\003 \003(\0132\023.context.EndPoi" + - "ntId\022+\n\017sub_service_ids\030\004 \003(\0132\022.context." + - "ServiceId\022-\n\010settings\030\005 \001(\0132\033.context.Co" + - "nnectionSettings\"A\n\020ConnectionIdList\022-\n\016" + - "connection_ids\030\001 \003(\0132\025.context.Connectio" + - "nId\":\n\016ConnectionList\022(\n\013connections\030\001 \003" + - "(\0132\023.context.Connection\"^\n\017ConnectionEve" + - "nt\022\035\n\005event\030\001 \001(\0132\016.context.Event\022,\n\rcon" + - "nection_id\030\002 \001(\0132\025.context.ConnectionId\"" + - "\202\001\n\nEndPointId\022(\n\013topology_id\030\001 \001(\0132\023.co" + - "ntext.TopologyId\022$\n\tdevice_id\030\002 \001(\0132\021.co" + - "ntext.DeviceId\022$\n\rendpoint_uuid\030\003 \001(\0132\r." + - "context.Uuid\"\302\001\n\010EndPoint\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\014\n\004name\030\002 \001(" + - "\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020kpi_sample_t" + - "ypes\030\004 \003(\0162\037.kpi_sample_types.KpiSampleT" + - "ype\022,\n\021endpoint_location\030\005 \001(\0132\021.context" + - ".Location\"{\n\014EndPointName\022(\n\013endpoint_id" + - "\030\001 \001(\0132\023.context.EndPointId\022\023\n\013device_na" + - "me\030\002 \001(\t\022\025\n\rendpoint_name\030\003 \001(\t\022\025\n\rendpo" + - "int_type\030\004 \001(\t\";\n\016EndPointIdList\022)\n\014endp" + - "oint_ids\030\001 \003(\0132\023.context.EndPointId\"A\n\020E" + - "ndPointNameList\022-\n\016endpoint_names\030\001 \003(\0132" + - "\025.context.EndPointName\"A\n\021ConfigRule_Cus" + - "tom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016resource_va" + - "lue\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(\n\013endpoint_" + - "id\030\001 \001(\0132\023.context.EndPointId\022!\n\010rule_se" + - "t\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\nConfigRule\022" + - ")\n\006action\030\001 \001(\0162\031.context.ConfigActionEn" + - "um\022,\n\006custom\030\002 \001(\0132\032.context.ConfigRule_" + - "CustomH\000\022&\n\003acl\030\003 \001(\0132\027.context.ConfigRu" + - "le_ACLH\000B\r\n\013config_rule\"F\n\021Constraint_Cu" + - "stom\022\027\n\017constraint_type\030\001 \001(\t\022\030\n\020constra" + - "int_value\030\002 \001(\t\"E\n\023Constraint_Schedule\022\027" + - "\n\017start_timestamp\030\001 \001(\002\022\025\n\rduration_days" + - "\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010latitude\030\001 \001(\002" + - "\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Location\022\020\n\006regio" + - "n\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001(\0132\025.contex" + - "t.GPS_PositionH\000B\n\n\010location\"l\n\033Constrai" + - "nt_EndPointLocation\022(\n\013endpoint_id\030\001 \001(\013" + - "2\023.context.EndPointId\022#\n\010location\030\002 \001(\0132" + - "\021.context.Location\"Y\n\033Constraint_EndPoin" + - "tPriority\022(\n\013endpoint_id\030\001 \001(\0132\023.context" + - ".EndPointId\022\020\n\010priority\030\002 \001(\r\"0\n\026Constra" + - "int_SLA_Latency\022\026\n\016e2e_latency_ms\030\001 \001(\002\"" + - "0\n\027Constraint_SLA_Capacity\022\025\n\rcapacity_g" + - "bps\030\001 \001(\002\"c\n\033Constraint_SLA_Availability" + - "\022\032\n\022num_disjoint_paths\030\001 \001(\r\022\022\n\nall_acti" + - "ve\030\002 \001(\010\022\024\n\014availability\030\003 \001(\002\"V\n\036Constr" + - "aint_SLA_Isolation_level\0224\n\017isolation_le" + - "vel\030\001 \003(\0162\033.context.IsolationLevelEnum\"\242" + - "\001\n\025Constraint_Exclusions\022\024\n\014is_permanent" + - "\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021.context.Dev" + - "iceId\022)\n\014endpoint_ids\030\003 \003(\0132\023.context.En" + - "dPointId\022!\n\010link_ids\030\004 \003(\0132\017.context.Lin" + - "kId\"\333\004\n\nConstraint\022-\n\006action\030\001 \001(\0162\035.con" + - "text.ConstraintActionEnum\022,\n\006custom\030\002 \001(" + - "\0132\032.context.Constraint_CustomH\000\0220\n\010sched" + - "ule\030\003 \001(\0132\034.context.Constraint_ScheduleH" + - "\000\022A\n\021endpoint_location\030\004 \001(\0132$.context.C" + - "onstraint_EndPointLocationH\000\022A\n\021endpoint" + - "_priority\030\005 \001(\0132$.context.Constraint_End" + - "PointPriorityH\000\0228\n\014sla_capacity\030\006 \001(\0132 ." + - "context.Constraint_SLA_CapacityH\000\0226\n\013sla" + - "_latency\030\007 \001(\0132\037.context.Constraint_SLA_" + - "LatencyH\000\022@\n\020sla_availability\030\010 \001(\0132$.co" + - "ntext.Constraint_SLA_AvailabilityH\000\022@\n\rs" + - "la_isolation\030\t \001(\0132\'.context.Constraint_" + - "SLA_Isolation_levelH\000\0224\n\nexclusions\030\n \001(" + - "\0132\036.context.Constraint_ExclusionsH\000B\014\n\nc" + - "onstraint\"^\n\022TeraFlowController\022&\n\nconte" + - "xt_id\030\001 \001(\0132\022.context.ContextId\022\022\n\nip_ad" + - "dress\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024Authenticat" + - "ionResult\022&\n\ncontext_id\030\001 \001(\0132\022.context." + - "ContextId\022\025\n\rauthenticated\030\002 \001(\010*j\n\rEven" + - "tTypeEnum\022\027\n\023EVENTTYPE_UNDEFINED\020\000\022\024\n\020EV" + - "ENTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE_UPDATE\020\002\022\024" + - "\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020DeviceDriverEnu" + - "m\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000\022\033\n\027DEVICED" + - "RIVER_OPENCONFIG\020\001\022\036\n\032DEVICEDRIVER_TRANS" + - "PORT_API\020\002\022\023\n\017DEVICEDRIVER_P4\020\003\022&\n\"DEVIC" + - "EDRIVER_IETF_NETWORK_TOPOLOGY\020\004\022\033\n\027DEVIC" + - "EDRIVER_ONF_TR_352\020\005\022\023\n\017DEVICEDRIVER_XR\020" + - "\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020\007\022 \n\034DEVICE" + - "DRIVER_GNMI_OPENCONFIG\020\010*\217\001\n\033DeviceOpera" + - "tionalStatusEnum\022%\n!DEVICEOPERATIONALSTA" + - "TUS_UNDEFINED\020\000\022$\n DEVICEOPERATIONALSTAT" + - "US_DISABLED\020\001\022#\n\037DEVICEOPERATIONALSTATUS" + - "_ENABLED\020\002*\201\001\n\017ServiceTypeEnum\022\027\n\023SERVIC" + - "ETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYPE_L3NM\020\001\022\024\n" + - "\020SERVICETYPE_L2NM\020\002\022)\n%SERVICETYPE_TAPI_" + - "CONNECTIVITY_SERVICE\020\003*\304\001\n\021ServiceStatus" + - "Enum\022\033\n\027SERVICESTATUS_UNDEFINED\020\000\022\031\n\025SER" + - "VICESTATUS_PLANNED\020\001\022\030\n\024SERVICESTATUS_AC" + - "TIVE\020\002\022\032\n\026SERVICESTATUS_UPDATING\020\003\022!\n\035SE" + - "RVICESTATUS_PENDING_REMOVAL\020\004\022\036\n\032SERVICE" + - "STATUS_SLA_VIOLATED\020\005*\251\001\n\017SliceStatusEnu" + - "m\022\031\n\025SLICESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTA" + - "TUS_PLANNED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022S" + - "LICESTATUS_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINI" + - "T\020\004\022\034\n\030SLICESTATUS_SLA_VIOLATED\020\005*]\n\020Con" + - "figActionEnum\022\032\n\026CONFIGACTION_UNDEFINED\020" + - "\000\022\024\n\020CONFIGACTION_SET\020\001\022\027\n\023CONFIGACTION_" + - "DELETE\020\002*m\n\024ConstraintActionEnum\022\036\n\032CONS" + - "TRAINTACTION_UNDEFINED\020\000\022\030\n\024CONSTRAINTAC" + - "TION_SET\020\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*" + - "\203\002\n\022IsolationLevelEnum\022\020\n\014NO_ISOLATION\020\000" + - "\022\026\n\022PHYSICAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOL" + - "ATION\020\002\022\025\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSIC" + - "AL_MEMORY_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWOR" + - "K_ISOLATION\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLAT" + - "ION\020\006\022\037\n\033NETWORK_FUNCTIONS_ISOLATION\020\007\022\025" + - "\n\021SERVICE_ISOLATION\020\0102\245\026\n\016ContextService" + - "\022:\n\016ListContextIds\022\016.context.Empty\032\026.con" + - "text.ContextIdList\"\000\0226\n\014ListContexts\022\016.c" + - "ontext.Empty\032\024.context.ContextList\"\000\0224\n\n" + - "GetContext\022\022.context.ContextId\032\020.context" + - ".Context\"\000\0224\n\nSetContext\022\020.context.Conte" + - "xt\032\022.context.ContextId\"\000\0225\n\rRemoveContex" + - "t\022\022.context.ContextId\032\016.context.Empty\"\000\022" + - "=\n\020GetContextEvents\022\016.context.Empty\032\025.co" + - "ntext.ContextEvent\"\0000\001\022@\n\017ListTopologyId" + - "s\022\022.context.ContextId\032\027.context.Topology" + - "IdList\"\000\022=\n\016ListTopologies\022\022.context.Con" + - "textId\032\025.context.TopologyList\"\000\0227\n\013GetTo" + - "pology\022\023.context.TopologyId\032\021.context.To" + - "pology\"\000\022E\n\022GetTopologyDetails\022\023.context" + - ".TopologyId\032\030.context.TopologyDetails\"\000\022" + - "7\n\013SetTopology\022\021.context.Topology\032\023.cont" + - "ext.TopologyId\"\000\0227\n\016RemoveTopology\022\023.con" + - "text.TopologyId\032\016.context.Empty\"\000\022?\n\021Get" + - "TopologyEvents\022\016.context.Empty\032\026.context" + - ".TopologyEvent\"\0000\001\0228\n\rListDeviceIds\022\016.co" + - "ntext.Empty\032\025.context.DeviceIdList\"\000\0224\n\013" + - "ListDevices\022\016.context.Empty\032\023.context.De" + - "viceList\"\000\0221\n\tGetDevice\022\021.context.Device" + - "Id\032\017.context.Device\"\000\0221\n\tSetDevice\022\017.con" + - "text.Device\032\021.context.DeviceId\"\000\0223\n\014Remo" + - "veDevice\022\021.context.DeviceId\032\016.context.Em" + - "pty\"\000\022;\n\017GetDeviceEvents\022\016.context.Empty" + - "\032\024.context.DeviceEvent\"\0000\001\022<\n\014SelectDevi" + - "ce\022\025.context.DeviceFilter\032\023.context.Devi" + - "ceList\"\000\022I\n\021ListEndPointNames\022\027.context." + - "EndPointIdList\032\031.context.EndPointNameLis" + - "t\"\000\0224\n\013ListLinkIds\022\016.context.Empty\032\023.con" + - "text.LinkIdList\"\000\0220\n\tListLinks\022\016.context" + - ".Empty\032\021.context.LinkList\"\000\022+\n\007GetLink\022\017" + - ".context.LinkId\032\r.context.Link\"\000\022+\n\007SetL" + - "ink\022\r.context.Link\032\017.context.LinkId\"\000\022/\n" + - "\nRemoveLink\022\017.context.LinkId\032\016.context.E" + - "mpty\"\000\0227\n\rGetLinkEvents\022\016.context.Empty\032" + - "\022.context.LinkEvent\"\0000\001\022>\n\016ListServiceId" + - "s\022\022.context.ContextId\032\026.context.ServiceI" + - "dList\"\000\022:\n\014ListServices\022\022.context.Contex" + - "tId\032\024.context.ServiceList\"\000\0224\n\nGetServic" + - "e\022\022.context.ServiceId\032\020.context.Service\"" + - "\000\0224\n\nSetService\022\020.context.Service\032\022.cont" + - "ext.ServiceId\"\000\0226\n\014UnsetService\022\020.contex" + - "t.Service\032\022.context.ServiceId\"\000\0225\n\rRemov" + - "eService\022\022.context.ServiceId\032\016.context.E" + - "mpty\"\000\022=\n\020GetServiceEvents\022\016.context.Emp" + - "ty\032\025.context.ServiceEvent\"\0000\001\022?\n\rSelectS" + - "ervice\022\026.context.ServiceFilter\032\024.context" + - ".ServiceList\"\000\022:\n\014ListSliceIds\022\022.context" + - ".ContextId\032\024.context.SliceIdList\"\000\0226\n\nLi" + - "stSlices\022\022.context.ContextId\032\022.context.S" + - "liceList\"\000\022.\n\010GetSlice\022\020.context.SliceId" + - "\032\016.context.Slice\"\000\022.\n\010SetSlice\022\016.context" + - ".Slice\032\020.context.SliceId\"\000\0220\n\nUnsetSlice" + - "\022\016.context.Slice\032\020.context.SliceId\"\000\0221\n\013" + - "RemoveSlice\022\020.context.SliceId\032\016.context." + - "Empty\"\000\0229\n\016GetSliceEvents\022\016.context.Empt" + - "y\032\023.context.SliceEvent\"\0000\001\0229\n\013SelectSlic" + - "e\022\024.context.SliceFilter\032\022.context.SliceL" + - "ist\"\000\022D\n\021ListConnectionIds\022\022.context.Ser" + - "viceId\032\031.context.ConnectionIdList\"\000\022@\n\017L" + - "istConnections\022\022.context.ServiceId\032\027.con" + - "text.ConnectionList\"\000\022=\n\rGetConnection\022\025" + - ".context.ConnectionId\032\023.context.Connecti" + - "on\"\000\022=\n\rSetConnection\022\023.context.Connecti" + - "on\032\025.context.ConnectionId\"\000\022;\n\020RemoveCon" + - "nection\022\025.context.ConnectionId\032\016.context" + - ".Empty\"\000\022C\n\023GetConnectionEvents\022\016.contex" + - "t.Empty\032\030.context.ConnectionEvent\"\0000\001b\006p" + - "roto3" + "\007 \003(\0132\021.context.EndPoint\022&\n\ncomponents\030\010" + + " \003(\0132\022.context.Component\022(\n\rcontroller_i" + + "d\030\t \001(\0132\021.context.DeviceId\"\311\001\n\tComponent" + + "\022%\n\016component_uuid\030\001 \001(\0132\r.context.Uuid\022" + + "\014\n\004name\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\0226\n\nattribute" + + "s\030\004 \003(\0132\".context.Component.AttributesEn" + + "try\022\016\n\006parent\030\005 \001(\t\0321\n\017AttributesEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"9\n\014Device" + + "Config\022)\n\014config_rules\030\001 \003(\0132\023.context.C" + + "onfigRule\"5\n\014DeviceIdList\022%\n\ndevice_ids\030" + + "\001 \003(\0132\021.context.DeviceId\".\n\nDeviceList\022 " + + "\n\007devices\030\001 \003(\0132\017.context.Device\"\216\001\n\014Dev" + + "iceFilter\022)\n\ndevice_ids\030\001 \001(\0132\025.context." + + "DeviceIdList\022\031\n\021include_endpoints\030\002 \001(\010\022" + + "\034\n\024include_config_rules\030\003 \001(\010\022\032\n\022include" + + "_components\030\004 \001(\010\"\200\001\n\013DeviceEvent\022\035\n\005eve" + + "nt\030\001 \001(\0132\016.context.Event\022$\n\tdevice_id\030\002 " + + "\001(\0132\021.context.DeviceId\022,\n\rdevice_config\030" + + "\003 \001(\0132\025.context.DeviceConfig\"*\n\006LinkId\022 " + + "\n\tlink_uuid\030\001 \001(\0132\r.context.Uuid\"f\n\004Link" + + "\022 \n\007link_id\030\001 \001(\0132\017.context.LinkId\022\014\n\004na" + + "me\030\002 \001(\t\022.\n\021link_endpoint_ids\030\003 \003(\0132\023.co" + + "ntext.EndPointId\"/\n\nLinkIdList\022!\n\010link_i" + + "ds\030\001 \003(\0132\017.context.LinkId\"(\n\010LinkList\022\034\n" + + "\005links\030\001 \003(\0132\r.context.Link\"L\n\tLinkEvent" + + "\022\035\n\005event\030\001 \001(\0132\016.context.Event\022 \n\007link_" + + "id\030\002 \001(\0132\017.context.LinkId\"X\n\tServiceId\022&" + + "\n\ncontext_id\030\001 \001(\0132\022.context.ContextId\022#" + + "\n\014service_uuid\030\002 \001(\0132\r.context.Uuid\"\333\002\n\007" + + "Service\022&\n\nservice_id\030\001 \001(\0132\022.context.Se" + + "rviceId\022\014\n\004name\030\002 \001(\t\022.\n\014service_type\030\003 " + + "\001(\0162\030.context.ServiceTypeEnum\0221\n\024service" + + "_endpoint_ids\030\004 \003(\0132\023.context.EndPointId" + + "\0220\n\023service_constraints\030\005 \003(\0132\023.context." + + "Constraint\022.\n\016service_status\030\006 \001(\0132\026.con" + + "text.ServiceStatus\022.\n\016service_config\030\007 \001" + + "(\0132\026.context.ServiceConfig\022%\n\ttimestamp\030" + + "\010 \001(\0132\022.context.Timestamp\"C\n\rServiceStat" + + "us\0222\n\016service_status\030\001 \001(\0162\032.context.Ser" + + "viceStatusEnum\":\n\rServiceConfig\022)\n\014confi" + + "g_rules\030\001 \003(\0132\023.context.ConfigRule\"8\n\rSe" + + "rviceIdList\022\'\n\013service_ids\030\001 \003(\0132\022.conte" + + "xt.ServiceId\"1\n\013ServiceList\022\"\n\010services\030" + + "\001 \003(\0132\020.context.Service\"\225\001\n\rServiceFilte" + + "r\022+\n\013service_ids\030\001 \001(\0132\026.context.Service" + + "IdList\022\034\n\024include_endpoint_ids\030\002 \001(\010\022\033\n\023" + + "include_constraints\030\003 \001(\010\022\034\n\024include_con" + + "fig_rules\030\004 \001(\010\"U\n\014ServiceEvent\022\035\n\005event" + + "\030\001 \001(\0132\016.context.Event\022&\n\nservice_id\030\002 \001" + + "(\0132\022.context.ServiceId\"T\n\007SliceId\022&\n\ncon" + + "text_id\030\001 \001(\0132\022.context.ContextId\022!\n\nsli" + + "ce_uuid\030\002 \001(\0132\r.context.Uuid\"\240\003\n\005Slice\022\"" + + "\n\010slice_id\030\001 \001(\0132\020.context.SliceId\022\014\n\004na" + + "me\030\002 \001(\t\022/\n\022slice_endpoint_ids\030\003 \003(\0132\023.c" + + "ontext.EndPointId\022.\n\021slice_constraints\030\004" + + " \003(\0132\023.context.Constraint\022-\n\021slice_servi" + + "ce_ids\030\005 \003(\0132\022.context.ServiceId\022,\n\022slic" + + "e_subslice_ids\030\006 \003(\0132\020.context.SliceId\022*" + + "\n\014slice_status\030\007 \001(\0132\024.context.SliceStat" + + "us\022*\n\014slice_config\030\010 \001(\0132\024.context.Slice" + + "Config\022(\n\013slice_owner\030\t \001(\0132\023.context.Sl" + + "iceOwner\022%\n\ttimestamp\030\n \001(\0132\022.context.Ti" + + "mestamp\"E\n\nSliceOwner\022!\n\nowner_uuid\030\001 \001(" + + "\0132\r.context.Uuid\022\024\n\014owner_string\030\002 \001(\t\"=" + + "\n\013SliceStatus\022.\n\014slice_status\030\001 \001(\0162\030.co" + + "ntext.SliceStatusEnum\"8\n\013SliceConfig\022)\n\014" + + "config_rules\030\001 \003(\0132\023.context.ConfigRule\"" + + "2\n\013SliceIdList\022#\n\tslice_ids\030\001 \003(\0132\020.cont" + + "ext.SliceId\"+\n\tSliceList\022\036\n\006slices\030\001 \003(\013" + + "2\016.context.Slice\"\312\001\n\013SliceFilter\022\'\n\tslic" + + "e_ids\030\001 \001(\0132\024.context.SliceIdList\022\034\n\024inc" + + "lude_endpoint_ids\030\002 \001(\010\022\033\n\023include_const" + + "raints\030\003 \001(\010\022\033\n\023include_service_ids\030\004 \001(" + + "\010\022\034\n\024include_subslice_ids\030\005 \001(\010\022\034\n\024inclu" + + "de_config_rules\030\006 \001(\010\"O\n\nSliceEvent\022\035\n\005e" + + "vent\030\001 \001(\0132\016.context.Event\022\"\n\010slice_id\030\002" + + " \001(\0132\020.context.SliceId\"6\n\014ConnectionId\022&" + + "\n\017connection_uuid\030\001 \001(\0132\r.context.Uuid\"2" + + "\n\025ConnectionSettings_L0\022\031\n\021lsp_symbolic_" + + "name\030\001 \001(\t\"\236\001\n\025ConnectionSettings_L2\022\027\n\017" + + "src_mac_address\030\001 \001(\t\022\027\n\017dst_mac_address" + + "\030\002 \001(\t\022\022\n\nether_type\030\003 \001(\r\022\017\n\007vlan_id\030\004 " + + "\001(\r\022\022\n\nmpls_label\030\005 \001(\r\022\032\n\022mpls_traffic_" + + "class\030\006 \001(\r\"t\n\025ConnectionSettings_L3\022\026\n\016" + + "src_ip_address\030\001 \001(\t\022\026\n\016dst_ip_address\030\002" + + " \001(\t\022\014\n\004dscp\030\003 \001(\r\022\020\n\010protocol\030\004 \001(\r\022\013\n\003" + + "ttl\030\005 \001(\r\"[\n\025ConnectionSettings_L4\022\020\n\010sr" + + "c_port\030\001 \001(\r\022\020\n\010dst_port\030\002 \001(\r\022\021\n\ttcp_fl" + + "ags\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\"\304\001\n\022ConnectionSet" + + "tings\022*\n\002l0\030\001 \001(\0132\036.context.ConnectionSe" + + "ttings_L0\022*\n\002l2\030\002 \001(\0132\036.context.Connecti" + + "onSettings_L2\022*\n\002l3\030\003 \001(\0132\036.context.Conn" + + "ectionSettings_L3\022*\n\002l4\030\004 \001(\0132\036.context." + + "ConnectionSettings_L4\"\363\001\n\nConnection\022,\n\r" + + "connection_id\030\001 \001(\0132\025.context.Connection" + + "Id\022&\n\nservice_id\030\002 \001(\0132\022.context.Service" + + "Id\0223\n\026path_hops_endpoint_ids\030\003 \003(\0132\023.con" + + "text.EndPointId\022+\n\017sub_service_ids\030\004 \003(\013" + + "2\022.context.ServiceId\022-\n\010settings\030\005 \001(\0132\033" + + ".context.ConnectionSettings\"A\n\020Connectio" + + "nIdList\022-\n\016connection_ids\030\001 \003(\0132\025.contex" + + "t.ConnectionId\":\n\016ConnectionList\022(\n\013conn" + + "ections\030\001 \003(\0132\023.context.Connection\"^\n\017Co" + + "nnectionEvent\022\035\n\005event\030\001 \001(\0132\016.context.E" + + "vent\022,\n\rconnection_id\030\002 \001(\0132\025.context.Co" + + "nnectionId\"\202\001\n\nEndPointId\022(\n\013topology_id" + + "\030\001 \001(\0132\023.context.TopologyId\022$\n\tdevice_id" + + "\030\002 \001(\0132\021.context.DeviceId\022$\n\rendpoint_uu" + + "id\030\003 \001(\0132\r.context.Uuid\"\302\001\n\010EndPoint\022(\n\013" + + "endpoint_id\030\001 \001(\0132\023.context.EndPointId\022\014" + + "\n\004name\030\002 \001(\t\022\025\n\rendpoint_type\030\003 \001(\t\0229\n\020k" + + "pi_sample_types\030\004 \003(\0162\037.kpi_sample_types" + + ".KpiSampleType\022,\n\021endpoint_location\030\005 \001(" + + "\0132\021.context.Location\"{\n\014EndPointName\022(\n\013" + + "endpoint_id\030\001 \001(\0132\023.context.EndPointId\022\023" + + "\n\013device_name\030\002 \001(\t\022\025\n\rendpoint_name\030\003 \001" + + "(\t\022\025\n\rendpoint_type\030\004 \001(\t\";\n\016EndPointIdL" + + "ist\022)\n\014endpoint_ids\030\001 \003(\0132\023.context.EndP" + + "ointId\"A\n\020EndPointNameList\022-\n\016endpoint_n" + + "ames\030\001 \003(\0132\025.context.EndPointName\"A\n\021Con" + + "figRule_Custom\022\024\n\014resource_key\030\001 \001(\t\022\026\n\016" + + "resource_value\030\002 \001(\t\"]\n\016ConfigRule_ACL\022(" + + "\n\013endpoint_id\030\001 \001(\0132\023.context.EndPointId" + + "\022!\n\010rule_set\030\002 \001(\0132\017.acl.AclRuleSet\"\234\001\n\n" + + "ConfigRule\022)\n\006action\030\001 \001(\0162\031.context.Con" + + "figActionEnum\022,\n\006custom\030\002 \001(\0132\032.context." + + "ConfigRule_CustomH\000\022&\n\003acl\030\003 \001(\0132\027.conte" + + "xt.ConfigRule_ACLH\000B\r\n\013config_rule\"F\n\021Co" + + "nstraint_Custom\022\027\n\017constraint_type\030\001 \001(\t" + + "\022\030\n\020constraint_value\030\002 \001(\t\"E\n\023Constraint" + + "_Schedule\022\027\n\017start_timestamp\030\001 \001(\002\022\025\n\rdu" + + "ration_days\030\002 \001(\002\"3\n\014GPS_Position\022\020\n\010lat" + + "itude\030\001 \001(\002\022\021\n\tlongitude\030\002 \001(\002\"W\n\010Locati" + + "on\022\020\n\006region\030\001 \001(\tH\000\022-\n\014gps_position\030\002 \001" + + "(\0132\025.context.GPS_PositionH\000B\n\n\010location\"" + + "l\n\033Constraint_EndPointLocation\022(\n\013endpoi" + + "nt_id\030\001 \001(\0132\023.context.EndPointId\022#\n\010loca" + + "tion\030\002 \001(\0132\021.context.Location\"Y\n\033Constra" + + "int_EndPointPriority\022(\n\013endpoint_id\030\001 \001(" + + "\0132\023.context.EndPointId\022\020\n\010priority\030\002 \001(\r" + + "\"0\n\026Constraint_SLA_Latency\022\026\n\016e2e_latenc" + + "y_ms\030\001 \001(\002\"0\n\027Constraint_SLA_Capacity\022\025\n" + + "\rcapacity_gbps\030\001 \001(\002\"c\n\033Constraint_SLA_A" + + "vailability\022\032\n\022num_disjoint_paths\030\001 \001(\r\022" + + "\022\n\nall_active\030\002 \001(\010\022\024\n\014availability\030\003 \001(" + + "\002\"V\n\036Constraint_SLA_Isolation_level\0224\n\017i" + + "solation_level\030\001 \003(\0162\033.context.Isolation" + + "LevelEnum\"\242\001\n\025Constraint_Exclusions\022\024\n\014i" + + "s_permanent\030\001 \001(\010\022%\n\ndevice_ids\030\002 \003(\0132\021." + + "context.DeviceId\022)\n\014endpoint_ids\030\003 \003(\0132\023" + + ".context.EndPointId\022!\n\010link_ids\030\004 \003(\0132\017." + + "context.LinkId\"\333\004\n\nConstraint\022-\n\006action\030" + + "\001 \001(\0162\035.context.ConstraintActionEnum\022,\n\006" + + "custom\030\002 \001(\0132\032.context.Constraint_Custom" + + "H\000\0220\n\010schedule\030\003 \001(\0132\034.context.Constrain" + + "t_ScheduleH\000\022A\n\021endpoint_location\030\004 \001(\0132" + + "$.context.Constraint_EndPointLocationH\000\022" + + "A\n\021endpoint_priority\030\005 \001(\0132$.context.Con" + + "straint_EndPointPriorityH\000\0228\n\014sla_capaci" + + "ty\030\006 \001(\0132 .context.Constraint_SLA_Capaci" + + "tyH\000\0226\n\013sla_latency\030\007 \001(\0132\037.context.Cons" + + "traint_SLA_LatencyH\000\022@\n\020sla_availability" + + "\030\010 \001(\0132$.context.Constraint_SLA_Availabi" + + "lityH\000\022@\n\rsla_isolation\030\t \001(\0132\'.context." + + "Constraint_SLA_Isolation_levelH\000\0224\n\nexcl" + + "usions\030\n \001(\0132\036.context.Constraint_Exclus" + + "ionsH\000B\014\n\nconstraint\"^\n\022TeraFlowControll" + + "er\022&\n\ncontext_id\030\001 \001(\0132\022.context.Context" + + "Id\022\022\n\nip_address\030\002 \001(\t\022\014\n\004port\030\003 \001(\r\"U\n\024" + + "AuthenticationResult\022&\n\ncontext_id\030\001 \001(\013" + + "2\022.context.ContextId\022\025\n\rauthenticated\030\002 " + + "\001(\010*j\n\rEventTypeEnum\022\027\n\023EVENTTYPE_UNDEFI" + + "NED\020\000\022\024\n\020EVENTTYPE_CREATE\020\001\022\024\n\020EVENTTYPE" + + "_UPDATE\020\002\022\024\n\020EVENTTYPE_REMOVE\020\003*\231\002\n\020Devi" + + "ceDriverEnum\022\032\n\026DEVICEDRIVER_UNDEFINED\020\000" + + "\022\033\n\027DEVICEDRIVER_OPENCONFIG\020\001\022\036\n\032DEVICED" + + "RIVER_TRANSPORT_API\020\002\022\023\n\017DEVICEDRIVER_P4" + + "\020\003\022&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY" + + "\020\004\022\033\n\027DEVICEDRIVER_ONF_TR_532\020\005\022\023\n\017DEVIC" + + "EDRIVER_XR\020\006\022\033\n\027DEVICEDRIVER_IETF_L2VPN\020" + + "\007\022 \n\034DEVICEDRIVER_GNMI_OPENCONFIG\020\010*\217\001\n\033" + + "DeviceOperationalStatusEnum\022%\n!DEVICEOPE" + + "RATIONALSTATUS_UNDEFINED\020\000\022$\n DEVICEOPER" + + "ATIONALSTATUS_DISABLED\020\001\022#\n\037DEVICEOPERAT" + + "IONALSTATUS_ENABLED\020\002*\225\001\n\017ServiceTypeEnu" + + "m\022\027\n\023SERVICETYPE_UNKNOWN\020\000\022\024\n\020SERVICETYP" + + "E_L3NM\020\001\022\024\n\020SERVICETYPE_L2NM\020\002\022)\n%SERVIC" + + "ETYPE_TAPI_CONNECTIVITY_SERVICE\020\003\022\022\n\016SER" + + "VICETYPE_TE\020\004*\304\001\n\021ServiceStatusEnum\022\033\n\027S" + + "ERVICESTATUS_UNDEFINED\020\000\022\031\n\025SERVICESTATU" + + "S_PLANNED\020\001\022\030\n\024SERVICESTATUS_ACTIVE\020\002\022\032\n" + + "\026SERVICESTATUS_UPDATING\020\003\022!\n\035SERVICESTAT" + + "US_PENDING_REMOVAL\020\004\022\036\n\032SERVICESTATUS_SL" + + "A_VIOLATED\020\005*\251\001\n\017SliceStatusEnum\022\031\n\025SLIC" + + "ESTATUS_UNDEFINED\020\000\022\027\n\023SLICESTATUS_PLANN" + + "ED\020\001\022\024\n\020SLICESTATUS_INIT\020\002\022\026\n\022SLICESTATU" + + "S_ACTIVE\020\003\022\026\n\022SLICESTATUS_DEINIT\020\004\022\034\n\030SL" + + "ICESTATUS_SLA_VIOLATED\020\005*]\n\020ConfigAction" + + "Enum\022\032\n\026CONFIGACTION_UNDEFINED\020\000\022\024\n\020CONF" + + "IGACTION_SET\020\001\022\027\n\023CONFIGACTION_DELETE\020\002*" + + "m\n\024ConstraintActionEnum\022\036\n\032CONSTRAINTACT" + + "ION_UNDEFINED\020\000\022\030\n\024CONSTRAINTACTION_SET\020" + + "\001\022\033\n\027CONSTRAINTACTION_DELETE\020\002*\203\002\n\022Isola" + + "tionLevelEnum\022\020\n\014NO_ISOLATION\020\000\022\026\n\022PHYSI" + + "CAL_ISOLATION\020\001\022\025\n\021LOGICAL_ISOLATION\020\002\022\025" + + "\n\021PROCESS_ISOLATION\020\003\022\035\n\031PHYSICAL_MEMORY" + + "_ISOLATION\020\004\022\036\n\032PHYSICAL_NETWORK_ISOLATI" + + "ON\020\005\022\036\n\032VIRTUAL_RESOURCE_ISOLATION\020\006\022\037\n\033" + + "NETWORK_FUNCTIONS_ISOLATION\020\007\022\025\n\021SERVICE" + + "_ISOLATION\020\0102\245\026\n\016ContextService\022:\n\016ListC" + + "ontextIds\022\016.context.Empty\032\026.context.Cont" + + "extIdList\"\000\0226\n\014ListContexts\022\016.context.Em" + + "pty\032\024.context.ContextList\"\000\0224\n\nGetContex" + + "t\022\022.context.ContextId\032\020.context.Context\"" + + "\000\0224\n\nSetContext\022\020.context.Context\032\022.cont" + + "ext.ContextId\"\000\0225\n\rRemoveContext\022\022.conte" + + "xt.ContextId\032\016.context.Empty\"\000\022=\n\020GetCon" + + "textEvents\022\016.context.Empty\032\025.context.Con" + + "textEvent\"\0000\001\022@\n\017ListTopologyIds\022\022.conte" + + "xt.ContextId\032\027.context.TopologyIdList\"\000\022" + + "=\n\016ListTopologies\022\022.context.ContextId\032\025." + + "context.TopologyList\"\000\0227\n\013GetTopology\022\023." + + "context.TopologyId\032\021.context.Topology\"\000\022" + + "E\n\022GetTopologyDetails\022\023.context.Topology" + + "Id\032\030.context.TopologyDetails\"\000\0227\n\013SetTop" + + "ology\022\021.context.Topology\032\023.context.Topol" + + "ogyId\"\000\0227\n\016RemoveTopology\022\023.context.Topo" + + "logyId\032\016.context.Empty\"\000\022?\n\021GetTopologyE" + + "vents\022\016.context.Empty\032\026.context.Topology" + + "Event\"\0000\001\0228\n\rListDeviceIds\022\016.context.Emp" + + "ty\032\025.context.DeviceIdList\"\000\0224\n\013ListDevic" + + "es\022\016.context.Empty\032\023.context.DeviceList\"" + + "\000\0221\n\tGetDevice\022\021.context.DeviceId\032\017.cont" + + "ext.Device\"\000\0221\n\tSetDevice\022\017.context.Devi" + + "ce\032\021.context.DeviceId\"\000\0223\n\014RemoveDevice\022" + + "\021.context.DeviceId\032\016.context.Empty\"\000\022;\n\017" + + "GetDeviceEvents\022\016.context.Empty\032\024.contex" + + "t.DeviceEvent\"\0000\001\022<\n\014SelectDevice\022\025.cont" + + "ext.DeviceFilter\032\023.context.DeviceList\"\000\022" + + "I\n\021ListEndPointNames\022\027.context.EndPointI" + + "dList\032\031.context.EndPointNameList\"\000\0224\n\013Li" + + "stLinkIds\022\016.context.Empty\032\023.context.Link" + + "IdList\"\000\0220\n\tListLinks\022\016.context.Empty\032\021." + + "context.LinkList\"\000\022+\n\007GetLink\022\017.context." + + "LinkId\032\r.context.Link\"\000\022+\n\007SetLink\022\r.con" + + "text.Link\032\017.context.LinkId\"\000\022/\n\nRemoveLi" + + "nk\022\017.context.LinkId\032\016.context.Empty\"\000\0227\n" + + "\rGetLinkEvents\022\016.context.Empty\032\022.context" + + ".LinkEvent\"\0000\001\022>\n\016ListServiceIds\022\022.conte" + + "xt.ContextId\032\026.context.ServiceIdList\"\000\022:" + + "\n\014ListServices\022\022.context.ContextId\032\024.con" + + "text.ServiceList\"\000\0224\n\nGetService\022\022.conte" + + "xt.ServiceId\032\020.context.Service\"\000\0224\n\nSetS" + + "ervice\022\020.context.Service\032\022.context.Servi" + + "ceId\"\000\0226\n\014UnsetService\022\020.context.Service" + + "\032\022.context.ServiceId\"\000\0225\n\rRemoveService\022" + + "\022.context.ServiceId\032\016.context.Empty\"\000\022=\n" + + "\020GetServiceEvents\022\016.context.Empty\032\025.cont" + + "ext.ServiceEvent\"\0000\001\022?\n\rSelectService\022\026." + + "context.ServiceFilter\032\024.context.ServiceL" + + "ist\"\000\022:\n\014ListSliceIds\022\022.context.ContextI" + + "d\032\024.context.SliceIdList\"\000\0226\n\nListSlices\022" + + "\022.context.ContextId\032\022.context.SliceList\"" + + "\000\022.\n\010GetSlice\022\020.context.SliceId\032\016.contex" + + "t.Slice\"\000\022.\n\010SetSlice\022\016.context.Slice\032\020." + + "context.SliceId\"\000\0220\n\nUnsetSlice\022\016.contex" + + "t.Slice\032\020.context.SliceId\"\000\0221\n\013RemoveSli" + + "ce\022\020.context.SliceId\032\016.context.Empty\"\000\0229" + + "\n\016GetSliceEvents\022\016.context.Empty\032\023.conte" + + "xt.SliceEvent\"\0000\001\0229\n\013SelectSlice\022\024.conte" + + "xt.SliceFilter\032\022.context.SliceList\"\000\022D\n\021" + + "ListConnectionIds\022\022.context.ServiceId\032\031." + + "context.ConnectionIdList\"\000\022@\n\017ListConnec" + + "tions\022\022.context.ServiceId\032\027.context.Conn" + + "ectionList\"\000\022=\n\rGetConnection\022\025.context." + + "ConnectionId\032\023.context.Connection\"\000\022=\n\rS" + + "etConnection\022\023.context.Connection\032\025.cont" + + "ext.ConnectionId\"\000\022;\n\020RemoveConnection\022\025" + + ".context.ConnectionId\032\016.context.Empty\"\000\022" + + "C\n\023GetConnectionEvents\022\016.context.Empty\032\030" + + ".context.ConnectionEvent\"\0000\001b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -74426,13 +75269,19 @@ public final class ContextOuterClass { internal_static_context_Device_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Device_descriptor, - new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Component", "ControllerId", }); + new java.lang.String[] { "DeviceId", "Name", "DeviceType", "DeviceConfig", "DeviceOperationalStatus", "DeviceDrivers", "DeviceEndpoints", "Components", "ControllerId", }); internal_static_context_Component_descriptor = getDescriptor().getMessageTypes().get(17); internal_static_context_Component_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_context_Component_descriptor, - new java.lang.String[] { "CompString", }); + new java.lang.String[] { "ComponentUuid", "Name", "Type", "Attributes", "Parent", }); + internal_static_context_Component_AttributesEntry_descriptor = + internal_static_context_Component_descriptor.getNestedTypes().get(0); + internal_static_context_Component_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_context_Component_AttributesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); internal_static_context_DeviceConfig_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_context_DeviceConfig_fieldAccessorTable = new diff --git a/src/automation/target/generated-sources/grpc/context/ContextService.java b/src/ztp/target/generated-sources/grpc/context/ContextService.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextService.java rename to src/ztp/target/generated-sources/grpc/context/ContextService.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceBean.java b/src/ztp/target/generated-sources/grpc/context/ContextServiceBean.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextServiceBean.java rename to src/ztp/target/generated-sources/grpc/context/ContextServiceBean.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceClient.java b/src/ztp/target/generated-sources/grpc/context/ContextServiceClient.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextServiceClient.java rename to src/ztp/target/generated-sources/grpc/context/ContextServiceClient.java diff --git a/src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java b/src/ztp/target/generated-sources/grpc/context/ContextServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/ContextServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/context/ContextServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java b/src/ztp/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/context/MutinyContextServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/device/Device.java b/src/ztp/target/generated-sources/grpc/device/Device.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/Device.java rename to src/ztp/target/generated-sources/grpc/device/Device.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceService.java b/src/ztp/target/generated-sources/grpc/device/DeviceService.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceService.java rename to src/ztp/target/generated-sources/grpc/device/DeviceService.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java b/src/ztp/target/generated-sources/grpc/device/DeviceServiceBean.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceServiceBean.java rename to src/ztp/target/generated-sources/grpc/device/DeviceServiceBean.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java b/src/ztp/target/generated-sources/grpc/device/DeviceServiceClient.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceServiceClient.java rename to src/ztp/target/generated-sources/grpc/device/DeviceServiceClient.java diff --git a/src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java b/src/ztp/target/generated-sources/grpc/device/DeviceServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/DeviceServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/device/DeviceServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java b/src/ztp/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/device/MutinyDeviceServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java b/src/ztp/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java similarity index 100% rename from src/automation/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java rename to src/ztp/target/generated-sources/grpc/kpi_sample_types/KpiSampleTypes.java diff --git a/src/automation/target/generated-sources/grpc/monitoring/Monitoring.java b/src/ztp/target/generated-sources/grpc/monitoring/Monitoring.java similarity index 100% rename from src/automation/target/generated-sources/grpc/monitoring/Monitoring.java rename to src/ztp/target/generated-sources/grpc/monitoring/Monitoring.java diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringService.java similarity index 100% rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringService.java rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringService.java diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java similarity index 100% rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceBean.java diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java similarity index 100% rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceClient.java diff --git a/src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java b/src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/monitoring/MonitoringServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java b/src/ztp/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java similarity index 100% rename from src/automation/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/monitoring/MutinyMonitoringServiceGrpc.java diff --git a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java b/src/ztp/target/generated-sources/grpc/ztp/MutinyZtpServiceGrpc.java similarity index 56% rename from src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java rename to src/ztp/target/generated-sources/grpc/ztp/MutinyZtpServiceGrpc.java index 64565286ca36fd0b820c000e466954144207ab0b..d46fdffb7b88f34ad648053139920d23dc2ab9d1 100644 --- a/src/automation/target/generated-sources/grpc/automation/MutinyAutomationServiceGrpc.java +++ b/src/ztp/target/generated-sources/grpc/ztp/MutinyZtpServiceGrpc.java @@ -1,6 +1,6 @@ -package automation; +package ztp; -import static automation.AutomationServiceGrpc.getServiceDescriptor; +import static ztp.ZtpServiceGrpc.getServiceDescriptor; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; @@ -8,67 +8,67 @@ import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; @javax.annotation.Generated( value = "by Mutiny Grpc generator", -comments = "Source: automation.proto") -public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { - private MutinyAutomationServiceGrpc() {} +comments = "Source: ztp.proto") +public final class MutinyZtpServiceGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyZtpServiceGrpc() {} - public static MutinyAutomationServiceStub newMutinyStub(io.grpc.Channel channel) { - return new MutinyAutomationServiceStub(channel); + public static MutinyZtpServiceStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyZtpServiceStub(channel); } - public static final class MutinyAutomationServiceStub extends io.grpc.stub.AbstractStub<MutinyAutomationServiceStub> implements io.quarkus.grpc.runtime.MutinyStub { - private AutomationServiceGrpc.AutomationServiceStub delegateStub; + public static final class MutinyZtpServiceStub extends io.grpc.stub.AbstractStub<MutinyZtpServiceStub> implements io.quarkus.grpc.runtime.MutinyStub { + private ZtpServiceGrpc.ZtpServiceStub delegateStub; - private MutinyAutomationServiceStub(io.grpc.Channel channel) { + private MutinyZtpServiceStub(io.grpc.Channel channel) { super(channel); - delegateStub = AutomationServiceGrpc.newStub(channel); + delegateStub = ZtpServiceGrpc.newStub(channel); } - private MutinyAutomationServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + private MutinyZtpServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); - delegateStub = AutomationServiceGrpc.newStub(channel).build(channel, callOptions); + delegateStub = ZtpServiceGrpc.newStub(channel).build(channel, callOptions); } @Override - protected MutinyAutomationServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new MutinyAutomationServiceStub(channel, callOptions); + protected MutinyZtpServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyZtpServiceStub(channel, callOptions); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRole> ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRole); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpGetDeviceRolesByDeviceId); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpAdd(ztp.Ztp.DeviceRole request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpAdd); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpUpdate(ztp.Ztp.DeviceRoleConfig request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpUpdate); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpDelete(ztp.Ztp.DeviceRole request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDelete); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::ztpDeleteAll); } } - public static abstract class AutomationServiceImplBase implements io.grpc.BindableService { + public static abstract class ZtpServiceImplBase implements io.grpc.BindableService { private String compression; /** @@ -76,85 +76,85 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim * * @param compression the compression, e.g {@code gzip} */ - public AutomationServiceImplBase withCompression(String compression) { + public ZtpServiceImplBase withCompression(String compression) { this.compression = compression; return this; } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRole> ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpAdd(ztp.Ztp.DeviceRole request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpUpdate(ztp.Ztp.DeviceRoleConfig request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpDelete(ztp.Ztp.DeviceRole request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } - public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - automation.AutomationServiceGrpc.getZtpGetDeviceRoleMethod(), + ztp.ZtpServiceGrpc.getZtpGetDeviceRoleMethod(), asyncUnaryCall( new MethodHandlers< - automation.Automation.DeviceRoleId, - automation.Automation.DeviceRole>( + ztp.Ztp.DeviceRoleId, + ztp.Ztp.DeviceRole>( this, METHODID_ZTP_GET_DEVICE_ROLE, compression))) .addMethod( - automation.AutomationServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod(), + ztp.ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod(), asyncUnaryCall( new MethodHandlers< context.ContextOuterClass.DeviceId, - automation.Automation.DeviceRoleList>( + ztp.Ztp.DeviceRoleList>( this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID, compression))) .addMethod( - automation.AutomationServiceGrpc.getZtpAddMethod(), + ztp.ZtpServiceGrpc.getZtpAddMethod(), asyncUnaryCall( new MethodHandlers< - automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState>( + ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState>( this, METHODID_ZTP_ADD, compression))) .addMethod( - automation.AutomationServiceGrpc.getZtpUpdateMethod(), + ztp.ZtpServiceGrpc.getZtpUpdateMethod(), asyncUnaryCall( new MethodHandlers< - automation.Automation.DeviceRoleConfig, - automation.Automation.DeviceRoleState>( + ztp.Ztp.DeviceRoleConfig, + ztp.Ztp.DeviceRoleState>( this, METHODID_ZTP_UPDATE, compression))) .addMethod( - automation.AutomationServiceGrpc.getZtpDeleteMethod(), + ztp.ZtpServiceGrpc.getZtpDeleteMethod(), asyncUnaryCall( new MethodHandlers< - automation.Automation.DeviceRole, - automation.Automation.DeviceRoleState>( + ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState>( this, METHODID_ZTP_DELETE, compression))) .addMethod( - automation.AutomationServiceGrpc.getZtpDeleteAllMethod(), + ztp.ZtpServiceGrpc.getZtpDeleteAllMethod(), asyncUnaryCall( new MethodHandlers< context.ContextOuterClass.Empty, - automation.Automation.DeviceDeletionResult>( + ztp.Ztp.DeviceDeletionResult>( this, METHODID_ZTP_DELETE_ALL, compression))) .build(); } @@ -172,11 +172,11 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { - private final AutomationServiceImplBase serviceImpl; + private final ZtpServiceImplBase serviceImpl; private final int methodId; private final String compression; - MethodHandlers(AutomationServiceImplBase serviceImpl, int methodId, String compression) { + MethodHandlers(ZtpServiceImplBase serviceImpl, int methodId, String compression) { this.serviceImpl = serviceImpl; this.methodId = methodId; this.compression = compression; @@ -187,38 +187,38 @@ public final class MutinyAutomationServiceGrpc implements io.quarkus.grpc.runtim public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_ZTP_GET_DEVICE_ROLE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRoleId) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRole>) responseObserver, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRoleId) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRole>) responseObserver, compression, serviceImpl::ztpGetDeviceRole); break; case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID: io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.DeviceId) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleList>) responseObserver, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleList>) responseObserver, compression, serviceImpl::ztpGetDeviceRolesByDeviceId); break; case METHODID_ZTP_ADD: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRole) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRole) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState>) responseObserver, compression, serviceImpl::ztpAdd); break; case METHODID_ZTP_UPDATE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRoleConfig) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRoleConfig) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState>) responseObserver, compression, serviceImpl::ztpUpdate); break; case METHODID_ZTP_DELETE: - io.quarkus.grpc.runtime.ServerCalls.oneToOne((automation.Automation.DeviceRole) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceRoleState>) responseObserver, + io.quarkus.grpc.runtime.ServerCalls.oneToOne((ztp.Ztp.DeviceRole) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState>) responseObserver, compression, serviceImpl::ztpDelete); break; case METHODID_ZTP_DELETE_ALL: io.quarkus.grpc.runtime.ServerCalls.oneToOne((context.ContextOuterClass.Empty) request, - (io.grpc.stub.StreamObserver<automation.Automation.DeviceDeletionResult>) responseObserver, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceDeletionResult>) responseObserver, compression, serviceImpl::ztpDeleteAll); break; diff --git a/src/automation/target/generated-sources/grpc/automation/Automation.java b/src/ztp/target/generated-sources/grpc/ztp/Ztp.java similarity index 75% rename from src/automation/target/generated-sources/grpc/automation/Automation.java rename to src/ztp/target/generated-sources/grpc/ztp/Ztp.java index cd82f7423092c72c6c2fa02836db645db52f7041..c9ff87a276b87ab9448b93a9f3c2e0bb8b1f2586 100644 --- a/src/automation/target/generated-sources/grpc/automation/Automation.java +++ b/src/ztp/target/generated-sources/grpc/ztp/Ztp.java @@ -1,10 +1,10 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: automation.proto +// source: ztp.proto -package automation; +package ztp; -public final class Automation { - private Automation() {} +public final class Ztp { + private Ztp() {} public static void registerAllExtensions( com.google.protobuf.ExtensionRegistryLite registry) { } @@ -15,7 +15,7 @@ public final class Automation { (com.google.protobuf.ExtensionRegistryLite) registry); } /** - * Protobuf enum {@code automation.DeviceRoleType} + * Protobuf enum {@code ztp.DeviceRoleType} */ public enum DeviceRoleType implements com.google.protobuf.ProtocolMessageEnum { @@ -114,7 +114,7 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return automation.Automation.getDescriptor().getEnumTypes().get(0); + return ztp.Ztp.getDescriptor().getEnumTypes().get(0); } private static final DeviceRoleType[] VALUES = values(); @@ -137,11 +137,11 @@ public final class Automation { this.value = value; } - // @@protoc_insertion_point(enum_scope:automation.DeviceRoleType) + // @@protoc_insertion_point(enum_scope:ztp.DeviceRoleType) } /** - * Protobuf enum {@code automation.ZtpDeviceState} + * Protobuf enum {@code ztp.ZtpDeviceState} */ public enum ZtpDeviceState implements com.google.protobuf.ProtocolMessageEnum { @@ -240,7 +240,7 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return automation.Automation.getDescriptor().getEnumTypes().get(1); + return ztp.Ztp.getDescriptor().getEnumTypes().get(1); } private static final ZtpDeviceState[] VALUES = values(); @@ -263,11 +263,11 @@ public final class Automation { this.value = value; } - // @@protoc_insertion_point(enum_scope:automation.ZtpDeviceState) + // @@protoc_insertion_point(enum_scope:ztp.ZtpDeviceState) } public interface DeviceRoleIdOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.DeviceRoleId) + // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleId) com.google.protobuf.MessageOrBuilder { /** @@ -301,11 +301,11 @@ public final class Automation { context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder(); } /** - * Protobuf type {@code automation.DeviceRoleId} + * Protobuf type {@code ztp.DeviceRoleId} */ public static final class DeviceRoleId extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.DeviceRoleId) + // @@protoc_insertion_point(message_implements:ztp.DeviceRoleId) DeviceRoleIdOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceRoleId.newBuilder() to construct. @@ -392,15 +392,15 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleId_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleId_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class); + ztp.Ztp.DeviceRoleId.class, ztp.Ztp.DeviceRoleId.Builder.class); } public static final int DEVROLEID_FIELD_NUMBER = 1; @@ -502,10 +502,10 @@ public final class Automation { if (obj == this) { return true; } - if (!(obj instanceof automation.Automation.DeviceRoleId)) { + if (!(obj instanceof ztp.Ztp.DeviceRoleId)) { return super.equals(obj); } - automation.Automation.DeviceRoleId other = (automation.Automation.DeviceRoleId) obj; + ztp.Ztp.DeviceRoleId other = (ztp.Ztp.DeviceRoleId) obj; if (hasDevRoleId() != other.hasDevRoleId()) return false; if (hasDevRoleId()) { @@ -541,69 +541,69 @@ public final class Automation { return hash; } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleId parseFrom(byte[] data) + public static ztp.Ztp.DeviceRoleId parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleId parseFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleId parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleId parseDelimitedFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleId parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleId parseDelimitedFrom( + public static ztp.Ztp.DeviceRoleId parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleId parseFrom( + public static ztp.Ztp.DeviceRoleId parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -616,7 +616,7 @@ public final class Automation { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(automation.Automation.DeviceRoleId prototype) { + public static Builder newBuilder(ztp.Ztp.DeviceRoleId prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -632,26 +632,26 @@ public final class Automation { return builder; } /** - * Protobuf type {@code automation.DeviceRoleId} + * Protobuf type {@code ztp.DeviceRoleId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:automation.DeviceRoleId) - automation.Automation.DeviceRoleIdOrBuilder { + // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleId) + ztp.Ztp.DeviceRoleIdOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleId_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleId_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class); + ztp.Ztp.DeviceRoleId.class, ztp.Ztp.DeviceRoleId.Builder.class); } - // Construct using automation.Automation.DeviceRoleId.newBuilder() + // Construct using ztp.Ztp.DeviceRoleId.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -687,17 +687,17 @@ public final class Automation { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return automation.Automation.internal_static_automation_DeviceRoleId_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleId_descriptor; } @java.lang.Override - public automation.Automation.DeviceRoleId getDefaultInstanceForType() { - return automation.Automation.DeviceRoleId.getDefaultInstance(); + public ztp.Ztp.DeviceRoleId getDefaultInstanceForType() { + return ztp.Ztp.DeviceRoleId.getDefaultInstance(); } @java.lang.Override - public automation.Automation.DeviceRoleId build() { - automation.Automation.DeviceRoleId result = buildPartial(); + public ztp.Ztp.DeviceRoleId build() { + ztp.Ztp.DeviceRoleId result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -705,8 +705,8 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleId buildPartial() { - automation.Automation.DeviceRoleId result = new automation.Automation.DeviceRoleId(this); + public ztp.Ztp.DeviceRoleId buildPartial() { + ztp.Ztp.DeviceRoleId result = new ztp.Ztp.DeviceRoleId(this); if (devRoleIdBuilder_ == null) { result.devRoleId_ = devRoleId_; } else { @@ -755,16 +755,16 @@ public final class Automation { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof automation.Automation.DeviceRoleId) { - return mergeFrom((automation.Automation.DeviceRoleId)other); + if (other instanceof ztp.Ztp.DeviceRoleId) { + return mergeFrom((ztp.Ztp.DeviceRoleId)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(automation.Automation.DeviceRoleId other) { - if (other == automation.Automation.DeviceRoleId.getDefaultInstance()) return this; + public Builder mergeFrom(ztp.Ztp.DeviceRoleId other) { + if (other == ztp.Ztp.DeviceRoleId.getDefaultInstance()) return this; if (other.hasDevRoleId()) { mergeDevRoleId(other.getDevRoleId()); } @@ -786,11 +786,11 @@ public final class Automation { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - automation.Automation.DeviceRoleId parsedMessage = null; + ztp.Ztp.DeviceRoleId parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.DeviceRoleId) e.getUnfinishedMessage(); + parsedMessage = (ztp.Ztp.DeviceRoleId) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -1050,16 +1050,16 @@ public final class Automation { } - // @@protoc_insertion_point(builder_scope:automation.DeviceRoleId) + // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleId) } - // @@protoc_insertion_point(class_scope:automation.DeviceRoleId) - private static final automation.Automation.DeviceRoleId DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:ztp.DeviceRoleId) + private static final ztp.Ztp.DeviceRoleId DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new automation.Automation.DeviceRoleId(); + DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleId(); } - public static automation.Automation.DeviceRoleId getDefaultInstance() { + public static ztp.Ztp.DeviceRoleId getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -1084,48 +1084,48 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleId getDefaultInstanceForType() { + public ztp.Ztp.DeviceRoleId getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface DeviceRoleOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.DeviceRole) + // @@protoc_insertion_point(interface_extends:ztp.DeviceRole) com.google.protobuf.MessageOrBuilder { /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return Whether the devRoleId field is set. */ boolean hasDevRoleId(); /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return The devRoleId. */ - automation.Automation.DeviceRoleId getDevRoleId(); + ztp.Ztp.DeviceRoleId getDevRoleId(); /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder(); + ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder(); /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return The enum numeric value on the wire for devRoleType. */ int getDevRoleTypeValue(); /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return The devRoleType. */ - automation.Automation.DeviceRoleType getDevRoleType(); + ztp.Ztp.DeviceRoleType getDevRoleType(); } /** - * Protobuf type {@code automation.DeviceRole} + * Protobuf type {@code ztp.DeviceRole} */ public static final class DeviceRole extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.DeviceRole) + // @@protoc_insertion_point(message_implements:ztp.DeviceRole) DeviceRoleOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceRole.newBuilder() to construct. @@ -1167,11 +1167,11 @@ public final class Automation { done = true; break; case 10: { - automation.Automation.DeviceRoleId.Builder subBuilder = null; + ztp.Ztp.DeviceRoleId.Builder subBuilder = null; if (devRoleId_ != null) { subBuilder = devRoleId_.toBuilder(); } - devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry); + devRoleId_ = input.readMessage(ztp.Ztp.DeviceRoleId.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(devRoleId_); devRoleId_ = subBuilder.buildPartial(); @@ -1206,21 +1206,21 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRole_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRole_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRole_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class); + ztp.Ztp.DeviceRole.class, ztp.Ztp.DeviceRole.Builder.class); } public static final int DEVROLEID_FIELD_NUMBER = 1; - private automation.Automation.DeviceRoleId devRoleId_; + private ztp.Ztp.DeviceRoleId devRoleId_; /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return Whether the devRoleId field is set. */ @java.lang.Override @@ -1228,38 +1228,38 @@ public final class Automation { return devRoleId_ != null; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return The devRoleId. */ @java.lang.Override - public automation.Automation.DeviceRoleId getDevRoleId() { - return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_; + public ztp.Ztp.DeviceRoleId getDevRoleId() { + return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ @java.lang.Override - public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { + public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { return getDevRoleId(); } public static final int DEVROLETYPE_FIELD_NUMBER = 2; private int devRoleType_; /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return The enum numeric value on the wire for devRoleType. */ @java.lang.Override public int getDevRoleTypeValue() { return devRoleType_; } /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return The devRoleType. */ - @java.lang.Override public automation.Automation.DeviceRoleType getDevRoleType() { + @java.lang.Override public ztp.Ztp.DeviceRoleType getDevRoleType() { @SuppressWarnings("deprecation") - automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_); - return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result; + ztp.Ztp.DeviceRoleType result = ztp.Ztp.DeviceRoleType.valueOf(devRoleType_); + return result == null ? ztp.Ztp.DeviceRoleType.UNRECOGNIZED : result; } private byte memoizedIsInitialized = -1; @@ -1279,7 +1279,7 @@ public final class Automation { if (devRoleId_ != null) { output.writeMessage(1, getDevRoleId()); } - if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) { + if (devRoleType_ != ztp.Ztp.DeviceRoleType.NONE.getNumber()) { output.writeEnum(2, devRoleType_); } unknownFields.writeTo(output); @@ -1295,7 +1295,7 @@ public final class Automation { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getDevRoleId()); } - if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) { + if (devRoleType_ != ztp.Ztp.DeviceRoleType.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, devRoleType_); } @@ -1309,10 +1309,10 @@ public final class Automation { if (obj == this) { return true; } - if (!(obj instanceof automation.Automation.DeviceRole)) { + if (!(obj instanceof ztp.Ztp.DeviceRole)) { return super.equals(obj); } - automation.Automation.DeviceRole other = (automation.Automation.DeviceRole) obj; + ztp.Ztp.DeviceRole other = (ztp.Ztp.DeviceRole) obj; if (hasDevRoleId() != other.hasDevRoleId()) return false; if (hasDevRoleId()) { @@ -1342,69 +1342,69 @@ public final class Automation { return hash; } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRole parseFrom(byte[] data) + public static ztp.Ztp.DeviceRole parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRole parseFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRole parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRole parseDelimitedFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRole parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static automation.Automation.DeviceRole parseDelimitedFrom( + public static ztp.Ztp.DeviceRole parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRole parseFrom( + public static ztp.Ztp.DeviceRole parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1417,7 +1417,7 @@ public final class Automation { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(automation.Automation.DeviceRole prototype) { + public static Builder newBuilder(ztp.Ztp.DeviceRole prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -1433,26 +1433,26 @@ public final class Automation { return builder; } /** - * Protobuf type {@code automation.DeviceRole} + * Protobuf type {@code ztp.DeviceRole} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:automation.DeviceRole) - automation.Automation.DeviceRoleOrBuilder { + // @@protoc_insertion_point(builder_implements:ztp.DeviceRole) + ztp.Ztp.DeviceRoleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRole_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRole_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRole_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class); + ztp.Ztp.DeviceRole.class, ztp.Ztp.DeviceRole.Builder.class); } - // Construct using automation.Automation.DeviceRole.newBuilder() + // Construct using ztp.Ztp.DeviceRole.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -1484,17 +1484,17 @@ public final class Automation { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return automation.Automation.internal_static_automation_DeviceRole_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRole_descriptor; } @java.lang.Override - public automation.Automation.DeviceRole getDefaultInstanceForType() { - return automation.Automation.DeviceRole.getDefaultInstance(); + public ztp.Ztp.DeviceRole getDefaultInstanceForType() { + return ztp.Ztp.DeviceRole.getDefaultInstance(); } @java.lang.Override - public automation.Automation.DeviceRole build() { - automation.Automation.DeviceRole result = buildPartial(); + public ztp.Ztp.DeviceRole build() { + ztp.Ztp.DeviceRole result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1502,8 +1502,8 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRole buildPartial() { - automation.Automation.DeviceRole result = new automation.Automation.DeviceRole(this); + public ztp.Ztp.DeviceRole buildPartial() { + ztp.Ztp.DeviceRole result = new ztp.Ztp.DeviceRole(this); if (devRoleIdBuilder_ == null) { result.devRoleId_ = devRoleId_; } else { @@ -1548,16 +1548,16 @@ public final class Automation { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof automation.Automation.DeviceRole) { - return mergeFrom((automation.Automation.DeviceRole)other); + if (other instanceof ztp.Ztp.DeviceRole) { + return mergeFrom((ztp.Ztp.DeviceRole)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(automation.Automation.DeviceRole other) { - if (other == automation.Automation.DeviceRole.getDefaultInstance()) return this; + public Builder mergeFrom(ztp.Ztp.DeviceRole other) { + if (other == ztp.Ztp.DeviceRole.getDefaultInstance()) return this; if (other.hasDevRoleId()) { mergeDevRoleId(other.getDevRoleId()); } @@ -1579,11 +1579,11 @@ public final class Automation { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - automation.Automation.DeviceRole parsedMessage = null; + ztp.Ztp.DeviceRole parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.DeviceRole) e.getUnfinishedMessage(); + parsedMessage = (ztp.Ztp.DeviceRole) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -1593,31 +1593,31 @@ public final class Automation { return this; } - private automation.Automation.DeviceRoleId devRoleId_; + private ztp.Ztp.DeviceRoleId devRoleId_; private com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_; + ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> devRoleIdBuilder_; /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return Whether the devRoleId field is set. */ public boolean hasDevRoleId() { return devRoleIdBuilder_ != null || devRoleId_ != null; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return The devRoleId. */ - public automation.Automation.DeviceRoleId getDevRoleId() { + public ztp.Ztp.DeviceRoleId getDevRoleId() { if (devRoleIdBuilder_ == null) { - return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_; + return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_; } else { return devRoleIdBuilder_.getMessage(); } } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public Builder setDevRoleId(automation.Automation.DeviceRoleId value) { + public Builder setDevRoleId(ztp.Ztp.DeviceRoleId value) { if (devRoleIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -1631,10 +1631,10 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ public Builder setDevRoleId( - automation.Automation.DeviceRoleId.Builder builderForValue) { + ztp.Ztp.DeviceRoleId.Builder builderForValue) { if (devRoleIdBuilder_ == null) { devRoleId_ = builderForValue.build(); onChanged(); @@ -1645,13 +1645,13 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) { + public Builder mergeDevRoleId(ztp.Ztp.DeviceRoleId value) { if (devRoleIdBuilder_ == null) { if (devRoleId_ != null) { devRoleId_ = - automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial(); + ztp.Ztp.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial(); } else { devRoleId_ = value; } @@ -1663,7 +1663,7 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ public Builder clearDevRoleId() { if (devRoleIdBuilder_ == null) { @@ -1677,33 +1677,33 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() { + public ztp.Ztp.DeviceRoleId.Builder getDevRoleIdBuilder() { onChanged(); return getDevRoleIdFieldBuilder().getBuilder(); } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { + public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { if (devRoleIdBuilder_ != null) { return devRoleIdBuilder_.getMessageOrBuilder(); } else { return devRoleId_ == null ? - automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_; + ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_; } } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> + ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> getDevRoleIdFieldBuilder() { if (devRoleIdBuilder_ == null) { devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>( + ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder>( getDevRoleId(), getParentForChildren(), isClean()); @@ -1714,14 +1714,14 @@ public final class Automation { private int devRoleType_ = 0; /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return The enum numeric value on the wire for devRoleType. */ @java.lang.Override public int getDevRoleTypeValue() { return devRoleType_; } /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @param value The enum numeric value on the wire for devRoleType to set. * @return This builder for chaining. */ @@ -1732,21 +1732,21 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return The devRoleType. */ @java.lang.Override - public automation.Automation.DeviceRoleType getDevRoleType() { + public ztp.Ztp.DeviceRoleType getDevRoleType() { @SuppressWarnings("deprecation") - automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_); - return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result; + ztp.Ztp.DeviceRoleType result = ztp.Ztp.DeviceRoleType.valueOf(devRoleType_); + return result == null ? ztp.Ztp.DeviceRoleType.UNRECOGNIZED : result; } /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @param value The devRoleType to set. * @return This builder for chaining. */ - public Builder setDevRoleType(automation.Automation.DeviceRoleType value) { + public Builder setDevRoleType(ztp.Ztp.DeviceRoleType value) { if (value == null) { throw new NullPointerException(); } @@ -1756,7 +1756,7 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleType devRoleType = 2;</code> + * <code>.ztp.DeviceRoleType devRoleType = 2;</code> * @return This builder for chaining. */ public Builder clearDevRoleType() { @@ -1778,16 +1778,16 @@ public final class Automation { } - // @@protoc_insertion_point(builder_scope:automation.DeviceRole) + // @@protoc_insertion_point(builder_scope:ztp.DeviceRole) } - // @@protoc_insertion_point(class_scope:automation.DeviceRole) - private static final automation.Automation.DeviceRole DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:ztp.DeviceRole) + private static final ztp.Ztp.DeviceRole DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new automation.Automation.DeviceRole(); + DEFAULT_INSTANCE = new ztp.Ztp.DeviceRole(); } - public static automation.Automation.DeviceRole getDefaultInstance() { + public static ztp.Ztp.DeviceRole getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -1812,30 +1812,30 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRole getDefaultInstanceForType() { + public ztp.Ztp.DeviceRole getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface DeviceRoleConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.DeviceRoleConfig) + // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleConfig) com.google.protobuf.MessageOrBuilder { /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> * @return Whether the devRole field is set. */ boolean hasDevRole(); /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> * @return The devRole. */ - automation.Automation.DeviceRole getDevRole(); + ztp.Ztp.DeviceRole getDevRole(); /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ - automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(); + ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder(); /** * <code>.context.DeviceConfig devConfig = 2;</code> @@ -1853,11 +1853,11 @@ public final class Automation { context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder(); } /** - * Protobuf type {@code automation.DeviceRoleConfig} + * Protobuf type {@code ztp.DeviceRoleConfig} */ public static final class DeviceRoleConfig extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.DeviceRoleConfig) + // @@protoc_insertion_point(message_implements:ztp.DeviceRoleConfig) DeviceRoleConfigOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceRoleConfig.newBuilder() to construct. @@ -1898,11 +1898,11 @@ public final class Automation { done = true; break; case 10: { - automation.Automation.DeviceRole.Builder subBuilder = null; + ztp.Ztp.DeviceRole.Builder subBuilder = null; if (devRole_ != null) { subBuilder = devRole_.toBuilder(); } - devRole_ = input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry); + devRole_ = input.readMessage(ztp.Ztp.DeviceRole.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(devRole_); devRole_ = subBuilder.buildPartial(); @@ -1944,21 +1944,21 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class); + ztp.Ztp.DeviceRoleConfig.class, ztp.Ztp.DeviceRoleConfig.Builder.class); } public static final int DEVROLE_FIELD_NUMBER = 1; - private automation.Automation.DeviceRole devRole_; + private ztp.Ztp.DeviceRole devRole_; /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> * @return Whether the devRole field is set. */ @java.lang.Override @@ -1966,18 +1966,18 @@ public final class Automation { return devRole_ != null; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> * @return The devRole. */ @java.lang.Override - public automation.Automation.DeviceRole getDevRole() { - return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_; + public ztp.Ztp.DeviceRole getDevRole() { + return devRole_ == null ? ztp.Ztp.DeviceRole.getDefaultInstance() : devRole_; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ @java.lang.Override - public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() { + public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder() { return getDevRole(); } @@ -2054,10 +2054,10 @@ public final class Automation { if (obj == this) { return true; } - if (!(obj instanceof automation.Automation.DeviceRoleConfig)) { + if (!(obj instanceof ztp.Ztp.DeviceRoleConfig)) { return super.equals(obj); } - automation.Automation.DeviceRoleConfig other = (automation.Automation.DeviceRoleConfig) obj; + ztp.Ztp.DeviceRoleConfig other = (ztp.Ztp.DeviceRoleConfig) obj; if (hasDevRole() != other.hasDevRole()) return false; if (hasDevRole()) { @@ -2093,69 +2093,69 @@ public final class Automation { return hash; } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleConfig parseFrom(byte[] data) + public static ztp.Ztp.DeviceRoleConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleConfig parseFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleConfig parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleConfig parseDelimitedFrom( + public static ztp.Ztp.DeviceRoleConfig parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleConfig parseFrom( + public static ztp.Ztp.DeviceRoleConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2168,7 +2168,7 @@ public final class Automation { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(automation.Automation.DeviceRoleConfig prototype) { + public static Builder newBuilder(ztp.Ztp.DeviceRoleConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2184,26 +2184,26 @@ public final class Automation { return builder; } /** - * Protobuf type {@code automation.DeviceRoleConfig} + * Protobuf type {@code ztp.DeviceRoleConfig} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:automation.DeviceRoleConfig) - automation.Automation.DeviceRoleConfigOrBuilder { + // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleConfig) + ztp.Ztp.DeviceRoleConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class); + ztp.Ztp.DeviceRoleConfig.class, ztp.Ztp.DeviceRoleConfig.Builder.class); } - // Construct using automation.Automation.DeviceRoleConfig.newBuilder() + // Construct using ztp.Ztp.DeviceRoleConfig.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -2239,17 +2239,17 @@ public final class Automation { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleConfig_descriptor; } @java.lang.Override - public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() { - return automation.Automation.DeviceRoleConfig.getDefaultInstance(); + public ztp.Ztp.DeviceRoleConfig getDefaultInstanceForType() { + return ztp.Ztp.DeviceRoleConfig.getDefaultInstance(); } @java.lang.Override - public automation.Automation.DeviceRoleConfig build() { - automation.Automation.DeviceRoleConfig result = buildPartial(); + public ztp.Ztp.DeviceRoleConfig build() { + ztp.Ztp.DeviceRoleConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2257,8 +2257,8 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleConfig buildPartial() { - automation.Automation.DeviceRoleConfig result = new automation.Automation.DeviceRoleConfig(this); + public ztp.Ztp.DeviceRoleConfig buildPartial() { + ztp.Ztp.DeviceRoleConfig result = new ztp.Ztp.DeviceRoleConfig(this); if (devRoleBuilder_ == null) { result.devRole_ = devRole_; } else { @@ -2307,16 +2307,16 @@ public final class Automation { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof automation.Automation.DeviceRoleConfig) { - return mergeFrom((automation.Automation.DeviceRoleConfig)other); + if (other instanceof ztp.Ztp.DeviceRoleConfig) { + return mergeFrom((ztp.Ztp.DeviceRoleConfig)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(automation.Automation.DeviceRoleConfig other) { - if (other == automation.Automation.DeviceRoleConfig.getDefaultInstance()) return this; + public Builder mergeFrom(ztp.Ztp.DeviceRoleConfig other) { + if (other == ztp.Ztp.DeviceRoleConfig.getDefaultInstance()) return this; if (other.hasDevRole()) { mergeDevRole(other.getDevRole()); } @@ -2338,11 +2338,11 @@ public final class Automation { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - automation.Automation.DeviceRoleConfig parsedMessage = null; + ztp.Ztp.DeviceRoleConfig parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.DeviceRoleConfig) e.getUnfinishedMessage(); + parsedMessage = (ztp.Ztp.DeviceRoleConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2352,31 +2352,31 @@ public final class Automation { return this; } - private automation.Automation.DeviceRole devRole_; + private ztp.Ztp.DeviceRole devRole_; private com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_; + ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> devRoleBuilder_; /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> * @return Whether the devRole field is set. */ public boolean hasDevRole() { return devRoleBuilder_ != null || devRole_ != null; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> * @return The devRole. */ - public automation.Automation.DeviceRole getDevRole() { + public ztp.Ztp.DeviceRole getDevRole() { if (devRoleBuilder_ == null) { - return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_; + return devRole_ == null ? ztp.Ztp.DeviceRole.getDefaultInstance() : devRole_; } else { return devRoleBuilder_.getMessage(); } } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ - public Builder setDevRole(automation.Automation.DeviceRole value) { + public Builder setDevRole(ztp.Ztp.DeviceRole value) { if (devRoleBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2390,10 +2390,10 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ public Builder setDevRole( - automation.Automation.DeviceRole.Builder builderForValue) { + ztp.Ztp.DeviceRole.Builder builderForValue) { if (devRoleBuilder_ == null) { devRole_ = builderForValue.build(); onChanged(); @@ -2404,13 +2404,13 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ - public Builder mergeDevRole(automation.Automation.DeviceRole value) { + public Builder mergeDevRole(ztp.Ztp.DeviceRole value) { if (devRoleBuilder_ == null) { if (devRole_ != null) { devRole_ = - automation.Automation.DeviceRole.newBuilder(devRole_).mergeFrom(value).buildPartial(); + ztp.Ztp.DeviceRole.newBuilder(devRole_).mergeFrom(value).buildPartial(); } else { devRole_ = value; } @@ -2422,7 +2422,7 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ public Builder clearDevRole() { if (devRoleBuilder_ == null) { @@ -2436,33 +2436,33 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRole.Builder getDevRoleBuilder() { + public ztp.Ztp.DeviceRole.Builder getDevRoleBuilder() { onChanged(); return getDevRoleFieldBuilder().getBuilder(); } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() { + public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder() { if (devRoleBuilder_ != null) { return devRoleBuilder_.getMessageOrBuilder(); } else { return devRole_ == null ? - automation.Automation.DeviceRole.getDefaultInstance() : devRole_; + ztp.Ztp.DeviceRole.getDefaultInstance() : devRole_; } } /** - * <code>.automation.DeviceRole devRole = 1;</code> + * <code>.ztp.DeviceRole devRole = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> + ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> getDevRoleFieldBuilder() { if (devRoleBuilder_ == null) { devRoleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>( + ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder>( getDevRole(), getParentForChildren(), isClean()); @@ -2602,16 +2602,16 @@ public final class Automation { } - // @@protoc_insertion_point(builder_scope:automation.DeviceRoleConfig) + // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleConfig) } - // @@protoc_insertion_point(class_scope:automation.DeviceRoleConfig) - private static final automation.Automation.DeviceRoleConfig DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:ztp.DeviceRoleConfig) + private static final ztp.Ztp.DeviceRoleConfig DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new automation.Automation.DeviceRoleConfig(); + DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleConfig(); } - public static automation.Automation.DeviceRoleConfig getDefaultInstance() { + public static ztp.Ztp.DeviceRoleConfig getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -2636,46 +2636,46 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() { + public ztp.Ztp.DeviceRoleConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface DeviceRoleListOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.DeviceRoleList) + // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleList) com.google.protobuf.MessageOrBuilder { /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - java.util.List<automation.Automation.DeviceRole> + java.util.List<ztp.Ztp.DeviceRole> getDevRoleList(); /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - automation.Automation.DeviceRole getDevRole(int index); + ztp.Ztp.DeviceRole getDevRole(int index); /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ int getDevRoleCount(); /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - java.util.List<? extends automation.Automation.DeviceRoleOrBuilder> + java.util.List<? extends ztp.Ztp.DeviceRoleOrBuilder> getDevRoleOrBuilderList(); /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder( + ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder( int index); } /** - * Protobuf type {@code automation.DeviceRoleList} + * Protobuf type {@code ztp.DeviceRoleList} */ public static final class DeviceRoleList extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.DeviceRoleList) + // @@protoc_insertion_point(message_implements:ztp.DeviceRoleList) DeviceRoleListOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceRoleList.newBuilder() to construct. @@ -2719,11 +2719,11 @@ public final class Automation { break; case 10: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { - devRole_ = new java.util.ArrayList<automation.Automation.DeviceRole>(); + devRole_ = new java.util.ArrayList<ztp.Ztp.DeviceRole>(); mutable_bitField0_ |= 0x00000001; } devRole_.add( - input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry)); + input.readMessage(ztp.Ztp.DeviceRole.parser(), extensionRegistry)); break; } default: { @@ -2750,53 +2750,53 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleList_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleList_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class); + ztp.Ztp.DeviceRoleList.class, ztp.Ztp.DeviceRoleList.Builder.class); } public static final int DEVROLE_FIELD_NUMBER = 1; - private java.util.List<automation.Automation.DeviceRole> devRole_; + private java.util.List<ztp.Ztp.DeviceRole> devRole_; /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ @java.lang.Override - public java.util.List<automation.Automation.DeviceRole> getDevRoleList() { + public java.util.List<ztp.Ztp.DeviceRole> getDevRoleList() { return devRole_; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ @java.lang.Override - public java.util.List<? extends automation.Automation.DeviceRoleOrBuilder> + public java.util.List<? extends ztp.Ztp.DeviceRoleOrBuilder> getDevRoleOrBuilderList() { return devRole_; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ @java.lang.Override public int getDevRoleCount() { return devRole_.size(); } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ @java.lang.Override - public automation.Automation.DeviceRole getDevRole(int index) { + public ztp.Ztp.DeviceRole getDevRole(int index) { return devRole_.get(index); } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ @java.lang.Override - public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder( + public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder( int index) { return devRole_.get(index); } @@ -2841,10 +2841,10 @@ public final class Automation { if (obj == this) { return true; } - if (!(obj instanceof automation.Automation.DeviceRoleList)) { + if (!(obj instanceof ztp.Ztp.DeviceRoleList)) { return super.equals(obj); } - automation.Automation.DeviceRoleList other = (automation.Automation.DeviceRoleList) obj; + ztp.Ztp.DeviceRoleList other = (ztp.Ztp.DeviceRoleList) obj; if (!getDevRoleList() .equals(other.getDevRoleList())) return false; @@ -2868,69 +2868,69 @@ public final class Automation { return hash; } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleList parseFrom(byte[] data) + public static ztp.Ztp.DeviceRoleList parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleList parseFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleList parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleList parseDelimitedFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleList parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleList parseDelimitedFrom( + public static ztp.Ztp.DeviceRoleList parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleList parseFrom( + public static ztp.Ztp.DeviceRoleList parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -2943,7 +2943,7 @@ public final class Automation { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(automation.Automation.DeviceRoleList prototype) { + public static Builder newBuilder(ztp.Ztp.DeviceRoleList prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -2959,26 +2959,26 @@ public final class Automation { return builder; } /** - * Protobuf type {@code automation.DeviceRoleList} + * Protobuf type {@code ztp.DeviceRoleList} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:automation.DeviceRoleList) - automation.Automation.DeviceRoleListOrBuilder { + // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleList) + ztp.Ztp.DeviceRoleListOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleList_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleList_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleList_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class); + ztp.Ztp.DeviceRoleList.class, ztp.Ztp.DeviceRoleList.Builder.class); } - // Construct using automation.Automation.DeviceRoleList.newBuilder() + // Construct using ztp.Ztp.DeviceRoleList.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3009,17 +3009,17 @@ public final class Automation { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return automation.Automation.internal_static_automation_DeviceRoleList_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleList_descriptor; } @java.lang.Override - public automation.Automation.DeviceRoleList getDefaultInstanceForType() { - return automation.Automation.DeviceRoleList.getDefaultInstance(); + public ztp.Ztp.DeviceRoleList getDefaultInstanceForType() { + return ztp.Ztp.DeviceRoleList.getDefaultInstance(); } @java.lang.Override - public automation.Automation.DeviceRoleList build() { - automation.Automation.DeviceRoleList result = buildPartial(); + public ztp.Ztp.DeviceRoleList build() { + ztp.Ztp.DeviceRoleList result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3027,8 +3027,8 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleList buildPartial() { - automation.Automation.DeviceRoleList result = new automation.Automation.DeviceRoleList(this); + public ztp.Ztp.DeviceRoleList buildPartial() { + ztp.Ztp.DeviceRoleList result = new ztp.Ztp.DeviceRoleList(this); int from_bitField0_ = bitField0_; if (devRoleBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { @@ -3077,16 +3077,16 @@ public final class Automation { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof automation.Automation.DeviceRoleList) { - return mergeFrom((automation.Automation.DeviceRoleList)other); + if (other instanceof ztp.Ztp.DeviceRoleList) { + return mergeFrom((ztp.Ztp.DeviceRoleList)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(automation.Automation.DeviceRoleList other) { - if (other == automation.Automation.DeviceRoleList.getDefaultInstance()) return this; + public Builder mergeFrom(ztp.Ztp.DeviceRoleList other) { + if (other == ztp.Ztp.DeviceRoleList.getDefaultInstance()) return this; if (devRoleBuilder_ == null) { if (!other.devRole_.isEmpty()) { if (devRole_.isEmpty()) { @@ -3128,11 +3128,11 @@ public final class Automation { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - automation.Automation.DeviceRoleList parsedMessage = null; + ztp.Ztp.DeviceRoleList parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.DeviceRoleList) e.getUnfinishedMessage(); + parsedMessage = (ztp.Ztp.DeviceRoleList) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3143,22 +3143,22 @@ public final class Automation { } private int bitField0_; - private java.util.List<automation.Automation.DeviceRole> devRole_ = + private java.util.List<ztp.Ztp.DeviceRole> devRole_ = java.util.Collections.emptyList(); private void ensureDevRoleIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { - devRole_ = new java.util.ArrayList<automation.Automation.DeviceRole>(devRole_); + devRole_ = new java.util.ArrayList<ztp.Ztp.DeviceRole>(devRole_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< - automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_; + ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> devRoleBuilder_; /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public java.util.List<automation.Automation.DeviceRole> getDevRoleList() { + public java.util.List<ztp.Ztp.DeviceRole> getDevRoleList() { if (devRoleBuilder_ == null) { return java.util.Collections.unmodifiableList(devRole_); } else { @@ -3166,7 +3166,7 @@ public final class Automation { } } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public int getDevRoleCount() { if (devRoleBuilder_ == null) { @@ -3176,9 +3176,9 @@ public final class Automation { } } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRole getDevRole(int index) { + public ztp.Ztp.DeviceRole getDevRole(int index) { if (devRoleBuilder_ == null) { return devRole_.get(index); } else { @@ -3186,10 +3186,10 @@ public final class Automation { } } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder setDevRole( - int index, automation.Automation.DeviceRole value) { + int index, ztp.Ztp.DeviceRole value) { if (devRoleBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3203,10 +3203,10 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder setDevRole( - int index, automation.Automation.DeviceRole.Builder builderForValue) { + int index, ztp.Ztp.DeviceRole.Builder builderForValue) { if (devRoleBuilder_ == null) { ensureDevRoleIsMutable(); devRole_.set(index, builderForValue.build()); @@ -3217,9 +3217,9 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public Builder addDevRole(automation.Automation.DeviceRole value) { + public Builder addDevRole(ztp.Ztp.DeviceRole value) { if (devRoleBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3233,10 +3233,10 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder addDevRole( - int index, automation.Automation.DeviceRole value) { + int index, ztp.Ztp.DeviceRole value) { if (devRoleBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3250,10 +3250,10 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder addDevRole( - automation.Automation.DeviceRole.Builder builderForValue) { + ztp.Ztp.DeviceRole.Builder builderForValue) { if (devRoleBuilder_ == null) { ensureDevRoleIsMutable(); devRole_.add(builderForValue.build()); @@ -3264,10 +3264,10 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder addDevRole( - int index, automation.Automation.DeviceRole.Builder builderForValue) { + int index, ztp.Ztp.DeviceRole.Builder builderForValue) { if (devRoleBuilder_ == null) { ensureDevRoleIsMutable(); devRole_.add(index, builderForValue.build()); @@ -3278,10 +3278,10 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder addAllDevRole( - java.lang.Iterable<? extends automation.Automation.DeviceRole> values) { + java.lang.Iterable<? extends ztp.Ztp.DeviceRole> values) { if (devRoleBuilder_ == null) { ensureDevRoleIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( @@ -3293,7 +3293,7 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder clearDevRole() { if (devRoleBuilder_ == null) { @@ -3306,7 +3306,7 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ public Builder removeDevRole(int index) { if (devRoleBuilder_ == null) { @@ -3319,16 +3319,16 @@ public final class Automation { return this; } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRole.Builder getDevRoleBuilder( + public ztp.Ztp.DeviceRole.Builder getDevRoleBuilder( int index) { return getDevRoleFieldBuilder().getBuilder(index); } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder( + public ztp.Ztp.DeviceRoleOrBuilder getDevRoleOrBuilder( int index) { if (devRoleBuilder_ == null) { return devRole_.get(index); } else { @@ -3336,9 +3336,9 @@ public final class Automation { } } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public java.util.List<? extends automation.Automation.DeviceRoleOrBuilder> + public java.util.List<? extends ztp.Ztp.DeviceRoleOrBuilder> getDevRoleOrBuilderList() { if (devRoleBuilder_ != null) { return devRoleBuilder_.getMessageOrBuilderList(); @@ -3347,33 +3347,33 @@ public final class Automation { } } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRole.Builder addDevRoleBuilder() { + public ztp.Ztp.DeviceRole.Builder addDevRoleBuilder() { return getDevRoleFieldBuilder().addBuilder( - automation.Automation.DeviceRole.getDefaultInstance()); + ztp.Ztp.DeviceRole.getDefaultInstance()); } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public automation.Automation.DeviceRole.Builder addDevRoleBuilder( + public ztp.Ztp.DeviceRole.Builder addDevRoleBuilder( int index) { return getDevRoleFieldBuilder().addBuilder( - index, automation.Automation.DeviceRole.getDefaultInstance()); + index, ztp.Ztp.DeviceRole.getDefaultInstance()); } /** - * <code>repeated .automation.DeviceRole devRole = 1;</code> + * <code>repeated .ztp.DeviceRole devRole = 1;</code> */ - public java.util.List<automation.Automation.DeviceRole.Builder> + public java.util.List<ztp.Ztp.DeviceRole.Builder> getDevRoleBuilderList() { return getDevRoleFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< - automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> + ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder> getDevRoleFieldBuilder() { if (devRoleBuilder_ == null) { devRoleBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>( + ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRole.Builder, ztp.Ztp.DeviceRoleOrBuilder>( devRole_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), @@ -3395,16 +3395,16 @@ public final class Automation { } - // @@protoc_insertion_point(builder_scope:automation.DeviceRoleList) + // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleList) } - // @@protoc_insertion_point(class_scope:automation.DeviceRoleList) - private static final automation.Automation.DeviceRoleList DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:ztp.DeviceRoleList) + private static final ztp.Ztp.DeviceRoleList DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new automation.Automation.DeviceRoleList(); + DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleList(); } - public static automation.Automation.DeviceRoleList getDefaultInstance() { + public static ztp.Ztp.DeviceRoleList getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -3429,48 +3429,48 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleList getDefaultInstanceForType() { + public ztp.Ztp.DeviceRoleList getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface DeviceRoleStateOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.DeviceRoleState) + // @@protoc_insertion_point(interface_extends:ztp.DeviceRoleState) com.google.protobuf.MessageOrBuilder { /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return Whether the devRoleId field is set. */ boolean hasDevRoleId(); /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return The devRoleId. */ - automation.Automation.DeviceRoleId getDevRoleId(); + ztp.Ztp.DeviceRoleId getDevRoleId(); /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder(); + ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder(); /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return The enum numeric value on the wire for devRoleState. */ int getDevRoleStateValue(); /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return The devRoleState. */ - automation.Automation.ZtpDeviceState getDevRoleState(); + ztp.Ztp.ZtpDeviceState getDevRoleState(); } /** - * Protobuf type {@code automation.DeviceRoleState} + * Protobuf type {@code ztp.DeviceRoleState} */ public static final class DeviceRoleState extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.DeviceRoleState) + // @@protoc_insertion_point(message_implements:ztp.DeviceRoleState) DeviceRoleStateOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceRoleState.newBuilder() to construct. @@ -3512,11 +3512,11 @@ public final class Automation { done = true; break; case 10: { - automation.Automation.DeviceRoleId.Builder subBuilder = null; + ztp.Ztp.DeviceRoleId.Builder subBuilder = null; if (devRoleId_ != null) { subBuilder = devRoleId_.toBuilder(); } - devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry); + devRoleId_ = input.readMessage(ztp.Ztp.DeviceRoleId.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(devRoleId_); devRoleId_ = subBuilder.buildPartial(); @@ -3551,21 +3551,21 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleState_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleState_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleState_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class); + ztp.Ztp.DeviceRoleState.class, ztp.Ztp.DeviceRoleState.Builder.class); } public static final int DEVROLEID_FIELD_NUMBER = 1; - private automation.Automation.DeviceRoleId devRoleId_; + private ztp.Ztp.DeviceRoleId devRoleId_; /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return Whether the devRoleId field is set. */ @java.lang.Override @@ -3573,38 +3573,38 @@ public final class Automation { return devRoleId_ != null; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return The devRoleId. */ @java.lang.Override - public automation.Automation.DeviceRoleId getDevRoleId() { - return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_; + public ztp.Ztp.DeviceRoleId getDevRoleId() { + return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ @java.lang.Override - public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { + public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { return getDevRoleId(); } public static final int DEVROLESTATE_FIELD_NUMBER = 2; private int devRoleState_; /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return The enum numeric value on the wire for devRoleState. */ @java.lang.Override public int getDevRoleStateValue() { return devRoleState_; } /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return The devRoleState. */ - @java.lang.Override public automation.Automation.ZtpDeviceState getDevRoleState() { + @java.lang.Override public ztp.Ztp.ZtpDeviceState getDevRoleState() { @SuppressWarnings("deprecation") - automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_); - return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result; + ztp.Ztp.ZtpDeviceState result = ztp.Ztp.ZtpDeviceState.valueOf(devRoleState_); + return result == null ? ztp.Ztp.ZtpDeviceState.UNRECOGNIZED : result; } private byte memoizedIsInitialized = -1; @@ -3624,7 +3624,7 @@ public final class Automation { if (devRoleId_ != null) { output.writeMessage(1, getDevRoleId()); } - if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) { + if (devRoleState_ != ztp.Ztp.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) { output.writeEnum(2, devRoleState_); } unknownFields.writeTo(output); @@ -3640,7 +3640,7 @@ public final class Automation { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getDevRoleId()); } - if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) { + if (devRoleState_ != ztp.Ztp.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, devRoleState_); } @@ -3654,10 +3654,10 @@ public final class Automation { if (obj == this) { return true; } - if (!(obj instanceof automation.Automation.DeviceRoleState)) { + if (!(obj instanceof ztp.Ztp.DeviceRoleState)) { return super.equals(obj); } - automation.Automation.DeviceRoleState other = (automation.Automation.DeviceRoleState) obj; + ztp.Ztp.DeviceRoleState other = (ztp.Ztp.DeviceRoleState) obj; if (hasDevRoleId() != other.hasDevRoleId()) return false; if (hasDevRoleId()) { @@ -3687,69 +3687,69 @@ public final class Automation { return hash; } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleState parseFrom(byte[] data) + public static ztp.Ztp.DeviceRoleState parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceRoleState parseFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleState parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleState parseDelimitedFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceRoleState parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleState parseDelimitedFrom( + public static ztp.Ztp.DeviceRoleState parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceRoleState parseFrom( + public static ztp.Ztp.DeviceRoleState parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3762,7 +3762,7 @@ public final class Automation { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(automation.Automation.DeviceRoleState prototype) { + public static Builder newBuilder(ztp.Ztp.DeviceRoleState prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -3778,26 +3778,26 @@ public final class Automation { return builder; } /** - * Protobuf type {@code automation.DeviceRoleState} + * Protobuf type {@code ztp.DeviceRoleState} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:automation.DeviceRoleState) - automation.Automation.DeviceRoleStateOrBuilder { + // @@protoc_insertion_point(builder_implements:ztp.DeviceRoleState) + ztp.Ztp.DeviceRoleStateOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceRoleState_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleState_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceRoleState_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class); + ztp.Ztp.DeviceRoleState.class, ztp.Ztp.DeviceRoleState.Builder.class); } - // Construct using automation.Automation.DeviceRoleState.newBuilder() + // Construct using ztp.Ztp.DeviceRoleState.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -3829,17 +3829,17 @@ public final class Automation { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return automation.Automation.internal_static_automation_DeviceRoleState_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceRoleState_descriptor; } @java.lang.Override - public automation.Automation.DeviceRoleState getDefaultInstanceForType() { - return automation.Automation.DeviceRoleState.getDefaultInstance(); + public ztp.Ztp.DeviceRoleState getDefaultInstanceForType() { + return ztp.Ztp.DeviceRoleState.getDefaultInstance(); } @java.lang.Override - public automation.Automation.DeviceRoleState build() { - automation.Automation.DeviceRoleState result = buildPartial(); + public ztp.Ztp.DeviceRoleState build() { + ztp.Ztp.DeviceRoleState result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -3847,8 +3847,8 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleState buildPartial() { - automation.Automation.DeviceRoleState result = new automation.Automation.DeviceRoleState(this); + public ztp.Ztp.DeviceRoleState buildPartial() { + ztp.Ztp.DeviceRoleState result = new ztp.Ztp.DeviceRoleState(this); if (devRoleIdBuilder_ == null) { result.devRoleId_ = devRoleId_; } else { @@ -3893,16 +3893,16 @@ public final class Automation { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof automation.Automation.DeviceRoleState) { - return mergeFrom((automation.Automation.DeviceRoleState)other); + if (other instanceof ztp.Ztp.DeviceRoleState) { + return mergeFrom((ztp.Ztp.DeviceRoleState)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(automation.Automation.DeviceRoleState other) { - if (other == automation.Automation.DeviceRoleState.getDefaultInstance()) return this; + public Builder mergeFrom(ztp.Ztp.DeviceRoleState other) { + if (other == ztp.Ztp.DeviceRoleState.getDefaultInstance()) return this; if (other.hasDevRoleId()) { mergeDevRoleId(other.getDevRoleId()); } @@ -3924,11 +3924,11 @@ public final class Automation { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - automation.Automation.DeviceRoleState parsedMessage = null; + ztp.Ztp.DeviceRoleState parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.DeviceRoleState) e.getUnfinishedMessage(); + parsedMessage = (ztp.Ztp.DeviceRoleState) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -3938,31 +3938,31 @@ public final class Automation { return this; } - private automation.Automation.DeviceRoleId devRoleId_; + private ztp.Ztp.DeviceRoleId devRoleId_; private com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_; + ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> devRoleIdBuilder_; /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return Whether the devRoleId field is set. */ public boolean hasDevRoleId() { return devRoleIdBuilder_ != null || devRoleId_ != null; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> * @return The devRoleId. */ - public automation.Automation.DeviceRoleId getDevRoleId() { + public ztp.Ztp.DeviceRoleId getDevRoleId() { if (devRoleIdBuilder_ == null) { - return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_; + return devRoleId_ == null ? ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_; } else { return devRoleIdBuilder_.getMessage(); } } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public Builder setDevRoleId(automation.Automation.DeviceRoleId value) { + public Builder setDevRoleId(ztp.Ztp.DeviceRoleId value) { if (devRoleIdBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -3976,10 +3976,10 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ public Builder setDevRoleId( - automation.Automation.DeviceRoleId.Builder builderForValue) { + ztp.Ztp.DeviceRoleId.Builder builderForValue) { if (devRoleIdBuilder_ == null) { devRoleId_ = builderForValue.build(); onChanged(); @@ -3990,13 +3990,13 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) { + public Builder mergeDevRoleId(ztp.Ztp.DeviceRoleId value) { if (devRoleIdBuilder_ == null) { if (devRoleId_ != null) { devRoleId_ = - automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial(); + ztp.Ztp.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial(); } else { devRoleId_ = value; } @@ -4008,7 +4008,7 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ public Builder clearDevRoleId() { if (devRoleIdBuilder_ == null) { @@ -4022,33 +4022,33 @@ public final class Automation { return this; } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() { + public ztp.Ztp.DeviceRoleId.Builder getDevRoleIdBuilder() { onChanged(); return getDevRoleIdFieldBuilder().getBuilder(); } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ - public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { + public ztp.Ztp.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() { if (devRoleIdBuilder_ != null) { return devRoleIdBuilder_.getMessageOrBuilder(); } else { return devRoleId_ == null ? - automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_; + ztp.Ztp.DeviceRoleId.getDefaultInstance() : devRoleId_; } } /** - * <code>.automation.DeviceRoleId devRoleId = 1;</code> + * <code>.ztp.DeviceRoleId devRoleId = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> + ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder> getDevRoleIdFieldBuilder() { if (devRoleIdBuilder_ == null) { devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>( + ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRoleId.Builder, ztp.Ztp.DeviceRoleIdOrBuilder>( getDevRoleId(), getParentForChildren(), isClean()); @@ -4059,14 +4059,14 @@ public final class Automation { private int devRoleState_ = 0; /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return The enum numeric value on the wire for devRoleState. */ @java.lang.Override public int getDevRoleStateValue() { return devRoleState_; } /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @param value The enum numeric value on the wire for devRoleState to set. * @return This builder for chaining. */ @@ -4077,21 +4077,21 @@ public final class Automation { return this; } /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return The devRoleState. */ @java.lang.Override - public automation.Automation.ZtpDeviceState getDevRoleState() { + public ztp.Ztp.ZtpDeviceState getDevRoleState() { @SuppressWarnings("deprecation") - automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_); - return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result; + ztp.Ztp.ZtpDeviceState result = ztp.Ztp.ZtpDeviceState.valueOf(devRoleState_); + return result == null ? ztp.Ztp.ZtpDeviceState.UNRECOGNIZED : result; } /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @param value The devRoleState to set. * @return This builder for chaining. */ - public Builder setDevRoleState(automation.Automation.ZtpDeviceState value) { + public Builder setDevRoleState(ztp.Ztp.ZtpDeviceState value) { if (value == null) { throw new NullPointerException(); } @@ -4101,7 +4101,7 @@ public final class Automation { return this; } /** - * <code>.automation.ZtpDeviceState devRoleState = 2;</code> + * <code>.ztp.ZtpDeviceState devRoleState = 2;</code> * @return This builder for chaining. */ public Builder clearDevRoleState() { @@ -4123,16 +4123,16 @@ public final class Automation { } - // @@protoc_insertion_point(builder_scope:automation.DeviceRoleState) + // @@protoc_insertion_point(builder_scope:ztp.DeviceRoleState) } - // @@protoc_insertion_point(class_scope:automation.DeviceRoleState) - private static final automation.Automation.DeviceRoleState DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:ztp.DeviceRoleState) + private static final ztp.Ztp.DeviceRoleState DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new automation.Automation.DeviceRoleState(); + DEFAULT_INSTANCE = new ztp.Ztp.DeviceRoleState(); } - public static automation.Automation.DeviceRoleState getDefaultInstance() { + public static ztp.Ztp.DeviceRoleState getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -4157,14 +4157,14 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceRoleState getDefaultInstanceForType() { + public ztp.Ztp.DeviceRoleState getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } public interface DeviceDeletionResultOrBuilder extends - // @@protoc_insertion_point(interface_extends:automation.DeviceDeletionResult) + // @@protoc_insertion_point(interface_extends:ztp.DeviceDeletionResult) com.google.protobuf.MessageOrBuilder { /** @@ -4193,11 +4193,11 @@ public final class Automation { getDeletedBytes(int index); } /** - * Protobuf type {@code automation.DeviceDeletionResult} + * Protobuf type {@code ztp.DeviceDeletionResult} */ public static final class DeviceDeletionResult extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:automation.DeviceDeletionResult) + // @@protoc_insertion_point(message_implements:ztp.DeviceDeletionResult) DeviceDeletionResultOrBuilder { private static final long serialVersionUID = 0L; // Use DeviceDeletionResult.newBuilder() to construct. @@ -4272,15 +4272,15 @@ public final class Automation { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class); + ztp.Ztp.DeviceDeletionResult.class, ztp.Ztp.DeviceDeletionResult.Builder.class); } public static final int DELETED_FIELD_NUMBER = 1; @@ -4362,10 +4362,10 @@ public final class Automation { if (obj == this) { return true; } - if (!(obj instanceof automation.Automation.DeviceDeletionResult)) { + if (!(obj instanceof ztp.Ztp.DeviceDeletionResult)) { return super.equals(obj); } - automation.Automation.DeviceDeletionResult other = (automation.Automation.DeviceDeletionResult) obj; + ztp.Ztp.DeviceDeletionResult other = (ztp.Ztp.DeviceDeletionResult) obj; if (!getDeletedList() .equals(other.getDeletedList())) return false; @@ -4389,69 +4389,69 @@ public final class Automation { return hash; } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceDeletionResult parseFrom(byte[] data) + public static ztp.Ztp.DeviceDeletionResult parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static automation.Automation.DeviceDeletionResult parseFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceDeletionResult parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(java.io.InputStream input) + public static ztp.Ztp.DeviceDeletionResult parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static automation.Automation.DeviceDeletionResult parseDelimitedFrom( + public static ztp.Ztp.DeviceDeletionResult parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static automation.Automation.DeviceDeletionResult parseFrom( + public static ztp.Ztp.DeviceDeletionResult parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -4464,7 +4464,7 @@ public final class Automation { public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(automation.Automation.DeviceDeletionResult prototype) { + public static Builder newBuilder(ztp.Ztp.DeviceDeletionResult prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override @@ -4480,26 +4480,26 @@ public final class Automation { return builder; } /** - * Protobuf type {@code automation.DeviceDeletionResult} + * Protobuf type {@code ztp.DeviceDeletionResult} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements - // @@protoc_insertion_point(builder_implements:automation.DeviceDeletionResult) - automation.Automation.DeviceDeletionResultOrBuilder { + // @@protoc_insertion_point(builder_implements:ztp.DeviceDeletionResult) + ztp.Ztp.DeviceDeletionResultOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { - return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable + return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_fieldAccessorTable .ensureFieldAccessorsInitialized( - automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class); + ztp.Ztp.DeviceDeletionResult.class, ztp.Ztp.DeviceDeletionResult.Builder.class); } - // Construct using automation.Automation.DeviceDeletionResult.newBuilder() + // Construct using ztp.Ztp.DeviceDeletionResult.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -4525,17 +4525,17 @@ public final class Automation { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor; + return ztp.Ztp.internal_static_ztp_DeviceDeletionResult_descriptor; } @java.lang.Override - public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() { - return automation.Automation.DeviceDeletionResult.getDefaultInstance(); + public ztp.Ztp.DeviceDeletionResult getDefaultInstanceForType() { + return ztp.Ztp.DeviceDeletionResult.getDefaultInstance(); } @java.lang.Override - public automation.Automation.DeviceDeletionResult build() { - automation.Automation.DeviceDeletionResult result = buildPartial(); + public ztp.Ztp.DeviceDeletionResult build() { + ztp.Ztp.DeviceDeletionResult result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -4543,8 +4543,8 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceDeletionResult buildPartial() { - automation.Automation.DeviceDeletionResult result = new automation.Automation.DeviceDeletionResult(this); + public ztp.Ztp.DeviceDeletionResult buildPartial() { + ztp.Ztp.DeviceDeletionResult result = new ztp.Ztp.DeviceDeletionResult(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) != 0)) { deleted_ = deleted_.getUnmodifiableView(); @@ -4589,16 +4589,16 @@ public final class Automation { } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof automation.Automation.DeviceDeletionResult) { - return mergeFrom((automation.Automation.DeviceDeletionResult)other); + if (other instanceof ztp.Ztp.DeviceDeletionResult) { + return mergeFrom((ztp.Ztp.DeviceDeletionResult)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(automation.Automation.DeviceDeletionResult other) { - if (other == automation.Automation.DeviceDeletionResult.getDefaultInstance()) return this; + public Builder mergeFrom(ztp.Ztp.DeviceDeletionResult other) { + if (other == ztp.Ztp.DeviceDeletionResult.getDefaultInstance()) return this; if (!other.deleted_.isEmpty()) { if (deleted_.isEmpty()) { deleted_ = other.deleted_; @@ -4624,11 +4624,11 @@ public final class Automation { com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - automation.Automation.DeviceDeletionResult parsedMessage = null; + ztp.Ztp.DeviceDeletionResult parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (automation.Automation.DeviceDeletionResult) e.getUnfinishedMessage(); + parsedMessage = (ztp.Ztp.DeviceDeletionResult) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -4761,16 +4761,16 @@ public final class Automation { } - // @@protoc_insertion_point(builder_scope:automation.DeviceDeletionResult) + // @@protoc_insertion_point(builder_scope:ztp.DeviceDeletionResult) } - // @@protoc_insertion_point(class_scope:automation.DeviceDeletionResult) - private static final automation.Automation.DeviceDeletionResult DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:ztp.DeviceDeletionResult) + private static final ztp.Ztp.DeviceDeletionResult DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new automation.Automation.DeviceDeletionResult(); + DEFAULT_INSTANCE = new ztp.Ztp.DeviceDeletionResult(); } - public static automation.Automation.DeviceDeletionResult getDefaultInstance() { + public static ztp.Ztp.DeviceDeletionResult getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -4795,42 +4795,42 @@ public final class Automation { } @java.lang.Override - public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() { + public ztp.Ztp.DeviceDeletionResult getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_DeviceRoleId_descriptor; + internal_static_ztp_DeviceRoleId_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_DeviceRoleId_fieldAccessorTable; + internal_static_ztp_DeviceRoleId_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_DeviceRole_descriptor; + internal_static_ztp_DeviceRole_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_DeviceRole_fieldAccessorTable; + internal_static_ztp_DeviceRole_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_DeviceRoleConfig_descriptor; + internal_static_ztp_DeviceRoleConfig_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_DeviceRoleConfig_fieldAccessorTable; + internal_static_ztp_DeviceRoleConfig_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_DeviceRoleList_descriptor; + internal_static_ztp_DeviceRoleList_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_DeviceRoleList_fieldAccessorTable; + internal_static_ztp_DeviceRoleList_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_DeviceRoleState_descriptor; + internal_static_ztp_DeviceRoleState_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_DeviceRoleState_fieldAccessorTable; + internal_static_ztp_DeviceRoleState_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor - internal_static_automation_DeviceDeletionResult_descriptor; + internal_static_ztp_DeviceDeletionResult_descriptor; private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_automation_DeviceDeletionResult_fieldAccessorTable; + internal_static_ztp_DeviceDeletionResult_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -4840,78 +4840,74 @@ public final class Automation { descriptor; static { java.lang.String[] descriptorData = { - "\n\020automation.proto\022\nautomation\032\rcontext." + - "proto\"R\n\014DeviceRoleId\022 \n\tdevRoleId\030\001 \001(\013" + - "2\r.context.Uuid\022 \n\005devId\030\002 \001(\0132\021.context" + - ".DeviceId\"j\n\nDeviceRole\022+\n\tdevRoleId\030\001 \001" + - "(\0132\030.automation.DeviceRoleId\022/\n\013devRoleT" + - "ype\030\002 \001(\0162\032.automation.DeviceRoleType\"e\n" + - "\020DeviceRoleConfig\022\'\n\007devRole\030\001 \001(\0132\026.aut" + - "omation.DeviceRole\022(\n\tdevConfig\030\002 \001(\0132\025." + - "context.DeviceConfig\"9\n\016DeviceRoleList\022\'" + - "\n\007devRole\030\001 \003(\0132\026.automation.DeviceRole\"" + - "p\n\017DeviceRoleState\022+\n\tdevRoleId\030\001 \001(\0132\030." + - "automation.DeviceRoleId\0220\n\014devRoleState\030" + - "\002 \001(\0162\032.automation.ZtpDeviceState\"\'\n\024Dev" + - "iceDeletionResult\022\017\n\007deleted\030\001 \003(\t*H\n\016De" + - "viceRoleType\022\010\n\004NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010D" + - "EV_CONF\020\002\022\021\n\rPIPELINE_CONF\020\003*~\n\016ZtpDevic" + - "eState\022\033\n\027ZTP_DEV_STATE_UNDEFINED\020\000\022\031\n\025Z" + - "TP_DEV_STATE_CREATED\020\001\022\031\n\025ZTP_DEV_STATE_" + - "UPDATED\020\002\022\031\n\025ZTP_DEV_STATE_DELETED\020\0032\276\003\n" + - "\021AutomationService\022F\n\020ZtpGetDeviceRole\022\030" + - ".automation.DeviceRoleId\032\026.automation.De" + - "viceRole\"\000\022N\n\033ZtpGetDeviceRolesByDeviceI" + - "d\022\021.context.DeviceId\032\032.automation.Device" + - "RoleList\"\000\022?\n\006ZtpAdd\022\026.automation.Device" + - "Role\032\033.automation.DeviceRoleState\"\000\022H\n\tZ" + - "tpUpdate\022\034.automation.DeviceRoleConfig\032\033" + - ".automation.DeviceRoleState\"\000\022B\n\tZtpDele" + - "te\022\026.automation.DeviceRole\032\033.automation." + - "DeviceRoleState\"\000\022B\n\014ZtpDeleteAll\022\016.cont" + - "ext.Empty\032 .automation.DeviceDeletionRes" + - "ult\"\000b\006proto3" + "\n\tztp.proto\022\003ztp\032\rcontext.proto\"R\n\014Devic" + + "eRoleId\022 \n\tdevRoleId\030\001 \001(\0132\r.context.Uui" + + "d\022 \n\005devId\030\002 \001(\0132\021.context.DeviceId\"\\\n\nD" + + "eviceRole\022$\n\tdevRoleId\030\001 \001(\0132\021.ztp.Devic" + + "eRoleId\022(\n\013devRoleType\030\002 \001(\0162\023.ztp.Devic" + + "eRoleType\"^\n\020DeviceRoleConfig\022 \n\007devRole" + + "\030\001 \001(\0132\017.ztp.DeviceRole\022(\n\tdevConfig\030\002 \001" + + "(\0132\025.context.DeviceConfig\"2\n\016DeviceRoleL" + + "ist\022 \n\007devRole\030\001 \003(\0132\017.ztp.DeviceRole\"b\n" + + "\017DeviceRoleState\022$\n\tdevRoleId\030\001 \001(\0132\021.zt" + + "p.DeviceRoleId\022)\n\014devRoleState\030\002 \001(\0162\023.z" + + "tp.ZtpDeviceState\"\'\n\024DeviceDeletionResul" + + "t\022\017\n\007deleted\030\001 \003(\t*H\n\016DeviceRoleType\022\010\n\004" + + "NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010DEV_CONF\020\002\022\021\n\rPIP" + + "ELINE_CONF\020\003*~\n\016ZtpDeviceState\022\033\n\027ZTP_DE" + + "V_STATE_UNDEFINED\020\000\022\031\n\025ZTP_DEV_STATE_CRE" + + "ATED\020\001\022\031\n\025ZTP_DEV_STATE_UPDATED\020\002\022\031\n\025ZTP" + + "_DEV_STATE_DELETED\020\0032\361\002\n\nZtpService\0228\n\020Z" + + "tpGetDeviceRole\022\021.ztp.DeviceRoleId\032\017.ztp" + + ".DeviceRole\"\000\022G\n\033ZtpGetDeviceRolesByDevi" + + "ceId\022\021.context.DeviceId\032\023.ztp.DeviceRole" + + "List\"\000\0221\n\006ZtpAdd\022\017.ztp.DeviceRole\032\024.ztp." + + "DeviceRoleState\"\000\022:\n\tZtpUpdate\022\025.ztp.Dev" + + "iceRoleConfig\032\024.ztp.DeviceRoleState\"\000\0224\n" + + "\tZtpDelete\022\017.ztp.DeviceRole\032\024.ztp.Device" + + "RoleState\"\000\022;\n\014ZtpDeleteAll\022\016.context.Em" + + "pty\032\031.ztp.DeviceDeletionResult\"\000b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { context.ContextOuterClass.getDescriptor(), }); - internal_static_automation_DeviceRoleId_descriptor = + internal_static_ztp_DeviceRoleId_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_automation_DeviceRoleId_fieldAccessorTable = new + internal_static_ztp_DeviceRoleId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_DeviceRoleId_descriptor, + internal_static_ztp_DeviceRoleId_descriptor, new java.lang.String[] { "DevRoleId", "DevId", }); - internal_static_automation_DeviceRole_descriptor = + internal_static_ztp_DeviceRole_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_automation_DeviceRole_fieldAccessorTable = new + internal_static_ztp_DeviceRole_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_DeviceRole_descriptor, + internal_static_ztp_DeviceRole_descriptor, new java.lang.String[] { "DevRoleId", "DevRoleType", }); - internal_static_automation_DeviceRoleConfig_descriptor = + internal_static_ztp_DeviceRoleConfig_descriptor = getDescriptor().getMessageTypes().get(2); - internal_static_automation_DeviceRoleConfig_fieldAccessorTable = new + internal_static_ztp_DeviceRoleConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_DeviceRoleConfig_descriptor, + internal_static_ztp_DeviceRoleConfig_descriptor, new java.lang.String[] { "DevRole", "DevConfig", }); - internal_static_automation_DeviceRoleList_descriptor = + internal_static_ztp_DeviceRoleList_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_automation_DeviceRoleList_fieldAccessorTable = new + internal_static_ztp_DeviceRoleList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_DeviceRoleList_descriptor, + internal_static_ztp_DeviceRoleList_descriptor, new java.lang.String[] { "DevRole", }); - internal_static_automation_DeviceRoleState_descriptor = + internal_static_ztp_DeviceRoleState_descriptor = getDescriptor().getMessageTypes().get(4); - internal_static_automation_DeviceRoleState_fieldAccessorTable = new + internal_static_ztp_DeviceRoleState_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_DeviceRoleState_descriptor, + internal_static_ztp_DeviceRoleState_descriptor, new java.lang.String[] { "DevRoleId", "DevRoleState", }); - internal_static_automation_DeviceDeletionResult_descriptor = + internal_static_ztp_DeviceDeletionResult_descriptor = getDescriptor().getMessageTypes().get(5); - internal_static_automation_DeviceDeletionResult_fieldAccessorTable = new + internal_static_ztp_DeviceDeletionResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_automation_DeviceDeletionResult_descriptor, + internal_static_ztp_DeviceDeletionResult_descriptor, new java.lang.String[] { "Deleted", }); context.ContextOuterClass.getDescriptor(); } diff --git a/src/ztp/target/generated-sources/grpc/ztp/ZtpService.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpService.java new file mode 100644 index 0000000000000000000000000000000000000000..6afcf457f919db71fa465a903a7afc52900c2ad0 --- /dev/null +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpService.java @@ -0,0 +1,26 @@ +package ztp; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: ztp.proto") +public interface ZtpService extends MutinyService { + + + io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRole> ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request); + + io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request); + + io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpAdd(ztp.Ztp.DeviceRole request); + + io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpUpdate(ztp.Ztp.DeviceRoleConfig request); + + io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpDelete(ztp.Ztp.DeviceRole request); + + io.smallrye.mutiny.Uni<ztp.Ztp.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request); + + + + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceBean.java similarity index 58% rename from src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java rename to src/ztp/target/generated-sources/grpc/ztp/ZtpServiceBean.java index 3c7923a0ce8a1501689d1bb567c915590376cf5f..bc15903127c9ee837e991f9b75a389b684ec568c 100644 --- a/src/automation/target/generated-sources/grpc/automation/AutomationServiceBean.java +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceBean.java @@ -1,4 +1,4 @@ -package automation; +package ztp; import io.grpc.BindableService; import io.quarkus.grpc.GrpcService; @@ -6,17 +6,17 @@ import io.quarkus.grpc.runtime.MutinyBean; @javax.annotation.Generated( value = "by Mutiny Grpc generator", -comments = "Source: automation.proto") -public class AutomationServiceBean extends MutinyAutomationServiceGrpc.AutomationServiceImplBase implements BindableService, MutinyBean { +comments = "Source: ztp.proto") +public class ZtpServiceBean extends MutinyZtpServiceGrpc.ZtpServiceImplBase implements BindableService, MutinyBean { - private final AutomationService delegate; + private final ZtpService delegate; - AutomationServiceBean(@GrpcService AutomationService delegate) { + ZtpServiceBean(@GrpcService ZtpService delegate) { this.delegate = delegate; } @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRole> ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) { try { return delegate.ztpGetDeviceRole(request); } catch (UnsupportedOperationException e) { @@ -24,7 +24,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio } } @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { try { return delegate.ztpGetDeviceRolesByDeviceId(request); } catch (UnsupportedOperationException e) { @@ -32,7 +32,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio } } @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpAdd(ztp.Ztp.DeviceRole request) { try { return delegate.ztpAdd(request); } catch (UnsupportedOperationException e) { @@ -40,7 +40,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio } } @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpUpdate(ztp.Ztp.DeviceRoleConfig request) { try { return delegate.ztpUpdate(request); } catch (UnsupportedOperationException e) { @@ -48,7 +48,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio } } @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpDelete(ztp.Ztp.DeviceRole request) { try { return delegate.ztpDelete(request); } catch (UnsupportedOperationException e) { @@ -56,7 +56,7 @@ public class AutomationServiceBean extends MutinyAutomationServiceGrpc.Automatio } } @Override - public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { try { return delegate.ztpDeleteAll(request); } catch (UnsupportedOperationException e) { diff --git a/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceClient.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceClient.java new file mode 100644 index 0000000000000000000000000000000000000000..00abbc181d46f0df5588023c8da29786a73ae965 --- /dev/null +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceClient.java @@ -0,0 +1,48 @@ +package ztp; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: ztp.proto") +public class ZtpServiceClient implements ZtpService, MutinyClient<MutinyZtpServiceGrpc.MutinyZtpServiceStub> { + + private final MutinyZtpServiceGrpc.MutinyZtpServiceStub stub; + + public ZtpServiceClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyZtpServiceGrpc.MutinyZtpServiceStub, MutinyZtpServiceGrpc.MutinyZtpServiceStub> stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyZtpServiceGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyZtpServiceGrpc.MutinyZtpServiceStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRole> ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) { + return stub.ztpGetDeviceRole(request); + } + @Override + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { + return stub.ztpGetDeviceRolesByDeviceId(request); + } + @Override + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpAdd(ztp.Ztp.DeviceRole request) { + return stub.ztpAdd(request); + } + @Override + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpUpdate(ztp.Ztp.DeviceRoleConfig request) { + return stub.ztpUpdate(request); + } + @Override + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceRoleState> ztpDelete(ztp.Ztp.DeviceRole request) { + return stub.ztpDelete(request); + } + @Override + public io.smallrye.mutiny.Uni<ztp.Ztp.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) { + return stub.ztpDeleteAll(request); + } + +} \ No newline at end of file diff --git a/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceGrpc.java b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..ece33078b8058c2d63ddca4060b1b095d21dd8be --- /dev/null +++ b/src/ztp/target/generated-sources/grpc/ztp/ZtpServiceGrpc.java @@ -0,0 +1,645 @@ +package ztp; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: ztp.proto") +public final class ZtpServiceGrpc { + + private ZtpServiceGrpc() {} + + public static final String SERVICE_NAME = "ztp.ZtpService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor<ztp.Ztp.DeviceRoleId, + ztp.Ztp.DeviceRole> getZtpGetDeviceRoleMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRole", + requestType = ztp.Ztp.DeviceRoleId.class, + responseType = ztp.Ztp.DeviceRole.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<ztp.Ztp.DeviceRoleId, + ztp.Ztp.DeviceRole> getZtpGetDeviceRoleMethod() { + io.grpc.MethodDescriptor<ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRole> getZtpGetDeviceRoleMethod; + if ((getZtpGetDeviceRoleMethod = ZtpServiceGrpc.getZtpGetDeviceRoleMethod) == null) { + synchronized (ZtpServiceGrpc.class) { + if ((getZtpGetDeviceRoleMethod = ZtpServiceGrpc.getZtpGetDeviceRoleMethod) == null) { + ZtpServiceGrpc.getZtpGetDeviceRoleMethod = getZtpGetDeviceRoleMethod = + io.grpc.MethodDescriptor.<ztp.Ztp.DeviceRoleId, ztp.Ztp.DeviceRole>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRole")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRoleId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRole.getDefaultInstance())) + .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpGetDeviceRole")) + .build(); + } + } + } + return getZtpGetDeviceRoleMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, + ztp.Ztp.DeviceRoleList> getZtpGetDeviceRolesByDeviceIdMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ZtpGetDeviceRolesByDeviceId", + requestType = context.ContextOuterClass.DeviceId.class, + responseType = ztp.Ztp.DeviceRoleList.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, + ztp.Ztp.DeviceRoleList> getZtpGetDeviceRolesByDeviceIdMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.DeviceId, ztp.Ztp.DeviceRoleList> getZtpGetDeviceRolesByDeviceIdMethod; + if ((getZtpGetDeviceRolesByDeviceIdMethod = ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) { + synchronized (ZtpServiceGrpc.class) { + if ((getZtpGetDeviceRolesByDeviceIdMethod = ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod) == null) { + ZtpServiceGrpc.getZtpGetDeviceRolesByDeviceIdMethod = getZtpGetDeviceRolesByDeviceIdMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.DeviceId, ztp.Ztp.DeviceRoleList>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpGetDeviceRolesByDeviceId")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.DeviceId.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRoleList.getDefaultInstance())) + .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpGetDeviceRolesByDeviceId")) + .build(); + } + } + } + return getZtpGetDeviceRolesByDeviceIdMethod; + } + + private static volatile io.grpc.MethodDescriptor<ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState> getZtpAddMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ZtpAdd", + requestType = ztp.Ztp.DeviceRole.class, + responseType = ztp.Ztp.DeviceRoleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState> getZtpAddMethod() { + io.grpc.MethodDescriptor<ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRoleState> getZtpAddMethod; + if ((getZtpAddMethod = ZtpServiceGrpc.getZtpAddMethod) == null) { + synchronized (ZtpServiceGrpc.class) { + if ((getZtpAddMethod = ZtpServiceGrpc.getZtpAddMethod) == null) { + ZtpServiceGrpc.getZtpAddMethod = getZtpAddMethod = + io.grpc.MethodDescriptor.<ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRoleState>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpAdd")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRole.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRoleState.getDefaultInstance())) + .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpAdd")) + .build(); + } + } + } + return getZtpAddMethod; + } + + private static volatile io.grpc.MethodDescriptor<ztp.Ztp.DeviceRoleConfig, + ztp.Ztp.DeviceRoleState> getZtpUpdateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ZtpUpdate", + requestType = ztp.Ztp.DeviceRoleConfig.class, + responseType = ztp.Ztp.DeviceRoleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<ztp.Ztp.DeviceRoleConfig, + ztp.Ztp.DeviceRoleState> getZtpUpdateMethod() { + io.grpc.MethodDescriptor<ztp.Ztp.DeviceRoleConfig, ztp.Ztp.DeviceRoleState> getZtpUpdateMethod; + if ((getZtpUpdateMethod = ZtpServiceGrpc.getZtpUpdateMethod) == null) { + synchronized (ZtpServiceGrpc.class) { + if ((getZtpUpdateMethod = ZtpServiceGrpc.getZtpUpdateMethod) == null) { + ZtpServiceGrpc.getZtpUpdateMethod = getZtpUpdateMethod = + io.grpc.MethodDescriptor.<ztp.Ztp.DeviceRoleConfig, ztp.Ztp.DeviceRoleState>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpUpdate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRoleConfig.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRoleState.getDefaultInstance())) + .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpUpdate")) + .build(); + } + } + } + return getZtpUpdateMethod; + } + + private static volatile io.grpc.MethodDescriptor<ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState> getZtpDeleteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ZtpDelete", + requestType = ztp.Ztp.DeviceRole.class, + responseType = ztp.Ztp.DeviceRoleState.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState> getZtpDeleteMethod() { + io.grpc.MethodDescriptor<ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRoleState> getZtpDeleteMethod; + if ((getZtpDeleteMethod = ZtpServiceGrpc.getZtpDeleteMethod) == null) { + synchronized (ZtpServiceGrpc.class) { + if ((getZtpDeleteMethod = ZtpServiceGrpc.getZtpDeleteMethod) == null) { + ZtpServiceGrpc.getZtpDeleteMethod = getZtpDeleteMethod = + io.grpc.MethodDescriptor.<ztp.Ztp.DeviceRole, ztp.Ztp.DeviceRoleState>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDelete")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRole.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceRoleState.getDefaultInstance())) + .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpDelete")) + .build(); + } + } + } + return getZtpDeleteMethod; + } + + private static volatile io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, + ztp.Ztp.DeviceDeletionResult> getZtpDeleteAllMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ZtpDeleteAll", + requestType = context.ContextOuterClass.Empty.class, + responseType = ztp.Ztp.DeviceDeletionResult.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, + ztp.Ztp.DeviceDeletionResult> getZtpDeleteAllMethod() { + io.grpc.MethodDescriptor<context.ContextOuterClass.Empty, ztp.Ztp.DeviceDeletionResult> getZtpDeleteAllMethod; + if ((getZtpDeleteAllMethod = ZtpServiceGrpc.getZtpDeleteAllMethod) == null) { + synchronized (ZtpServiceGrpc.class) { + if ((getZtpDeleteAllMethod = ZtpServiceGrpc.getZtpDeleteAllMethod) == null) { + ZtpServiceGrpc.getZtpDeleteAllMethod = getZtpDeleteAllMethod = + io.grpc.MethodDescriptor.<context.ContextOuterClass.Empty, ztp.Ztp.DeviceDeletionResult>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ZtpDeleteAll")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + context.ContextOuterClass.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + ztp.Ztp.DeviceDeletionResult.getDefaultInstance())) + .setSchemaDescriptor(new ZtpServiceMethodDescriptorSupplier("ZtpDeleteAll")) + .build(); + } + } + } + return getZtpDeleteAllMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ZtpServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<ZtpServiceStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<ZtpServiceStub>() { + @java.lang.Override + public ZtpServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ZtpServiceStub(channel, callOptions); + } + }; + return ZtpServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ZtpServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<ZtpServiceBlockingStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<ZtpServiceBlockingStub>() { + @java.lang.Override + public ZtpServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ZtpServiceBlockingStub(channel, callOptions); + } + }; + return ZtpServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ZtpServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<ZtpServiceFutureStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<ZtpServiceFutureStub>() { + @java.lang.Override + public ZtpServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ZtpServiceFutureStub(channel, callOptions); + } + }; + return ZtpServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class ZtpServiceImplBase implements io.grpc.BindableService { + + /** + */ + public void ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRole> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRoleMethod(), responseObserver); + } + + /** + */ + public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleList> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpGetDeviceRolesByDeviceIdMethod(), responseObserver); + } + + /** + */ + public void ztpAdd(ztp.Ztp.DeviceRole request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpAddMethod(), responseObserver); + } + + /** + */ + public void ztpUpdate(ztp.Ztp.DeviceRoleConfig request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpUpdateMethod(), responseObserver); + } + + /** + */ + public void ztpDelete(ztp.Ztp.DeviceRole request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteMethod(), responseObserver); + } + + /** + */ + public void ztpDeleteAll(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceDeletionResult> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getZtpDeleteAllMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getZtpGetDeviceRoleMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + ztp.Ztp.DeviceRoleId, + ztp.Ztp.DeviceRole>( + this, METHODID_ZTP_GET_DEVICE_ROLE))) + .addMethod( + getZtpGetDeviceRolesByDeviceIdMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.DeviceId, + ztp.Ztp.DeviceRoleList>( + this, METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID))) + .addMethod( + getZtpAddMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState>( + this, METHODID_ZTP_ADD))) + .addMethod( + getZtpUpdateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + ztp.Ztp.DeviceRoleConfig, + ztp.Ztp.DeviceRoleState>( + this, METHODID_ZTP_UPDATE))) + .addMethod( + getZtpDeleteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + ztp.Ztp.DeviceRole, + ztp.Ztp.DeviceRoleState>( + this, METHODID_ZTP_DELETE))) + .addMethod( + getZtpDeleteAllMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + context.ContextOuterClass.Empty, + ztp.Ztp.DeviceDeletionResult>( + this, METHODID_ZTP_DELETE_ALL))) + .build(); + } + } + + /** + */ + public static final class ZtpServiceStub extends io.grpc.stub.AbstractAsyncStub<ZtpServiceStub> { + private ZtpServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ZtpServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ZtpServiceStub(channel, callOptions); + } + + /** + */ + public void ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRole> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleList> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void ztpAdd(ztp.Ztp.DeviceRole request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getZtpAddMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void ztpUpdate(ztp.Ztp.DeviceRoleConfig request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void ztpDelete(ztp.Ztp.DeviceRole request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void ztpDeleteAll(context.ContextOuterClass.Empty request, + io.grpc.stub.StreamObserver<ztp.Ztp.DeviceDeletionResult> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class ZtpServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<ZtpServiceBlockingStub> { + private ZtpServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ZtpServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ZtpServiceBlockingStub(channel, callOptions); + } + + /** + */ + public ztp.Ztp.DeviceRole ztpGetDeviceRole(ztp.Ztp.DeviceRoleId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getZtpGetDeviceRoleMethod(), getCallOptions(), request); + } + + /** + */ + public ztp.Ztp.DeviceRoleList ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions(), request); + } + + /** + */ + public ztp.Ztp.DeviceRoleState ztpAdd(ztp.Ztp.DeviceRole request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getZtpAddMethod(), getCallOptions(), request); + } + + /** + */ + public ztp.Ztp.DeviceRoleState ztpUpdate(ztp.Ztp.DeviceRoleConfig request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getZtpUpdateMethod(), getCallOptions(), request); + } + + /** + */ + public ztp.Ztp.DeviceRoleState ztpDelete(ztp.Ztp.DeviceRole request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getZtpDeleteMethod(), getCallOptions(), request); + } + + /** + */ + public ztp.Ztp.DeviceDeletionResult ztpDeleteAll(context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getZtpDeleteAllMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class ZtpServiceFutureStub extends io.grpc.stub.AbstractFutureStub<ZtpServiceFutureStub> { + private ZtpServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ZtpServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ZtpServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<ztp.Ztp.DeviceRole> ztpGetDeviceRole( + ztp.Ztp.DeviceRoleId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getZtpGetDeviceRoleMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<ztp.Ztp.DeviceRoleList> ztpGetDeviceRolesByDeviceId( + context.ContextOuterClass.DeviceId request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getZtpGetDeviceRolesByDeviceIdMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<ztp.Ztp.DeviceRoleState> ztpAdd( + ztp.Ztp.DeviceRole request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getZtpAddMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<ztp.Ztp.DeviceRoleState> ztpUpdate( + ztp.Ztp.DeviceRoleConfig request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getZtpUpdateMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<ztp.Ztp.DeviceRoleState> ztpDelete( + ztp.Ztp.DeviceRole request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getZtpDeleteMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<ztp.Ztp.DeviceDeletionResult> ztpDeleteAll( + context.ContextOuterClass.Empty request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getZtpDeleteAllMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_ZTP_GET_DEVICE_ROLE = 0; + private static final int METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID = 1; + private static final int METHODID_ZTP_ADD = 2; + private static final int METHODID_ZTP_UPDATE = 3; + private static final int METHODID_ZTP_DELETE = 4; + private static final int METHODID_ZTP_DELETE_ALL = 5; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final ZtpServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ZtpServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + case METHODID_ZTP_GET_DEVICE_ROLE: + serviceImpl.ztpGetDeviceRole((ztp.Ztp.DeviceRoleId) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRole>) responseObserver); + break; + case METHODID_ZTP_GET_DEVICE_ROLES_BY_DEVICE_ID: + serviceImpl.ztpGetDeviceRolesByDeviceId((context.ContextOuterClass.DeviceId) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleList>) responseObserver); + break; + case METHODID_ZTP_ADD: + serviceImpl.ztpAdd((ztp.Ztp.DeviceRole) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState>) responseObserver); + break; + case METHODID_ZTP_UPDATE: + serviceImpl.ztpUpdate((ztp.Ztp.DeviceRoleConfig) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState>) responseObserver); + break; + case METHODID_ZTP_DELETE: + serviceImpl.ztpDelete((ztp.Ztp.DeviceRole) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceRoleState>) responseObserver); + break; + case METHODID_ZTP_DELETE_ALL: + serviceImpl.ztpDeleteAll((context.ContextOuterClass.Empty) request, + (io.grpc.stub.StreamObserver<ztp.Ztp.DeviceDeletionResult>) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke( + io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class ZtpServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ZtpServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return ztp.Ztp.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ZtpService"); + } + } + + private static final class ZtpServiceFileDescriptorSupplier + extends ZtpServiceBaseDescriptorSupplier { + ZtpServiceFileDescriptorSupplier() {} + } + + private static final class ZtpServiceMethodDescriptorSupplier + extends ZtpServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ZtpServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ZtpServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ZtpServiceFileDescriptorSupplier()) + .addMethod(getZtpGetDeviceRoleMethod()) + .addMethod(getZtpGetDeviceRolesByDeviceIdMethod()) + .addMethod(getZtpAddMethod()) + .addMethod(getZtpUpdateMethod()) + .addMethod(getZtpDeleteMethod()) + .addMethod(getZtpDeleteAllMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/automation/target/kubernetes/kubernetes.yml b/src/ztp/target/kubernetes/kubernetes.yml similarity index 58% rename from src/automation/target/kubernetes/kubernetes.yml rename to src/ztp/target/kubernetes/kubernetes.yml index e0dc96c13046e09ae84f2afb4a4bb839c4166a1b..e3f3633657e236716fa9feaaca4c8f4af6d61a9c 100644 --- a/src/automation/target/kubernetes/kubernetes.yml +++ b/src/ztp/target/kubernetes/kubernetes.yml @@ -1,74 +1,61 @@ -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. --- apiVersion: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d - app.quarkus.io/build-timestamp: 2023-07-10 - 09:42:53 +0000 + app.quarkus.io/commit-id: 9d36a29ba5ef1fb46f7b51a5c477bdc4410ba548 + app.quarkus.io/build-timestamp: 2023-11-08 - 11:15:43 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: - app.kubernetes.io/name: automationservice - app: automationservice - name: automationservice + app.kubernetes.io/name: ztpservice + app: ztpservice + name: ztpservice spec: ports: - - name: http - port: 9192 - targetPort: 8080 - name: grpc-server port: 5050 targetPort: 5050 + - name: http + port: 9192 + targetPort: 8080 selector: - app.kubernetes.io/name: automationservice + app.kubernetes.io/name: ztpservice type: ClusterIP --- apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d - app.quarkus.io/build-timestamp: 2023-07-10 - 09:42:53 +0000 + app.quarkus.io/commit-id: 9d36a29ba5ef1fb46f7b51a5c477bdc4410ba548 + app.quarkus.io/build-timestamp: 2023-11-08 - 11:15:43 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: - app: automationservice - app.kubernetes.io/name: automationservice - name: automationservice + app: ztpservice + app.kubernetes.io/name: ztpservice + name: ztpservice spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/name: automationservice + app.kubernetes.io/name: ztpservice template: metadata: annotations: - app.quarkus.io/commit-id: 8d0654b519e90fe0127e7d1419adce25fa3a179d - app.quarkus.io/build-timestamp: 2023-07-10 - 09:42:53 +0000 + app.quarkus.io/commit-id: 9d36a29ba5ef1fb46f7b51a5c477bdc4410ba548 + app.quarkus.io/build-timestamp: 2023-11-08 - 11:15:43 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: - app: automationservice - app.kubernetes.io/name: automationservice + app: ztpservice + app.kubernetes.io/name: ztpservice spec: containers: - env: @@ -76,11 +63,11 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - - name: DEVICE_SERVICE_HOST - value: deviceservice - name: CONTEXT_SERVICE_HOST value: contextservice - image: labs.etsi.org:5050/tfs/controller/automation:0.2.0 + - name: DEVICE_SERVICE_HOST + value: deviceservice + image: labs.etsi.org:5050/tfs/controller/ztp:0.2.0 imagePullPolicy: Always livenessProbe: failureThreshold: 3 @@ -92,14 +79,14 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 10 - name: automationservice + name: ztpservice ports: - - containerPort: 8080 - name: http - protocol: TCP - containerPort: 5050 name: grpc-server protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP readinessProbe: failureThreshold: 3 httpGet: diff --git a/src/automation/util/set_version.sh b/src/ztp/util/set_version.sh similarity index 95% rename from src/automation/util/set_version.sh rename to src/ztp/util/set_version.sh index 578d2cd25beddad2a04096c585af5e0a356fbf3c..f4b6b09ade8643c9e407588d057b847078c320cd 100755 --- a/src/automation/util/set_version.sh +++ b/src/ztp/util/set_version.sh @@ -28,4 +28,4 @@ if [ "$(git status --untracked-files=no --porcelain)" ]; then fi ./mvnw versions:set versions:commit -DnewVersion="${version}" -git commit -am "release(automation): ${version}" +git commit -am "release(ztp): ${version}"